Changeset 2474 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Apr 25, 2019, 2:34:24 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • `CFtimeU_inf': Classs to provide information of CFtime units
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2473 r2474  
    7979# CFmonthU_daysU: Function to transform from a CF date series with units as 'months since [DATE]' to 'days since [DATE]'
    8080# CFtime_freq: Function to provide the frequency of CF times (in seconds)
     81# CFtimeU_inf: Classs to provide information of CFtime units
    8182# CFtimes_datetime: Provide date/time array from a file with a series of netCDF CF-compilant time variable
    8283# CFtimesvar_datetime: Provide date/time array from a CF-compilant time variable
     
    1646916470    return newtimevals, newcftimeu
    1647016471
    16471 print fromanydate_CFYmd('1979.12.07')
    16472 
    1647316472class CFtimeU_inf(object):
    1647416473    """ Classs to provide information of CFtime units
     
    1649016489# Does original reference date contain a time value [YYYY]-[MM]-[DD] [HH]:[MI]:[SS]
    1649116490##
    16492         trefT = origcftimeu.find(':')
     16491        trefT = cftimeu.find(':')
    1649316492        if not trefT == -1:
    1649416493            if len(origtv) == 3:
     
    1650616505            secref = 0
    1650716506
    16508         self.refdate = origSrefdate + ' ' + horref + ':' + minref + ':' + secref
    16509         self.refdateYMHdms = yrref + monref + dayref + horref + minref + secref
     16507        horrefS = str(horref).zfill(2)
     16508        minrefS = str(minref).zfill(2)
     16509        secrefS = str(secref).zfill(2)
     16510
     16511        self.refdate = origSrefdate + ' ' + horrefS + ':' + minrefS + ':' + secrefS
     16512        self.refdateYMHdms = origSrefdate[0:4] + origSrefdate[5:7] +                 \
     16513          origSrefdate[8:10] + horrefS + ':' + minrefS + ':' + secrefS
     16514        self.refdatemat = [yrref, monref, dayref, horref, minref, secref]
    1651016515        self.Tunits = origtunits
    16511 
    16512 cftimev = CFtimeU_inf('hours since 1979-12-1')
    16513 printing_class(cftimev)
    16514 
    16515 quit()
    1651616516
    1651716517def from360d_reg(tvals, tunits):
     
    1652216522    fname = 'from360d_reg'
    1652316523
     16524    inftunits = CFtimeU_inf(tunits)
     16525
     16526    refdate = inftunits.refdatemat
    1652416527   
    1652516528
Note: See TracChangeset for help on using the changeset viewer.