Skip to content

Commit

Permalink
Make the python bufr2ioda driver more generic (#725)
Browse files Browse the repository at this point in the history
Rather than each new ob type being manually added to the list, we can
use `glob.glob` to get the list of available observation types.
  • Loading branch information
CoryMartin-NOAA authored Nov 14, 2023
1 parent e1a5375 commit dda513f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ush/ioda/bufr2ioda/run_bufr2ioda.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import argparse
import glob
import os
from pathlib import Path
from gen_bufr2ioda_json import gen_bufr_json
Expand Down Expand Up @@ -30,8 +31,9 @@ def bufr2ioda(current_cycle, RUN, DMPDIR, config_template_dir, COM_OBS):
}

# Specify observation types to be processed by a script
BUFR_py = ["satwind_amv_goes", "satwind_scat", "adpupa_prepbufr", "adpsfc_prepbufr", "sfcshp_prepbufr", "acft_profiles_prepbufr",
"gpsro_bufr", "conventional_prepbufr_ps"]
BUFR_py_files = glob.glob(os.path.join(USH_IODA, 'bufr2ioda_*.py'))
BUFR_py_files = [os.path.basename(f) for f in BUFR_py_files]
BUFR_py = [f.replace('bufr2ioda_', '').replace('.py', '') for f in BUFR_py_files]

for obtype in BUFR_py:
logger.info(f"Convert {obtype}...")
Expand Down

0 comments on commit dda513f

Please sign in to comment.