-
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.
initial changes for bufr conversion refactor
- Loading branch information
1 parent
404dfab
commit 33862a8
Showing
3 changed files
with
46 additions
and
7 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,10 @@ | ||
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 |
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