- Timestamp:
- Nov 10, 2016, 2:19:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1305 r1306 17603 17603 tunits = tvaro.getncattr('units') 17604 17604 17605 # Fixing 0000 year issue... 17606 Stunits = tunits.split(' ') 17607 Utunits = tunits[0] 17608 if len(Stunits) == 4: 17609 datetunits = Stunits[2] + ' ' + Stunits[3] 17610 else: 17611 datetunits = Stunits[2] + ' 00:00:00' 17612 17613 if int(datetunits[0:4]) == 0: 17614 print warnmsg 17615 print ' ' + fname + ": Imposing a new units year for dates on '1900' !!" 17616 dateunits[0:4] = '1900' 17617 tunits = Utunits + ' since ' + dateunits 17618 17605 17619 RefDate = CFT.split(' ')[2] 17606 # Fixing 0000 year issue...17607 if int(RefDate[0:4]) == 0:17608 print warnmsg17609 print ' ' + fname + ": Imposing a new reference year for dates on '1900' !!"17610 RefDate[0:4] = '1900'17611 17612 17620 RefDateS = RefDate[0:4] + '-' + RefDate[4:6] + '-' + RefDate[6:8] + ' ' + \ 17613 17621 RefDate[8:10] + ':' + RefDate[10:12] + ':' + RefDate[12:14] 17614 17622 CFtimeUnits = ' '.join(CFT.split(' ')[0:2]) + ' '+ RefDateS 17615 17616 17623 17617 17624 newtvals = gen.coincident_CFtimes(tvals, CFtimeUnits, tunits)
Note: See TracChangeset
for help on using the changeset viewer.