Skip to content

Commit

Permalink
var improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewEichmann-NOAA committed Apr 18, 2024
1 parent 3cdb1ae commit 5741117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ush/soca/prep_ocean_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def __init__(self, config: Dict) -> None:
PDY = self.runtime_config['PDY']
cyc = self.runtime_config['cyc']
cdate = PDY + timedelta(hours=cyc)
assim_freq = self.config['assim_freq']
half_assim_freq = assim_freq/2

self.runtime_config['cdate'] = cdate
window_begin_datetime = cdate - timedelta(hours=3)
window_begin_datetime = cdate + timedelta(hours=3)
window_begin_datetime = cdate - timedelta(hours=half_assim_freq)
window_begin_datetime = cdate + timedelta(hours=half_assim_freq)
self.window_begin = window_begin_datetime.strftime('%Y-%m-%dT%H:%M:%SZ')
self.window_end = window_begin_datetime.strftime('%Y-%m-%dT%H:%M:%SZ')

Expand All @@ -67,6 +69,7 @@ def initialize(self):
cdatestr = cdate.strftime('%Y%m%d%H')
RUN = self.runtime_config.RUN
cyc = self.runtime_config['cyc']
assim_freq = self.config['assim_freq']

OBS_YAML = self.config['OBS_YAML']
observer_config = YAMLFile(OBS_YAML)
Expand Down Expand Up @@ -117,7 +120,7 @@ def initialize(self):

window_cdates = []
for i in range(-obs_window_back, obs_window_forward + 1):
interval = timedelta(hours=6 * i)
interval = timedelta(hours=assim_freq * i)
window_cdates.append(cdate + interval)

input_files = prep_ocean_obs_utils.obs_fetch(self.config,
Expand Down
2 changes: 1 addition & 1 deletion ush/soca/prep_ocean_obs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def obs_fetch(config, runtime_config, obsprep_space, cycles):
PDY = cycle.strftime('%Y%m%d')
cyc = cycle.strftime('%H')

full_input_dir = os.path.join(DMPDIR, RUN + '.' + PDY, cyc, subdir)
full_input_dir = os.path.join(DMPDIR, f"{RUN}.{PDY}", cyc, subdir)

# TODO: check the existence of this
logger.info(f"full_input_dir: {full_input_dir}")
Expand Down

0 comments on commit 5741117

Please sign in to comment.