|
| 1 | +import radclss |
| 2 | +import glob |
| 3 | +import xradar as xd |
| 4 | +import xarray as xr |
| 5 | +import matplotlib.pyplot as plt |
| 6 | + |
| 7 | +from dask.distributed import Client, LocalCluster |
| 8 | + |
| 9 | +def main(): |
| 10 | + date = '20250619' |
| 11 | + radar_files = glob.glob(f'/Volumes/Untitled/bnf/bnfcsapr2cmacS3.c1/*{date}*.nc') |
| 12 | + volumes = {'date': date, |
| 13 | + 'radar': radar_files[0:2], # Limit to first 2 files for testing |
| 14 | + 'sonde': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfsondewnpnM1.b1/*{date}*.cdf'), |
| 15 | + 'vd_M1': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfvdisquantsM1.c1/*{date}*.nc'), |
| 16 | + 'met_M1': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfmetM1.b1/*{date}*'), |
| 17 | + 'met_S20': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfmetS20.b1/*{date}*'), |
| 18 | + 'met_S30': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfmetS30.b1/*{date}*'), |
| 19 | + 'met_S40': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfmetS40.b1/*{date}*'), |
| 20 | + 'wxt_S13': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfmetwxtS13.b1/*{date}*.nc'), |
| 21 | + 'pluvio_M1': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfwbpluvio2M1.a1/*{date}*.nc'), |
| 22 | + 'ld_M1': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfldquantsM1.c1/*{date}*.nc'), |
| 23 | + 'ld_S30': glob.glob(f'/Volumes/Untitled/bnf/in_situ/bnfldquantsS30.c1/*{date}*.nc')} |
| 24 | + |
| 25 | + input_site_dict = {'M1': (34.34525, -87.33842, 293), |
| 26 | + 'S4': (34.46451, -87.23598, 197), |
| 27 | + 'S20': (34.65401, -87.29264, 178), |
| 28 | + 'S30': (34.38501, -86.92757, 183), |
| 29 | + 'S40': (34.17932, -87.45349, 236), |
| 30 | + 'S13': (34.343889, -87.350556, 286)} |
| 31 | + with Client(LocalCluster(n_workers=2, threads_per_worker=1)) as client: |
| 32 | + my_columns = radclss.core.radclss(volumes, input_site_dict, serial=False, verbose=True) |
| 33 | + radclss.io.write_radclss_output(my_columns, 'radclss_example.nc', 'csapr2radclss.c2') |
| 34 | + |
| 35 | + for vars in my_columns.data_vars: |
| 36 | + print(vars, my_columns[vars].dtype) |
| 37 | + fig, ax = radclss.vis.create_radclss_columns('radclss_example.nc') |
| 38 | + print(fig) |
| 39 | + plt.show() |
| 40 | + |
| 41 | +if __name__ == "__main__": |
| 42 | + main() |
0 commit comments