diff --git a/src/jcb/observation_chronicle/conv_chronicle.py b/src/jcb/observation_chronicle/conv_chronicle.py index 95c631c..37bc80e 100644 --- a/src/jcb/observation_chronicle/conv_chronicle.py +++ b/src/jcb/observation_chronicle/conv_chronicle.py @@ -246,8 +246,6 @@ def process_station_chronicles(ob_type, window_begin, window_final, chronicle_in index_to_use = chronicle_func(index_of_begin, index_of_final) final_station_list = copy.deepcopy(evolving_observing_system[index_to_use]['station_reject_list']) - print(final_station_list) - return final_station_list diff --git a/src/jcb/observation_chronicle/observation_chronicle.py b/src/jcb/observation_chronicle/observation_chronicle.py index 17e2366..4ff766e 100644 --- a/src/jcb/observation_chronicle/observation_chronicle.py +++ b/src/jcb/observation_chronicle/observation_chronicle.py @@ -82,7 +82,7 @@ def use_observer(self, observer): # Observation type dependent checks if obs_chronicle['observer_type'] == 'conventional': # need to check the use of individual stations/locations - if not self.get_conventional_stations(observer, 'reject'): + if not self.get_conventional_rejected_stations(observer): return False if obs_chronicle['observer_type'] == 'satellite': @@ -97,7 +97,7 @@ def use_observer(self, observer): # ---------------------------------------------------------------------------------------------- - def __process_conventional__(self, observer): + def __process_conventional_stations__(self, observer): # Only re-process the chronicle if the observer has changed if self.last_observer != observer: @@ -118,10 +118,21 @@ def __process_conventional__(self, observer): f"The window begin is after the decommissioned date for " f"observation type {observer}.") - # Abort if the type is not satellite + # Abort if the type is not conventional jcb.abort_if(obs_chronicle['observer_type'] != 'conventional', f"Only conventional observation types are supported. The observation type " f"{observer} is listed as: {obs_chronicle['observer_type']}.") + + # Process the chronicle for this observation type + self.rejected_station_list = \ + jcb.process_station_chronicles(observer, self.window_begin, + self.window_final, obs_chronicle) + + # Update the last observer + self.last_observer = observer + + # Return the requested data + return self.rejected_station_list # ---------------------------------------------------------------------------------------------- @@ -164,12 +175,13 @@ def __process_satellite__(self, observer): # ---------------------------------------------------------------------------------------------- - def get_conventional_stations(self, observer, variable_name_in): + def get_conventional_rejected_stations(self, observer): - # Get all the variables and stations for the observation type - conv_variables, conv_values = self.__process_conventional__(observer) + # Get all the rejected stations for the observation type + station_list = self.__process_conventional_stations__(observer) - print(conv_variables, conv_values) + # force a return of a list of strings since the station IDs have to be strings + return station_list # ----------------------------------------------------------------------------------------------