Skip to content

Commit

Permalink
update station reject chronicle
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Martin authored and Cory Martin committed Feb 11, 2025
1 parent 694fd8c commit 36f7509
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/jcb/observation_chronicle/conv_chronicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
26 changes: 19 additions & 7 deletions src/jcb/observation_chronicle/observation_chronicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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:
Expand All @@ -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

# ----------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -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

# ----------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 36f7509

Please sign in to comment.