diff --git a/modules/contrail/util.py b/modules/contrail/util.py index 4ab55fb9aec7eb4869a38bb9a2977c253ce97c76..a5c47e910ad754c97e1bc6c21afbd828b9a88818 100644 --- a/modules/contrail/util.py +++ b/modules/contrail/util.py @@ -114,7 +114,7 @@ def extract(mask_image, image_ts, clavrx_path): # helper function to create a DataArray and units via metpy's pint support vert_shear_3d = first_derivative(horz_wind_spd_3d, axis=0, x=temp_3d.coords['Pressure']) vert_shear_3d = volume_np_to_xr(vert_shear_3d, ['Pressure', 'Latitude', 'Longitude'], lon_range=[lon_range[0], lon_range[1]], lat_range=[lat_range[0], lat_range[1]]) - vert_shear_3d = vert_shear_3d * units.meter / (units.second * units.hPa) + vert_shear_3d = vert_shear_3d / units.hPa voxel_dict = {key: [] for key in bins_dict.keys()} for key in bins_dict.keys(): @@ -134,7 +134,8 @@ def extract(mask_image, image_ts, clavrx_path): # Create pandas DataFrame for each list of tuples in voxel_dict voxel_dict_df = {} for k, v in voxel_dict.items(): - voxel_dict_df[k] = pd.DataFrame(v, columns=["press", "lat", "lon", "horz_shear_value", "static_value", "horz_wind_spd_value", "vert_shear_value"]) + df = pd.DataFrame(v, columns=["press", "lat", "lon", "horz_shear_value", "static_value", "horz_wind_spd_value", "vert_shear_value"]) + voxel_dict_df[k] = df xr_dataset.close()