diff --git a/modules/aeolus/aeolus_amv.py b/modules/aeolus/aeolus_amv.py index e2a4db41af386b570a3d1c810dd63def441bf03c..b7d34707589d485f6e7cb44709c24a5b40ea057d 100644 --- a/modules/aeolus/aeolus_amv.py +++ b/modules/aeolus/aeolus_amv.py @@ -461,10 +461,14 @@ def get_subset(match_file, dt_str_0, dt_str_1): p_hht_v = rootgrp['prof_hht'] dto = datetime.datetime.strptime(dt_str_0, '%Y-%m-%d_%H:%M').replace(tzinfo=timezone.utc) + dto.replace(tzinfo=timezone.utc) t_0 = dto.timestamp() dto = datetime.datetime.strptime(dt_str_1, '%Y-%m-%d_%H:%M').replace(tzinfo=timezone.utc) + dto.replace(tzinfo=timezone.utc) t_1 = dto.timestamp() + print(t_0, t_1) + if t_1 < t_0: t = t_0 t_1 = t_0 @@ -479,16 +483,16 @@ def get_subset(match_file, dt_str_0, dt_str_1): prf_idx_start = np.sum(n_levs_per_prof[0:time_idxs[0]]) amv_idx_start = np.sum(n_amvs_per_prof[0:time_idxs[0]]) - mx_namvs = np.max(n_amvs_per_prof[amv_idx_start:amv_idx_start+n_times]) - mx_nlevs = np.max(n_levs_per_prof[prf_idx_start:prf_idx_start+n_times]) + mx_namvs = np.max(n_amvs_per_prof[time_idxs[0]:time_idxs[0]+n_times]) + mx_nlevs = np.max(n_levs_per_prof[time_idxs[0]:time_idxs[0]+n_times]) amvs = np.zeros((n_times, mx_namvs, 4)) profs = np.zeros((n_times, mx_nlevs, 4)) amvs.fill(np.nan) profs.fill(np.nan) - accum_prf = 0 - accum_amv = 0 + accum_prf = prf_idx_start + accum_amv = amv_idx_start for idx, t_i in enumerate(time_idxs): n_amvs = n_amvs_per_prof[t_i] n_levs = n_levs_per_prof[t_i]