def load_radar_ts(time):
    radardt = timedelta(minutes=10)
    dateobj_start = (yyyymmddhhmmss_strtotime(args.date[0]) +
                     ddhhmmss_strtotime(time[0]) - radardt)
    dateobj_end = (yyyymmddhhmmss_strtotime(args.date[0]) +
                   ddhhmmss_strtotime(time[1]) - radardt)
    tinc = timedelta(hours=1)
    radarts = getfobj_ncdf_timeseries(radardir + radarpref,
                                      dateobj_start,
                                      dateobj_end,
                                      tinc,
                                      refdate=yyyymmddhhmmss_strtotime(
                                          args.date[0]),
                                      ncdffn_sufx=radarsufx,
                                      fieldn='pr',
                                      abs_datestr='yymmddhhmm',
                                      dwdradar=True)
    return radarts
def load_radar(date, t='00000000', return_array=False):
    dateobj = (yyyymmddhhmmss_strtotime(date) + ddhhmmss_strtotime(t))
    radardt = timedelta(minutes=10)  # TODO Is this correct???
    radardateobj = dateobj - radardt
    radarfn = radardir + radarpref + yymmddhhmm(radardateobj) + radarsufx
    radarfobj = getfobj_ncdf(radarfn, fieldn='pr', dwdradar=True)
    if return_array:
        return radarfobj.data
    else:
        return radarfobj
                    default=1,
                    help='Type of ensemble normalization. '
                    '0 (no normalization), 1 or 2.')
parser.add_argument('--recompute',
                    dest='recompute',
                    action='store_true',
                    help='Recompute pre-processed files.')
parser.set_defaults(recompute=False)
args = parser.parse_args()

assert args.n_kernel % 2 == 1, 'n_kernel must be odd'
kernel = (np.ones((args.n_kernel, args.n_kernel)) / float(
    (args.n_kernel * args.n_kernel)))

# Loop over time
tstart = yyyymmddhhmmss_strtotime(args.date_ana_start)
tend = yyyymmddhhmmss_strtotime(args.date_ana_stop)
tint = timedelta(hours=1)
if tstart == tend:
    timelist = [tstart]
else:
    timelist = make_timelist(tstart, tend, tint)

# Set up figure
fig, axarr = plt.subplots(1, 2, figsize=(10, 6))

# Loop over experiments
expid_str = ''
exp_list = []
for ie, expid in enumerate(args.expid):
    print 'expid = ', expid
Beispiel #4
0
                    default='20160610000000')
parser.add_argument('--date', metavar='date', type=str, nargs='+')
parser.add_argument('--time', metavar='time', type=str, nargs='+')
args = parser.parse_args()

exptag = ''
for exp in args.expid:
    exptag += exp + '_'
exptag = exptag[:-1]

savedir = '/e/uwork/extsrasp/save/' + exptag + '/prec_time/'
plotdir = '/e/uwork/extsrasp/plots/' + exptag + '/prec_time/'
if not os.path.exists(plotdir): os.makedirs(plotdir)

# Loop over time
tstart = yyyymmddhhmmss_strtotime(args.date_ini)
tend = yyyymmddhhmmss_strtotime(args.date_end)
tint = timedelta(days=1)
if tstart == tend:
    timelist = [tstart]
else:
    timelist = make_timelist(tstart, tend, tint)

matlist = []
for t in timelist:
    savefn = savedir + yyyymmddhhmmss(t) + '_' + str(args.time[0]) + '_' + str(
        args.time[1])
    tplot, savemat, labelslist = np.load(savefn + '.npy')
    matlist.append(savemat)

cdict = {