-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the capability to assimilate the MADIS snow depth data from GTS #1836
Changes from 3 commits
3a723e8
46577a1
32e24b4
7f44dd4
0273248
4d3e105
9bce693
0017549
60567df
dc83591
94a0ff8
04f7ec5
73fcc1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -87,12 +87,17 @@ def prepare_GTS(self) -> None: | |||||||
logger.info("Copying GTS obs for bufr2ioda.x") | ||||||||
FileHandler(prep_gts_config.gtsbufr).sync() | ||||||||
|
||||||||
# generate bufr2ioda YAML file | ||||||||
bufr2ioda_yaml = os.path.join(self.runtime_config.DATA, "bufr_adpsfc_snow.yaml") | ||||||||
logger.info(f"Generate BUFR2IODA YAML file: {bufr2ioda_yaml}") | ||||||||
temp_yaml = parse_j2yaml(self.task_config.BUFR2IODAYAML, self.task_config) | ||||||||
save_as_yaml(temp_yaml, bufr2ioda_yaml) | ||||||||
logger.info(f"Wrote bufr2ioda YAML to: {bufr2ioda_yaml}") | ||||||||
# generate bufr2ioda YAML files | ||||||||
adpsfc_yaml = os.path.join(self.runtime_config.DATA, "bufr_adpsfc_snow.yaml") | ||||||||
logger.info(f"Generate BUFR2IODA YAML file: {adpsfc_yaml}") | ||||||||
temp_yaml = parse_j2yaml(self.task_config.BUFRADPSFCYAML, self.task_config) | ||||||||
save_as_yaml(temp_yaml, adpsfc_yaml) | ||||||||
logger.info(f"Wrote bufr2ioda YAML to: {adpsfc_yaml}") | ||||||||
snocvr_yaml = os.path.join(self.runtime_config.DATA, "bufr_snocvr.yaml") | ||||||||
logger.info(f"Generate BUFR2IODA YAML file: {snocvr_yaml}") | ||||||||
temp_yaml = parse_j2yaml(self.task_config.BUFRSNOCVRYAML, self.task_config) | ||||||||
save_as_yaml(temp_yaml, snocvr_yaml) | ||||||||
logger.info(f"Wrote bufr2ioda YAML to: {snocvr_yaml}") | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we may be able to make this a bit less hard-coded and yaml driven from the top. bufr2ioda:
adpsfc: {{ HOMEgfs }}/sorc/gdas.cd/test/testinput/bufr_adpsfc_snow.yaml
snocvr: {{ HOMEgfs }}/sorc/gdas.cd/test/testinput/bufr_snocvr.yaml We could then loop over this list to parse the yamls, and call the The code then does not know what it is processing and bufr files can be added/removed to the yaml. Would this be acceptable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we may be able to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aerorahul Follow your suggestions, I have made the changes for your review. Thanks. |
||||||||
|
||||||||
logger.info("Link BUFR2IODAX into DATA/") | ||||||||
exe_src = self.task_config.BUFR2IODAX | ||||||||
|
@@ -105,14 +110,34 @@ def prepare_GTS(self) -> None: | |||||||
if os.path.isfile(f"{os.path.join(localconf.DATA, output_file)}"): | ||||||||
rm_p(output_file) | ||||||||
|
||||||||
# execute BUFR2IODAX to convert GTS bufr data into IODA format | ||||||||
# execute BUFR2IODAX to convert adpsfc bufr data into IODA format | ||||||||
yaml_file = f"bufr_adpsfc_snow.yaml" | ||||||||
if not os.path.isfile(f"{os.path.join(localconf.DATA, yaml_file)}"): | ||||||||
logger.exception(f"{yaml_file} not found") | ||||||||
raise FileNotFoundError(f"{os.path.join(localconf.DATA, yaml_file)}") | ||||||||
exe = Executable(self.task_config.BUFR2IODAX) | ||||||||
exe.add_default_arg(os.path.join(localconf.DATA, f"{yaml_file}")) | ||||||||
|
||||||||
logger.info(f"Executing {exe}") | ||||||||
try: | ||||||||
exe() | ||||||||
except OSError: | ||||||||
raise OSError(f"Failed to execute {exe}") | ||||||||
except Exception: | ||||||||
raise WorkflowException(f"An error occured during execution of {exe}") | ||||||||
|
||||||||
output_file = f"{localconf.OPREFIX}snocvr_snow.nc4" | ||||||||
if os.path.isfile(f"{os.path.join(localconf.DATA, output_file)}"): | ||||||||
rm_p(output_file) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above lines were removed. |
||||||||
|
||||||||
# execute BUFR2IODAX to convert snocvr bufr data into IODA format | ||||||||
yaml_file = f"bufr_snocvr.yaml" | ||||||||
if not os.path.isfile(f"{os.path.join(localconf.DATA, yaml_file)}"): | ||||||||
logger.exception(f"{yaml_file} not found") | ||||||||
raise FileNotFoundError(f"{os.path.join(localconf.DATA, yaml_file)}") | ||||||||
exe = Executable(self.task_config.BUFR2IODAX) | ||||||||
exe.add_default_arg(os.path.join(localconf.DATA, f"{yaml_file}")) | ||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a suggestion to remove some repetition here. Please see the patch on this file if you could kindly test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tested this, and it worked perfect. The updates were committed to the repo. Thanks @aerorahul for your suggestions. |
||||||||
logger.info(f"Executing {exe}") | ||||||||
try: | ||||||||
exe() | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these yamls be in
parm/land/
and nottest/
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the GTS bufr2ioda yamls in GDASApp are saved at the
test/testinput/
directory.