-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accessing GSI observing system records for active and available chann…
…els (#273) * add new task * adding task to generate sat channel record yamls * stash changes * stash * ramblings * cloning of geos * changes for obs system recs * adding tasks and workflow changes * add get_active_channels * updating tasks * parse active and available channels * workflow working with amsua_n19 * eva observations fix * stash * some clean up * coding norms * fix yaml * norms * pandas * sat_db_utils fix * fix eva_obs * requested changes * coding norms * fix test * fix observing sys test * task question test fix * code test fix * adding new tasks to hofx and geosadas * Undo Dan's bad suggestions * task q bug * add more protection from when component does not need obs sys records * code norm * fix bugs * minor bug in time --------- Co-authored-by: danholdaway <[email protected]>
- Loading branch information
1 parent
f0bee5d
commit 90129ec
Showing
30 changed files
with
948 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# (C) Copyright 2021- United States Government as represented by the Administrator of the | ||
# National Aeronautics and Space Administration. All Rights Reserved. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
import os | ||
from swell.tasks.base.task_base import taskBase | ||
from swell.utilities.build import link_path | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
class CloneGeosAna(taskBase): | ||
|
||
def execute(self): | ||
|
||
""" | ||
Generate the satellite channel record from GEOSadas files | ||
""" | ||
|
||
# This task should only execute for geos_atmosphere | ||
# ------------------------------------------------- | ||
if self.get_model() != 'geos_atmosphere': | ||
self.logger.info('Skipping GenerateObservingSystemRecords for: ' + self.get_model()) | ||
return | ||
|
||
# Parse config | ||
# ------------ | ||
path_to_geosana_gridcomp = self.config.observing_system_records_gsi_path() | ||
|
||
# If observing_system_records_gsi_path is None, clone GEOSana_GridComp repo to experiment | ||
# directory | ||
if path_to_geosana_gridcomp == 'None': | ||
# Clone GEOSana_GridComp develop repo to experiment directory | ||
os.system('git clone https://github.com/GEOS-ESM/GEOSana_GridComp.git ' | ||
+ os.path.join(self.experiment_path(), 'GEOSana_GridComp')) | ||
else: | ||
# Link the source code directory | ||
link_path(self.config.observing_system_records_gsi_path(), | ||
os.path.join(self.experiment_path(), 'GEOSana_GridComp')) | ||
|
||
|
||
# ---------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# (C) Copyright 2021- United States Government as represented by the Administrator of the | ||
# National Aeronautics and Space Administration. All Rights Reserved. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
import os | ||
|
||
from swell.tasks.base.task_base import taskBase | ||
from swell.utilities.observing_system_records import ObservingSystemRecords | ||
|
||
# -------------------------------------------------------------------------------------------------- | ||
|
||
|
||
class GenerateObservingSystemRecords(taskBase): | ||
|
||
def execute(self): | ||
|
||
""" | ||
Generate the observing system channel records from GEOSadas files | ||
""" | ||
|
||
# This task should only execute for geos_atmosphere | ||
# ------------------------------------------------- | ||
if self.get_model() != 'geos_atmosphere': | ||
self.logger.info('Skipping GenerateObservingSystemRecords for: ' + self.get_model()) | ||
return | ||
|
||
# Parse GSI records and save channel selection yamls | ||
# -------------------------------------------------- | ||
observations = self.config.observations() | ||
observing_system_records_path = self.config.observing_system_records_path(None) | ||
if observing_system_records_path == 'None': | ||
cycle_dir = self.cycle_dir() | ||
observing_system_records_path = os.path.join(cycle_dir, 'observing_system_records') | ||
|
||
path_to_geosana_gridcomp = self.config.observing_system_records_gsi_path() | ||
if path_to_geosana_gridcomp == 'None': | ||
path_to_geosana_gridcomp = os.path.join(self.experiment_path(), 'GEOSana_GridComp') | ||
path_to_gsi_records = os.path.join(path_to_geosana_gridcomp, 'GEOSaana_GridComp', | ||
'GSI_GridComp', 'mksi', 'sidb') | ||
sat_records = ObservingSystemRecords() | ||
sat_records.parse_records(path_to_gsi_records) | ||
sat_records.save_yamls(observing_system_records_path, observations) | ||
|
||
# ---------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.