Exemplo n.º 1
0
date = day1
pts = list(np.arange(420, 610, 5))
varList = ['T', 'VO', 'O3', 'PV', 'Z', 'U', 'V']

while date < day2:
    print(date)
    dat = ECMWF('FULL-EA', date, exp='VOZ')
    dat._get_var('T')
    dat._get_var('VO')
    dat._get_var('O3')
    dat._get_var('U')
    dat._get_var('V')
    dat._mkp()
    dat._mkz()
    dat._mkthet()
    dat._mkpv()
    if date >= datetime(2017, 10, 12, 0):
        dats[i] = dat.interpolPT(pts,
                                 varList=varList,
                                 latRange=(5, 35),
                                 lonRange=(100, 220))
    elif date >= datetime(2017, 10, 3, 0):
        datr = dat.shift2west(-180)
        dats[i] = datr.interpolPT(pts,
                                  varList=varList,
                                  latRange=(20, 50),
                                  lonRange=(-180, -60))
    elif date >= datetime(2017, 9, 23, 0):
        datr = dat.shift2west(-180)
        dats[i] = datr.interpolPT(pts,
Exemplo n.º 2
0
    part0['y'] = np.empty(0, dtype=float)
    part0['t'] = np.empty(0, dtype=float)
    part0['p'] = np.empty(0, dtype=float)
    part0['idx_back'] = np.empty(0, dtype=int)
    # It is assumed that both date_end and date_beg are valid dates for the EN files
    # The scan starts from date_end and proceeds to date_beg backward in time
    date_f = date_end
    date_p = date_f - ENint
    date_current = date_end

    # first read and first interpolation
    #data = read_ECMWF(ENdir,date_f)
    data = ECMWF('FULL-EI', date_f)
    data._get_var('T')
    data._mkp()  #This package was defined already in ECMWF_N.py file
    data._mkthet()  #This package was defined already in ECMWF_N.py file
    data.close()
    if not quiet:
        print('load first EN file ', date_f)
    T_p, P_p = interp3d_thet(data, theta_level)
    delta_pf = ENint.total_seconds()
    numpart = 0

    # loop on the EN intervals
    while date_p >= date_beg:
        T_f = T_p.copy()
        P_f = P_p.copy()
        if not quiet:
            print('load new EN file  ', date_p)
        data = ECMWF('FULL-EI', date_p)
        data._get_var('T')
Exemplo n.º 3
0
    part0['p'] = np.empty(0, dtype=float)
    part0['idx_back'] = np.empty(0, dtype=int)
    # It is assumed that both date_end and date_beg are valid dates for the EN files
    date_f = date_end
    date_p = date_f - ENint
    date_current = date_end

    # first read and first interpolation
    #data = read_ECMWF(ENdir,date_f)
    # data is read from ERA5 data in the global domain at 1° horizontal resolution
    # and longitude origin at 0°
    data = ECMWF('FULL-EA', date_f)
    data._get_var('T')
    data._mkp(
    )  # Calculate pressure from surface pressure and hybrid coefficients
    data._mkthet()  # Calculate the potential temperature
    # ACHTUNG: TO DO : ADD HERE A SHIFT IN LONGITUDE
    # data -> data.shit2west(-179)
    if not quiet:
        print('load first EN file ', date_f)
    T_p, P_p = interp3d_thet(
        data, theta_level)  # First interpolation to the theta level
    delta_pf = ENint.total_seconds()
    numpart = 0

    # loop on the EN time
    while date_p >= date_beg:
        T_f = T_p.copy()
        P_f = P_p.copy()
        if not quiet:
            print('load new EN file  ', date_p)
Exemplo n.º 4
0
part0['ir_start'] = np.empty(0,dtype=int)
part0['x'] = np.empty(0,dtype=float)
part0['y'] = np.empty(0,dtype=float)
part0['t'] = np.empty(0,dtype=float)
part0['p'] = np.empty(0,dtype=float)
part0['idx_back'] = np.empty(0,dtype=int)
numpart = 0

# Loop on the values of theta
for targetTheta in [theta-dTheta, theta, theta+dTheta]:
    # get the first time
    date1 = date + timedelta(hours=int(begSeq/3600))
    predat = ECMWF('STC',date1)
    predat._get_T()
    predat._mkp()
    predat._mkthet()
    (fT1,fP1) = interp3d_thet(predat,targetTheta)
    predat.close()
    
    #for n in range(nInt):
    # finds the boundary
    id1 = np.where(utc == begSeq)[0][0]
    id2 = np.where(utc == endSeq)[0][0]
    # get lat, lon and release time
    yy = data.var['Lat'][id1:id2+1]
    xx = data.var['Long'][id1:id2+1] 
    ir_start = utc[id1:id2+1] - 86400
    ir_start  = ir_start.astype(np.int)
    #weigthing factor
    w2 = (utc[id1:id2+1] % 3600) / 3600
    # Bloc_size