Skip to content

Commit

Permalink
a few small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xincjin-NOAA committed Dec 9, 2023
1 parent 4c2e8b8 commit f63bfd4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion parm/atm/obs/lists/gdas_prototype_3d.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
observers:
##- !INC ${OBS_YAML_DIR}/amsua_n19.yaml
- !INC ${OBS_YAML_DIR}/amsua_n19.yaml
##- !INC ${OBS_YAML_DIR}/amsua_n18.yaml
##- !INC ${OBS_YAML_DIR}/amsua_n15.yaml
##- !INC ${OBS_YAML_DIR}/amsua_metop-a.yaml
Expand Down
2 changes: 1 addition & 1 deletion parm/ioda/bufr2ioda/bufr2ioda_ncep_esamua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ observations:
source: variables/satelliteAntennaCorrectionsVersionNumber
longName: "Satellite Antenna Corrections Version Number"

- name: "MetaData/fieldOfViewNumber"
- name: "MetaData/sensorScanPosition"
source: variables/fieldOfViewNumber
longName: "Field Of View Number"

Expand Down
6 changes: 3 additions & 3 deletions ush/ioda/bufr2ioda/bufr2ioda_combine_ncep_amsua.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

BACKEND = CPP

AMSUA_TYPE_CHANGE_DATETIME = "2022120000"
AMSUA_TYPE_CHANGE_DATETIME = "2000120000"

YAML_NORMAL = True # current as normal

Expand Down Expand Up @@ -58,7 +58,7 @@ def re_map_variable(self, container):
if self.yaml_order:
ifov = self.get_container_variable(container, 'MetaData', 'sensorScanPosition', sat_id)
else:
ifov = self.get_container_variable(container, 'MetaData', 'fieldOfViewNumber', sat_id)
ifov = self.get_container_variable(container, 'MetaData', 'sensorScanPosition', sat_id)
tb = self.apply_corr(sat_id, ta, ifov)
self.replace_container_variable(container, 'ObsValue', 'brightnessTemperature', tb, sat_id)

Expand All @@ -83,7 +83,7 @@ def apply_corr(self, sat_id, ta, ifov):

@timing_decorator
def merge(amsua_files, splits):
ioda_files = [(f'esamua.{x}.tm00.ncc', f'amsua.{x}_ta.tm00.ncc', f'amsua_{x}.tm00.nc') for x in splits]
ioda_files = [(f'amsua.{x}_ta.tm00.ncc', f'esamua.{x}.tm00.ncc', f'amsua_{x}.tm00.nc') for x in splits]
logger.info(f'Ioda files: {ioda_files}')
file1 = [f for f in amsua_files[0].values()]
file2 = [f for f in amsua_files[1].values()]
Expand Down
2 changes: 1 addition & 1 deletion ush/ioda/bufr2ioda/combine_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_container(self):
file_name = self.split_files[sat_id]
container[sat_id]['dset'] = xr.open_dataset(file_name)
for group in GROUPS:
container[sat_id][group] = xr.open_dataset(file_name, group=group)
container[sat_id][group] = xr.open_dataset(file_name, group=group, decode_times=False)
except FileNotFoundError as e:
logger.info(f'File not existed exception for sat id: {sat_id} with error msg: {e}')
container.pop(sat_id)
Expand Down
10 changes: 7 additions & 3 deletions ush/ioda/bufr2ioda/run_bufr2ioda.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def mp_bufr_converter(exename, configfile):
cmd.add_default_arg('-c')
cmd.add_default_arg(configfile)
logger.info(f"Executing {cmd}")
cmd()
try:
cmd()
except Exception as e:
logger.info(f' Exception: {e}')


@logit(logger)
Expand Down Expand Up @@ -84,8 +87,8 @@ def bufr2ioda(current_cycle, RUN, DMPDIR, config_template_dir, COM_OBS):
bufr2iodapy = USH_IODA + '/bufr2ioda_' + obtype + ".py"

# append the values to the lists
config_files.append(json_output_file)
exename.append(bufr2iodapy)
# config_files.append(json_output_file)
# exename.append(bufr2iodapy)

# Check if the converter was successful
# if os.path.exists(json_output_file):
Expand All @@ -96,6 +99,7 @@ def bufr2ioda(current_cycle, RUN, DMPDIR, config_template_dir, COM_OBS):
BUFR_yaml_files = [os.path.basename(f) for f in BUFR_yaml_files]
BUFR_yaml = [f.replace('bufr2ioda_', '').replace('.yaml', '') for f in BUFR_yaml_files]
logger.info(f'All obs type processed by yaml: {BUFR_yaml}')
BUFR_yaml = ['ncep_1bamua_ta', 'ncep_esamua']

for obtype in BUFR_yaml:
logger.info(f"Convert {obtype}...")
Expand Down
1 change: 1 addition & 0 deletions ush/ioda/bufr2ioda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def nc_merge(file_name1, file_name2, target_name):
vars1 = grp1[k].variables
vars2 = grp2[k].variables
for key in vars1:
logger.info(key)
var = vars1[key]
if vars2.get(key):
var2 = vars2[key]
Expand Down

0 comments on commit f63bfd4

Please sign in to comment.