Changeset 804 in lmdz_wrf


Ignore:
Timestamp:
Jun 2, 2016, 1:58:08 PM (9 years ago)
Author:
lfita
Message:

Adding 'h' on function `unitsDate' (name changed also from secondsDate)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r802 r804  
    2222# PolyArea: Function to compute the area of the polygon following 'Shoelace formula'
    2323# 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 dates
     24# unitsdsDate: Function to know how many units of time are from a given pair of dates
    2525
    2626def values_line(line, splitv, chars):
     
    63596359    return iipot, potencies, potval
    63606360
    6361 def secondsDate(refdate, date, units):
     6361def unitsDate(refdate, date, units):
    63626362    """ Function to know how many units of time are from a given pair of dates
    63636363      refdate= date of reference (as [YYYY][MM][DD][HH][MI][SS])
    63646364      date= date to look for (as [YYYY][MM][DD][HH][MI][SS])
    63656365      units= units of time ('century', 'year', 'month', 'day', 'week', 'hour', 'minute', 'second')
    6366     >>> secondsDate('19490101000000', '19760217082932', 'second')
     6366    >>> unitsDate('19490101000000', '19760217082932', 'second')
    63676367    856081772.0
    6368     >>> secondsDate('19490101000000', '19760217082932', 'minute')
     6368    >>> unitsDate('19490101000000', '19760217082932', 'minute')
    63696369    237800.492222
    63706370    """
    63716371    import datetime as dt
    6372     fname = 'SecondsDate'
     6372    fname = 'unitsDate'
     6373
     6374    if refdate == 'h':
     6375        print fname + '_____________________________________________________________'
     6376        print unitsDate.__doc__
     6377        quit()
    63736378
    63746379    yrref=int(refdate[0:4])
     
    64176422    return times
    64186423
    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.