Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jcb_clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ gdas:
git_url: noaa-emc/jcb-gdas
git_ref: develop

rdas:
git_url: noaa-emc/jcb-rdas
git_ref: develop
#rdas:
# git_url: noaa-emc/jcb-rdas
# git_ref: develop
34 changes: 34 additions & 0 deletions src/jcb/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,42 @@ def render(self, algorithm):
for key in keys_to_remove:
del observer[key]

# Option to completely override all filters for a list of observations
# --------------------------------------------------------------------
if 'replace_obs_filters' in self.template_dict:

# Get dictionary replace_obs_filters
replace_obs_filters_dict = self.template_dict['replace_obs_filters']

# Get list of observations
obs_names = self.template_dict['observations']

# Get list of observations that have their filters replaced
obs_to_replace = replace_obs_filters_dict['observations']

# New filter dictionary
new_filters = replace_obs_filters_dict.get('override_filters', {})

# Loop over the observers and replace filters for matching observations
for observer, obs_name in zip(observers, obs_names):
# Check whether to replace filters for this observation
if obs_name not in obs_to_replace:
continue

# Remove any instance of filters
for filter_key in ['obs filters', 'obs prior filters',
'obs post filters', 'obs pre filters']:
if filter_key in observer:
del observer[filter_key]

# Set new entry obs filters with the replace dictionary
observer['obs filters'] = new_filters

# Convert the rendered string to a dictionary
return jedi_dict

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

def get_obs_engine(self, observation, component, script_input=None):
"""
Return obs engine based on whether the file exists or not.
Expand Down Expand Up @@ -278,6 +311,7 @@ def get_obs_engine(self, observation, component, script_input=None):
f"{obsdatain_filename if obsdatain_filename is not None else 'N/A'}"
)


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


Expand Down
Loading