- Timestamp:
- Mar 31, 2017, 6:25:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1480 r1481 10687 10687 odimvar = ncobjs[0].variables[vardimname] 10688 10688 odimvardims = odimvar.dimensions 10689 odimattrs = odimvar.ncattrs 10689 odimattrs = odimvar.ncattrs() 10690 10690 for dimn in odimvardims: 10691 10691 if not gen.searchInlist(newnc.dimensions,dimn): 10692 10692 Ldim = len(odimvar.dimensions[dimn]) 10693 newvar = newnc.cr ateVarieble(vardimname, odimvar.dtype, odimvardims)10693 newvar = newnc.createVariable(vardimname, odimvar.dtype, odimvardims) 10694 10694 for attrn in odimattrs: 10695 10695 attrv = odimvar.getncattr(attrn) … … 10715 10715 print ' ' + fname + ': concatenating dimension-variable has time units!' 10716 10716 print ' shifting temporal-values since the date of the first file', refdate 10717 10717 begslicetot = 0 10718 10718 for ifile in range(Nfiles): 10719 10719 slicevartot = [] … … 10728 10728 if tunits: 10729 10729 uvals = objvar.getncattr('units') 10730 newtimes = gen.coincident_CFtimes(objvar[:], u vals, urefvals)10731 newvar[tuple(slicevartot)] = objvar[:]10730 newtimes = gen.coincident_CFtimes(objvar[:], urefvals, uvals) 10731 newvar[tuple(slicevartot)] = newtimes[:] 10732 10732 else: 10733 10733 newvar[tuple(slicevartot)] = objvar[:] … … 10746 10746 print ' ' + fname + ": files do not have variable '" + dvar + "' !!!" 10747 10747 quit(-1) 10748 10749 if gen.searchInlist(desvars, vardimname): desvars.remove(vardimname) 10748 10750 10749 10751 for dvar in desvars:
Note: See TracChangeset
for help on using the changeset viewer.