From 1635e2fecfa5acc398b015c68920a877f61d0659 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Tue, 23 Mar 2021 16:09:48 -0500 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 3a3fefd6..71038d46 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -28,14 +28,14 @@ l1b_ds_list = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13 'temp_6_2um_nom', 'temp_6_7um_nom', 'temp_7_3um_nom', 'temp_8_5um_nom', 'temp_9_7um_nom', 'refl_0_47um_nom', 'refl_0_55um_nom', 'refl_0_65um_nom', 'refl_0_86um_nom', 'refl_1_38um_nom', 'refl_1_60um_nom'] -l1b_ds_type = ['f4' for ds in l1b_ds_list] +l1b_ds_types = ['f4' for ds in l1b_ds_list] ds_list = ['cld_height_acha', 'cld_geo_thick', 'cld_press_acha', 'sensor_zenith_angle', 'supercooled_prob_acha', 'supercooled_cloud_fraction', 'cld_temp_acha', 'cld_opd_acha', 'solar_zenith_angle', 'cld_reff_acha', 'cld_reff_dcomp', 'cld_reff_dcomp_1', 'cld_reff_dcomp_2', 'cld_reff_dcomp_3', 'cld_opd_dcomp', 'cld_opd_dcomp_1', 'cld_opd_dcomp_2', 'cld_opd_dcomp_3', 'cld_cwp_dcomp', 'iwc_dcomp', 'cloud_type', 'cloud_phase', 'cloud_mask'] -ds_type = ['f4' for i in range(20)] + ['i4' for i in range(3)] +ds_types = ['f4' for i in range(20)] + ['i4' for i in range(3)] a_clvr_file = '/home/rink/data/clavrx/clavrx_OR_ABI-L1b-RadC-M3C01_G16_s20190020002186.level2.nc' @@ -103,13 +103,13 @@ def get_grid_values(h5f, grid_name, j_c, i_c, half_width, scale_factor_name='sca return grd_vals -def create_file(filename, data_dct, ds_list, lon_c, lat_c, time_s, fl_alt_s, icing_intensity): +def create_file(filename, data_dct, ds_list, ds_types, lon_c, lat_c, time_s, fl_alt_s, icing_intensity): h5f_expl = h5py.File(a_clvr_file, 'r') h5f = h5py.File(filename, 'w') - for ds_name in ds_list: + for idx, ds_name in enumerate(ds_list): data = data_dct[ds_name] - h5f.create_dataset(ds_name, data=data) + h5f.create_dataset(ds_name, data=data, dtype=ds_types[idx]) lon_ds = h5f.create_dataset('longitude', data=lon_c) lon_ds.dims[0].label = 'time' @@ -262,7 +262,7 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end if outfile is not None: outfile = add_time_range_to_filename(outfile, t_start, t_end) - create_file(outfile, data_dct, ds_list, lon_c, lat_c, time_s, fl_alt_s, ice_int_s) + create_file(outfile, data_dct, ds_list, ds_types, dlon_c, lat_c, time_s, fl_alt_s, ice_int_s) data_dct = {} for ds_name in l1b_ds_list: @@ -270,7 +270,7 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end if outfile_l1b is not None: outfile_l1b = add_time_range_to_filename(outfile_l1b, t_start, t_end) - create_file(outfile_l1b, data_dct, l1b_ds_list, lon_c, lat_c, time_s, fl_alt_s, ice_int_s) + create_file(outfile_l1b, data_dct, l1b_ds_list, l1b_ds_types, lon_c, lat_c, time_s, fl_alt_s, ice_int_s) def analyze2(ice_dct): -- GitLab