Skip to content

Commit

Permalink
add option to turn on/off prepaeroobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ypwang19 committed May 28, 2024
1 parent bdc5338 commit c014ae1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions ush/python/pygfs/task/aero_prepobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class AerosolObsPrep(Task):
def __init__(self, config: Dict[str, Any]) -> None:
super().__init__(config)

_window_begin = add_to_datetime(self.runtime_config.current_cycle, -to_timedelta(f"{self.config['assim_freq']}H") / 2)
_window_end = add_to_datetime(self.runtime_config.current_cycle, +to_timedelta(f"{self.config['assim_freq']}H") / 2)
_window_begin = add_to_datetime(self.runtime_config.current_cycle, -to_timedelta(f"{self.config['assim_freq']}H") / 2)
_window_end = add_to_datetime(self.runtime_config.current_cycle, +to_timedelta(f"{self.config['assim_freq']}H") / 2)

local_dict = AttrDict(
{
Expand All @@ -41,13 +41,11 @@ def __init__(self, config: Dict[str, Any]) -> None:
# task_config is everything that this task should need
self.task_config = AttrDict(**self.config, **self.runtime_config, **local_dict)



@logit(logger)
def initialize(self) -> None:
"""
List needed raw obs files.
Link over the raw obs files to COM_OBS.
Copy the raw obs files to $DATA/obs.
Link over the needed executable.
Generate corrosponding YMAL file.
Run IODA converter.
Expand Down Expand Up @@ -129,6 +127,7 @@ def list_raw_files(self,sensor) -> List[str]:
@logit(logger)
def copy_obs(self,inputfiles) -> Dict[str, Any]:
"""
Copy the raw obs files to $DATA/obs.
"""

copylist = []
Expand Down Expand Up @@ -166,7 +165,7 @@ def get_obsproc_config(self,sensor) -> Dict[str, Any]:
@logit(logger)
def link_obsconvexe(self) -> None:
"""
This method links a JEDI executable to the run directory
This method links the gdas executable to the run directory
Parameters
----------
Task: GDAS task
Expand All @@ -186,6 +185,9 @@ def link_obsconvexe(self) -> None:

@logit(logger)
def runConverter(self) -> None:
"""
Run the IODA converter gdas_obsprovider2ioda.x
"""
chdir(self.task_config.DATA)
for prepaero_yaml in self.task_config.prepaero_yaml:
exec_cmd = Executable(self.task_config.APRUN_PREPAEROOBS)
Expand All @@ -206,6 +208,11 @@ def runConverter(self) -> None:

@logit(logger)
def finalize(self) -> None:
"""
Copy the output viirs files to COM_OBS.
Tar and archive the output files.
Tar and archive the raw obs files.
"""
# get list of viirs files
obsfiles = glob.glob(os.path.join(self.task_config['DATA'], '*viirs*nc4'))
copylist = []
Expand Down

0 comments on commit c014ae1

Please sign in to comment.