diff --git a/ush/ioda/bufr2ioda/bufr2ioda_atms.py b/ush/ioda/bufr2ioda/bufr2ioda_atms.py new file mode 100644 index 000000000..e059e528a --- /dev/null +++ b/ush/ioda/bufr2ioda/bufr2ioda_atms.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 + +import argparse +import json +import os +from combine_base import Bufr2IodaBase +from wxflow import Logger + +logger = Logger(os.path.basename(__file__), level='INFO') + +yaml_file = "bufr2ioda_atms.yaml" +config_json = { + "data_type": "ssmis", + "subsets": ["NC005044", "NC005045", "NC005046"], + "data_description": "NC005044 JMA SATWIND, AHI HIM8 IR(LW)/VIS/WV-CT/WV-CS; NC005045 JMA SATWIND, HIMAWARI-8 " + "IR(LW)/VIS/WV-CT/WV-CS; NC005046 JMA SATWIND, HIMAWARI-8 IR(LW)/VIS/WV-CT/WV-CS", + "data_provider": "JMA", + "sensor_info": {"sensor_name": "AHI", "sensor_full_name": "Advanced Himawari Imager", "sensor_id": 999}, + "satellite_info": [ + {"satellite_name": "GOES-16", "satellite_full_name": "Geostationary Operational Satellite - 16", + "satellite_id": 249}, + {"satellite_name": "GOES-17", "satellite_full_name": "Geostationary Operational Satellite - 17", + "satellite_id": 285}, + {"satellite_name": "GOES-18", "satellite_full_name": "Geostationary Operational Satellite - 18", + "satellite_id": 286}, + {"satellite_name": "GOES-18", "satellite_full_name": "Geostationary Operational Satellite - 18", + "satellite_id": 287} + ], + "yaml_file": yaml_file +} + +encoder = { + 'backend': 'netcdf', + 'dimensions': [{'name': 'Channel', + 'path': '*/ATMSCH', + 'source': 'variables/sensorChannelNumber'}], + 'globals': [{'name': 'platformCommonName', + 'type': 'string', + 'value': 'ATMS'}, + {'name': 'platformLongDescription', + 'type': 'string', + 'value': 'MTYP 021-203 ATMS ' + 'ATENNA/BRIGHTNESS ' + 'TEMPERATURE DATA'}], + 'obsdataout': 'atms_{splits/satId}_1716389684.nc', + 'variables': [{'longName': 'Datetime', + 'name': 'MetaData/dateTime', + 'source': 'variables/timestamp', + 'units': 'seconds since ' + '1970-01-01T00:00:00Z'}, + {'longName': 'Latitude', + 'name': 'MetaData/latitude', + 'range': [-90, 90], + 'source': 'variables/latitude', + 'units': 'degree_north'}, + {'longName': 'Longitude', + 'name': 'MetaData/longitude', + 'source': 'variables/longitude', + 'units': 'degree_east'}, + {'longName': 'Satellite Identifier', + 'name': 'MetaData/satelliteIdentifier', + 'source': 'variables/satelliteIdentifier'}, + {'longName': 'Satellite Instrument', + 'name': 'MetaData/satelliteInstrument', + 'source': 'variables/satelliteInstrument'}, + {'longName': 'Field of View Number', + 'name': 'MetaData/sensorScanPosition', + 'source': 'variables/fieldOfViewNumber'}, + {'longName': 'Sensor View Angle', + 'name': 'MetaData/sensorViewAngle', + 'source': 'variables/sensorScanAngle', + 'units': 'degree'}, + {'longName': 'Altitude of Satellite', + 'name': 'MetaData/heightOfStation', + 'source': 'variables/heightOfStation', + 'units': 'm'}, + {'longName': 'Solar Zenith Angle', + 'name': 'MetaData/solarZenithAngle', + 'range': [0, 180], + 'source': 'variables/solarZenithAngle', + 'units': 'degree'}, + {'longName': 'Solar Azimuth Angle', + 'name': 'MetaData/solarAzimuthAngle', + 'range': [0, 360], + 'source': 'variables/solarAzimuthAngle', + 'units': 'degree'}, + {'longName': 'Sensor Zenith Angle', + 'name': 'MetaData/sensorZenithAngle', + 'range': [0, 90], + 'source': 'variables/sensorZenithAngle', + 'units': 'degree'}, + {'longName': 'Sensor Azimuth Angle', + 'name': 'MetaData/sensorAzimuthAngle', + 'range': [0, 360], + 'source': 'variables/sensorAzimuthAngle', + 'units': 'degree'}, + {'longName': 'Sensor Channel Number', + 'name': 'MetaData/sensorChannelNumber', + 'source': 'variables/sensorChannelNumber'}, + {'chunks': [10000, 22], + 'longName': '3-by-3 Averaged ' + 'Brightness Temperature', + 'name': 'ObsValue/brightnessTemperature', + 'source': 'variables/remappedBT', + 'units': 'K'}]}, +bufr = { + 'splits': {'satId': {'category': {'map': {'_224': 'npp', + '_225': 'n20'}, + 'variable': 'satelliteIdentifier'}}}, + 'variables': { + 'fieldOfViewNumber': {'query': '*/FOVN'}, + 'heightOfStation': {'query': '*/HMSL'}, + 'latitude': {'query': '*/CLATH'}, + 'longitude': {'query': '*/CLONH'}, + 'remappedBT': {'remappedBrightnessTemperature': {'brightnessTemperature': '*/ATMSCH/TMANT', + 'fieldOfViewNumber': '*/FOVN', + 'obsTime': {'day': '*/DAYS', + 'hour': '*/HOUR', + 'minute': '*/MINU', + 'month': '*/MNTH', + 'second': '*/SECO', + 'year': '*/YEAR'}, + 'sensorChannelNumber': '*/ATMSCH/CHNM'}}, + 'satelliteIdentifier': {'query': '*/SAID'}, + 'satelliteInstrument': {'query': '*/SIID'}, + 'sensorAzimuthAngle': {'query': '*/BEARAZ'}, + 'sensorChannelNumber': {'query': '*/ATMSCH/CHNM'}, + 'sensorScanAngle': {'sensorScanAngle': {'fieldOfViewNumber': '*/FOVN', + 'scanStart': -52.725, + 'scanStep': 1.11, + 'sensor': 'atms'}}, + 'sensorZenithAngle': {'query': '*/SAZA'}, + 'solarAzimuthAngle': {'query': '*/SOLAZI'}, + 'solarZenithAngle': {'query': '*/SOZA'} + }, + 'obsdatain': '/work2/noaa/da/xinjin/gdas-validation/global-workflow/sorc/gdas.cd/ush/ioda/bufr2ioda/gdas.t00z.atms.tm00.bufr_d', +} + + +class Bufr2IodaAtms(Bufr2IodaBase): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.update_config(config_json) + self.yaml_config = dict(bufr=bufr, encoder=encoder) + + diff --git a/ush/ioda/bufr2ioda/run_bufr_converter.py b/ush/ioda/bufr2ioda/run_bufr_converter.py index 712b5dfc3..3f63b2f67 100644 --- a/ush/ioda/bufr2ioda/run_bufr_converter.py +++ b/ush/ioda/bufr2ioda/run_bufr_converter.py @@ -2,12 +2,17 @@ from wxflow import Logger, parse_j2yaml, cast_strdict_as_dtypedict from bufr2ioda_ssmis import Bufr2IodaSsmis - +from bufr2ioda_ncep_1bmusa import Bufr2IodaAmusa +from bufr2ioda_ncep_esamua import Bufr2IodaEsamusa +from bufr2ioda_atms import Bufr2IodaAtms # Initialize root logger logger = Logger('gen_bufr2ioda_json.py', level='INFO', colored_log=True) bufr_classes = [ - Bufr2IodaSsmis, +# Bufr2IodaSsmis, +# Bufr2IodaAmusa, +# Bufr2IodaEsamusa, + Bufr2IodaAtms ] config = { @@ -22,7 +27,7 @@ if __name__ == "__main__": - + #TODO mp for bufr_class in bufr_classes: converter = bufr_class(config) converter.execute()