コード例 #1
0
        for i in range(0, nlev):
            nobg_u[i] = nobg_u[i] - bg_wind[0][i]
            nobg_v[i] = nobg_v[i] - bg_wind[1][i]

    # Add hor. wind in polar coordinates
    if with_bg:
        ds = add_u_polar(ds, nobg_u, nobg_v, center)
    else:
        ds = add_u_polar(ds, ds.u[0], ds.v[0], center)

    ideal_u_phi = ft_var(ds.u_phi[0],
                         center,
                         r_rad,
                         nlev,
                         lev_start,
                         'Wind/u_phi',
                         'u_phi',
                         height,
                         create_plot=False)
    ideal_u_r = ft_var(ds.u_r[0],
                       center,
                       r_rad,
                       nlev,
                       lev_start,
                       'Wind/u_r',
                       'u_r',
                       height,
                       create_plot=False)

    #print('This is clon:')
コード例 #2
0
              drop=True).clon.values[0]
        center[l-lev_start,1] = single_lev.where(single_lev == single_lev.min(), \
              drop=True).clat.values[0]

# 2. Preprocess data -----------------------------------------------------------

# Add variables that shall be used in fourier transform

if ft_variables['density']:
    print('----------------------------------------------------------')
    print('Density')
    ideal_rho_da = ft_var(ds.rho[0],
                          center,
                          r_rad,
                          nlev,
                          lev_start,
                          'Density',
                          'rho',
                          height,
                          create_plot=False)
    ds.rho[0] = ideal_rho_da

if ft_variables['virt pot temp']:
    print('----------------------------------------------------------')
    print('Virtual potential temperature')
    ideal_data_da = ft_var(ds.theta_v[0],
                           center,
                           r_rad,
                           nlev,
                           lev_start,
                           'virt_pot_temp',
コード例 #3
0
# Variables for which FT should be done:
calc_rho = True  # Density
calc_pres = True  # Pressure
calc_theta_v = True  # virt. pot. temp
calc_temp = True  # Temperature
calc_qv = True  # specific humidity
calc_qc = True  # spec. cloud water content
calc_qi = True  # spec. cloud ice content
calc_qr = True  # rain mixing ratio
calc_qs = True  # snow mixing ratio

if calc_rho:
    print('Variable is density.')
    # Get variable without time dimension ([0])
    rho_da = ds.rho[0]
    ft_var(rho_da, center, r_rad, nlev, lev_start, 'Density', 'rho', height)
    print('Finished density.')
    print('--------------------------------------------------')

if calc_pres:
    print('Variable is pressure')
    pres_da = ds.pres[0]
    ft_var(pres_da, center, r_rad, nlev, lev_start, 'Pressure', 'pres', height)
    print('Finished pressure.')
    print('--------------------------------------------------')

if calc_theta_v:
    print('Variable is virtual potential temperature.')
    theta_v_da = ds.theta_v[0]
    ft_var(theta_v_da, center, r_rad, nlev, lev_start, 'virt_pot_temp',
           'theta_v', height)