-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes prepoceanobs to using newly refactored BUFR converters (#1352)
Just like the title. This mainly changes the converters used to the new ones that use yaml files, the templates for which are included, along with a little script that does most of the work of converting the earlier JSON templates to yaml. Also removes from `ocean.py` some methods for plotting, but can't go into global-workflow because of lack of the necessary python modules in that environment.
- Loading branch information
1 parent
dfc871f
commit 6bc2760
Showing
11 changed files
with
122 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ ARGO profiles | ||
data_format: subpfl | ||
data_provider: U.S. NOAA | ||
data_type: argo | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: SUBPFL | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ Bathythermal profiles | ||
data_format: bathy | ||
data_provider: U.S. NOAA | ||
data_type: bathy | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: BATHY | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ GLIDER profiles | ||
data_format: subpfl | ||
data_provider: U.S. NOAA | ||
data_type: glider | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: SUBPFL | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ TESAC profiles | ||
data_format: tesac | ||
data_provider: U.S. NOAA | ||
data_type: tesac | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: TESAC | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ XBT/XCTD profiles | ||
data_format: xbtctd | ||
data_provider: U.S. NOAA | ||
data_type: xbtctd | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: XBTCTD | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,11 @@ | ||
cycle_datetime: '{{ current_cycle | to_YMDH }}' | ||
cycle_type: '{{ RUN }}' | ||
data_description: 6-hrly in situ TRACKOB surface | ||
data_format: trkob | ||
data_provider: U.S. NOAA | ||
data_type: trackob | ||
dump_directory: '{{ DMPDIR }}' | ||
ioda_directory: '{{ COM_OBS }}' | ||
source: NCEP data tank | ||
subsets: TRACKOB | ||
ocean_basin: '{{ OCEAN_BASIN_FILE }}' |
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,24 @@ | ||
import json | ||
import yaml | ||
import argparse | ||
|
||
def convert_json_to_yaml(input_file, output_file): | ||
# Load the JSON data from the input file | ||
with open(input_file, 'r') as json_file: | ||
json_data = json.load(json_file) | ||
|
||
# Convert and save as YAML in the output file | ||
with open(output_file, 'w') as yaml_file: | ||
yaml.dump(json_data, yaml_file, default_flow_style=False) | ||
|
||
if __name__ == '__main__': | ||
# Set up argument parser | ||
parser = argparse.ArgumentParser(description='Convert JSON to YAML.') | ||
parser.add_argument('input_file', help='Path to the input JSON file') | ||
parser.add_argument('output_file', help='Path to the output YAML file') | ||
|
||
args = parser.parse_args() | ||
|
||
# Perform the conversion | ||
convert_json_to_yaml(args.input_file, args.output_file) | ||
|
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