def __init__(self, options_file='', diagnostic_mode=False): # delete the module's globals print('Reading options defined in options file') cfg.init(options_file) # Initialize options with 'options_radop.txt' constants.update() # Update constants now that we now user config self.config = cfg self.lut_sz = None self.current_microphys_scheme = 1 self.dic_vars = {} self.N = 0 # atmospheric refractivity self.diagnostic_mode = diagnostic_mode # Diagnostic mode outputs all model variables (Q,T, etc) as well as the standard (radar) variables
mask = np.where(np.sum((Db - Da) == 0.0, axis=1) < len(hydrom_types))[0] return Da[mask, :], Db[mask, :], idx[mask] if __name__ == '__main__': import pickle import gzip from cosmo_pol.lookup.lut import Lookup_table beams = pickle.load( open('/media/wolfensb/Storage/cosmo_pol/ex_beams_rhi.txt', 'rb')) # lut = pickle.load(gzip.open('/media/wolfensb/Storage/cosmo_pol/lookup/final_lut/all_luts_sz_f_2_7_1mom.pz','rb')) from cosmo_pol.utilities import cfg cfg.init('./option_files/MXPOL_RHI.yml' ) # Initialize options with 'options_radop.txt' # from cosmo_pol.utilities import tictoc # tictoc.tic() cfg.CONFIG['doppler']['scheme'] = 2 tictoc.tic() c = get_doppler_velocity(beams, lut) tictoc.toc() # from cosmo_pol.lookup.read_lut import get_lookup_tables # import pickle # # l=pickle.load(open('../ex_beams_rhi.txt','rb')) # lut_pol,lut_rcs=get_lookup_tables('1mom',5.6,True) # ##
########################################################################### for n, var in enumerate(list_vars): model_data = var.data rad_interp_values=interpolation_c.get_all_radar_pts(len(distances_profile),coords_rad_loc,heights_profile,model_data,model_heights\ , llc_COSMO,res_COSMO) all_beams.append(rad_interp_values[1][:]) return lats_rad, lons_rad, all_beams if __name__ == '__main__': # import matplotlib.pyplot as plt import cosmo_pol.pycosmo as pc import cosmo_pol.utilities.cfg as cfg cfg.init('/storage/cosmo_pol/option_files/CH_PPI_dole.yml' ) # Initialize options with 'options_radop.txt' cfg.CONFIG['integration']['scheme'] = 6 cfg.CONFIG['integration']['weight_threshold'] = 1. # from rad_wind import get_doppler_velocity file_h = pc.open_file( '/ltedata/COSMO/Multifractal_analysis/case2014040802_ONEMOM/lfsf00124000' ) dic_vars = pc.get_variables( file_h, ['U', 'V', 'W', 'T'], get_proj_info=True, shared_heights=True, assign_heights=True, c_file= '/ltedata/COSMO/Multifractal_analysis/case2014040802_ONEMOM/lfsf00000000c' )
# Backscattering differential phase delta_hv = np.arctan2(sz[:, 5] - sz[:, 6], -sz[:, 4] - sz[:, 7]) return z_h, z_v, zdr, rhohv, kdp, ah, av, delta_hv if __name__ == '__main__': import pickle import gzip from cosmo_pol.lookup.lut import Lookup_table beams = pickle.load( open('/media/wolfensb/Storage/cosmo_pol/ex_beams_rhi.txt', 'rb')) beams = [beams[7]] beams[0].weight = 1.0 beams[0].values['QS_v'] *= 0. beams[0].values['QG_v'] *= 0. beams[0].values['QR_v'] = (np.isfinite( beams[0].values['QR_v'])).astype(int) * 0.0001 # lut = pickle.load(gzip.open('/media/wolfensb/Storage/cosmo_pol/lookup/final_lut/all_luts_SZ_f_2_7_1mom.pz','rb')) from cosmo_pol.utilities import cfg cfg.init('/media/wolfensb/Storage/cosmo_pol/option_files/MXPOL_PPI.yml' ) # Initialize options with 'options_radop.txt' cfg.CONFIG['attenuation']['correction'] = 1 from cosmo_pol.utilities import tictoc tictoc.tic() c = get_radar_observables(beams, lut) # tictoc.toc() # print(10 * np.log10(c.values['ZH'][0]))
def set_config(self, options_file): cfg.init(options_file) # Initialize options with 'options_radop.txt'