From 9906a65c8b3301cf47293d691a76eae2dd05af70 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Thu, 17 Feb 2022 13:11:46 -0600 Subject: [PATCH] snapshot... --- modules/amv/caliop_clavrx_amv.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/amv/caliop_clavrx_amv.py b/modules/amv/caliop_clavrx_amv.py index c9806321..1685c56a 100644 --- a/modules/amv/caliop_clavrx_amv.py +++ b/modules/amv/caliop_clavrx_amv.py @@ -1,4 +1,6 @@ import os + +import h5py import numpy as np import xarray as xr from netCDF4 import Dataset @@ -297,3 +299,31 @@ def run_caliop_clavrx_amv_match(output_path, path_to_caliop_clavrx, path_to_amvs create_file(match_dict, output_path, file, caliop_clavrx_params, amv_params, amv_filenames) print('Done processing: ', file) + +def analyze(filename): + h5f = h5py.File(filename, 'r') + cc_ctt = h5f['closest_calipso_top_temperature'][:] + cc_ctt = np.where(cc_ctt == -9999.0, np.nan, cc_ctt) + cc_ctt += 273.0 + + cc_ctp = h5f['closest_calipso_top_pressure'][:] + cc_ctp = np.where(cc_ctp == -9999.0, np.nan, cc_ctp) + + lats = h5f['caliop_latitude'][:] + lons = h5f['caliop_longitude'][:] + + acha_ctp = h5f['cld_press_acha'][:] + acha_ctp = np.where(acha_ctp == -999.0, np.nan, acha_ctp) + + amv_press = h5f['pressure'][:, 0:3] + amv_press = np.where(amv_press == -999.0, np.nan, amv_press) + + amv_press_avg = np.nanmean(amv_press, axis=1) + + return cc_ctp, acha_ctp, amv_press_avg, lats + + + + + + -- GitLab