diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index 25cd5ba89ddd159a3569ed25cd84a7a0cf13d187..edd3174fcc44e7aaf69218525f221fc3aff8d811 100644 --- a/modules/aeolus/aeolus_amv.py +++ b/modules/aeolus/aeolus_amv.py @@ -2034,6 +2034,7 @@ def create_bestfit_file(filename, match_dct, raob_dct, raob_ts, gfs_at_raob_dct, alons = [] alats = [] ids = [] + num_amvs_per_prof = [] #amv_file_s = np.array(amv_file_s, dtype='object') @@ -2054,11 +2055,13 @@ def create_bestfit_file(filename, match_dct, raob_dct, raob_ts, gfs_at_raob_dct, amvs = bf_tup[0] num_amvs = amvs.shape[0] + num_amvs_per_prof.append(num_amvs) if num_amvs > max_num_amvs: max_num_amvs = num_amvs alons = np.array(alons) alats = np.array(alats) + num_amvs_per_prof = np.array(num_amvs_per_prof) # Sample file to retrieve and copy variable attributes #rg_exmpl = Dataset('/ships19/cloud/scratch/4TH_AMV_INTERCOMPARISON/FMWK2_AMV/GOES16_ABI_2KM_FD_2019293_0020_34_WINDS_AMV_EN-14CT.nc', 'r') @@ -2090,6 +2093,8 @@ def create_bestfit_file(filename, match_dct, raob_dct, raob_ts, gfs_at_raob_dct, prf_id = rootgrp.createVariable('station_id', 'i4', ['time', 'num_raob_profs']) prf_id.long_name = 'WMO station identifier' + num_amvs = rootgrp.createVariable('num_amvs_per_profile', 'i4', ['time', 'num_raob_profs']) + prf_dir = rootgrp.createVariable('raob_dir', 'f4', ['time', 'num_raob_profs', 'max_num_raob_levels']) prf_dir.units = 'degree' prf_spd = rootgrp.createVariable('raob_spd', 'f4', ['time', 'num_raob_profs', 'max_num_raob_levels']) @@ -2193,6 +2198,7 @@ def create_bestfit_file(filename, match_dct, raob_dct, raob_ts, gfs_at_raob_dct, prf_lon[0, :] = alons prf_lat[0, :] = alats prf_id[0, :] = ids + num_amvs[0, :] = num_amvs_per_prof #amv_file_names[:] = amv_file_s