Changeset 804 in lmdz_wrf
- Timestamp:
- Jun 2, 2016, 1:58:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r802 r804 22 22 # PolyArea: Function to compute the area of the polygon following 'Shoelace formula' 23 23 # significant_decomposition: Function to decompose a given number by its signifcant potencies 24 # secondsDate: Function to know how many units of time are from a given pair of dates24 # unitsdsDate: Function to know how many units of time are from a given pair of dates 25 25 26 26 def values_line(line, splitv, chars): … … 6359 6359 return iipot, potencies, potval 6360 6360 6361 def secondsDate(refdate, date, units):6361 def unitsDate(refdate, date, units): 6362 6362 """ Function to know how many units of time are from a given pair of dates 6363 6363 refdate= date of reference (as [YYYY][MM][DD][HH][MI][SS]) 6364 6364 date= date to look for (as [YYYY][MM][DD][HH][MI][SS]) 6365 6365 units= units of time ('century', 'year', 'month', 'day', 'week', 'hour', 'minute', 'second') 6366 >>> secondsDate('19490101000000', '19760217082932', 'second')6366 >>> unitsDate('19490101000000', '19760217082932', 'second') 6367 6367 856081772.0 6368 >>> secondsDate('19490101000000', '19760217082932', 'minute')6368 >>> unitsDate('19490101000000', '19760217082932', 'minute') 6369 6369 237800.492222 6370 6370 """ 6371 6371 import datetime as dt 6372 fname = 'SecondsDate' 6372 fname = 'unitsDate' 6373 6374 if refdate == 'h': 6375 print fname + '_____________________________________________________________' 6376 print unitsDate.__doc__ 6377 quit() 6373 6378 6374 6379 yrref=int(refdate[0:4]) … … 6417 6422 return times 6418 6423 6419 print secondsDate('19490101000000', '19760217082932', 'second')6420 print secondsDate('19490101000000', '19760217082932', 'minute')6421 6422 quit()6424 #print unitsDate('19490101000000', '19760217082932', 'second') 6425 #print unitsDate('19490101000000', '19760217082932', 'minute') 6426 6427 #quit()
Note: See TracChangeset
for help on using the changeset viewer.