Changeset 2392 in lmdz_wrf for trunk


Ignore:
Timestamp:
Mar 11, 2019, 4:20:14 PM (6 years ago)
Author:
lfita
Message:

Starting to fix `temporal_stats' for ' agg'
Adding date fixing in 'CFtimes_plot'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r2374 r2392  
    23932393        Srefdate = txtunits[Ntxtunits - 2]
    23942394
     2395    # Looking for too short date
     2396    if len(Srefdate) == 8:
     2397        # Assuming Y-m[1 digit]-d[1 digit]
     2398        if Srefdate.count('-') == 2:
     2399            vals=Srefdate.split('-')
     2400            Srefdate=''
     2401            Srefdate = vals[0] + '-' + vals[1].zfill(2) + '-' + vals[2].zfill(2)
     2402        elif Srefdate.count('/') == 2:
     2403            vals=Srefdate.split('/')
     2404            Srefdate=''
     2405            Srefdate = vals[0] + '/' + vals[1].zfill(2) + '/' + vals[2].zfill(2)
     2406        else:
     2407            print errormsg
     2408            print '  ' + fname + ": I do not know how to deal with this '"+ Srefdate+\
     2409              "' date !!"
     2410            quit(-1)
     2411
    23952412    if not trefT == -1:
    23962413#        print '  ' + fname + ': refdate with time!'
  • trunk/tools/nc_var_tools.py

    r2384 r2392  
    2611526115
    2611626116    Lperiodn = {'year': 'yearly', 'month': 'monthly', 'day': 'daily',                \
    26117       'LTday': 'local-time daily', 'hour': 'hourly', 'minute': 'minutely'}
     26117      'LTday': 'local-time daily', 'hour': 'hourly', 'minute': 'minutely',           \
     26118      'aggseason': 'seasonal aggregation'}
    2611826119    Lstatn = {'min': 'minimum', 'max': 'maximum', 'mean': 'mean',                    \
    2611926120      'mean2': 'quadratic mean', 'std': 'standard deviation',                        \
     
    2645326454                    tvals = ovar[tuple(timeslc)]
    2645426455                else:
    26455                     newshape = list(vals.shape)
    26456                     aggslc = tslc[islc]
     26456                    newshape = list(ovar.shape)
     26457                    aggslc = tslcs[islc]
    2645726458                    NNtslc = len(aggslc)
    2645826459                    newshape[itdim] = NNtslc
    26459                     tvals = np.zeros(tuple(newshape), dtype=vals.dtype)
    26460                     origshape = list(vals.shape)
    26461                     iishape = list(vals.shape)
     26460                    tvals = np.zeros(tuple(newshape), dtype=ovar.dtype)
     26461                    origshape = list(ovar.shape)
     26462                    iishape = list(ovar.shape)
    2646226463                    for iislc in range(NNtslc):
    2646326464                        origshape[itdim] = aggslc[iislc]
    2646426465                        iishape[itdim] = iislc
    26465                         tvals[tuple(iishape)] = vals[tuple(origshape)]
     26466                        tvals[tuple(iishape)] = ovar[tuple(origshape)]
    2646626467
    2646726468                if statn == 'min':
Note: See TracChangeset for help on using the changeset viewer.