From 13b0f9fed84902f34b86f8fd24eb56c3a01a5fe3 Mon Sep 17 00:00:00 2001 From: Angeline Burrell Date: Wed, 2 Oct 2024 13:24:42 -0400 Subject: [PATCH] BUG: fixed time evaluation Moved up the time evaluation for the forecast F10.7 data in the combine function. Also removed a duplicate definition of a date range variable. --- pysatSpaceWeather/instruments/methods/f107.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pysatSpaceWeather/instruments/methods/f107.py b/pysatSpaceWeather/instruments/methods/f107.py index 4e6b368..648da5c 100644 --- a/pysatSpaceWeather/instruments/methods/f107.py +++ b/pysatSpaceWeather/instruments/methods/f107.py @@ -245,11 +245,10 @@ def combine_f107(standard_inst, forecast_inst, start=None, stop=None): good_vals = np.array([ not is_fill_val(val, fill_val) for val in forecast_inst['f107'][good_times]]) + new_times = list(forecast_inst.index[good_times][good_vals]) # Save desired data and cycle time - if len(good_vals) > 0: - new_times = list( - forecast_inst.index[good_times][good_vals]) + if len(new_times) > 0: f107_times.extend(new_times) new_vals = list( forecast_inst['f107'][good_times][good_vals]) @@ -274,8 +273,6 @@ def combine_f107(standard_inst, forecast_inst, start=None, stop=None): if len(f107_times) == 0: f107_times = date_range - date_range = pds.date_range(start=start, end=end_date, freq=freq) - if date_range[0] < f107_times[0]: # Extend the time and value arrays from their beginning with fill # values