Skip to content

YAML and Python script for the AHI CSR BUFR#45

Open
PraveenKumar-NOAA wants to merge 35 commits intodevelopfrom
feature/obs_builder_ahicsr
Open

YAML and Python script for the AHI CSR BUFR#45
PraveenKumar-NOAA wants to merge 35 commits intodevelopfrom
feature/obs_builder_ahicsr

Conversation

@PraveenKumar-NOAA
Copy link
Copy Markdown
Contributor

@PraveenKumar-NOAA PraveenKumar-NOAA commented May 29, 2025

This PR introduces the following files for the AHI CSR BUFR converter:

  • ~/dump/mapping/bufr_ahicsr.yaml
  • ~/dump/mapping/bufr_ahicsr.py
  • ~/ush/test/config/bufr_bufr4backend_ahicsr.yaml
  • ~/ush/test/config/bufr_script4backend_ahicsr.yaml

Testing and Validation

  • All four workflows (bufr2netcdf, bufr4backend, script2netcdf, and script4backend) were executed and tested using serial execution.

  • Validation tests were completed for the following variables:

-- brightnessTemperature
-- cloudAmount

The validation was performed by comparing the input BUFR files and the corresponding output IODA files. Additional details can be found in #41.

Python Coding Standards

  • The spoc_python_coding_norms test was run to check compliance with Pycodestyle standards.
  • Result: All checks passed successfully (100% pass, 0 failures).

Variable Naming Validation

  • The variable naming convention test is currently failing due to the absence of the following variables in the naming convention table. To resolve this, these variables need to be added to the table.
  1. Variable 'MetaData/numberPixelVertical'
  2. Variable 'MetaData/sensorBandWidth'
  3. Variable 'MetaData/reportIndicator'
  4. Variable 'MetaData/radianceComputationalMethod'
  5. Variable 'MetaData/satelliteInstrumentData'
  6. Variable 'MetaData/numberPixelHorizontal'
  7. Variable 'MetaData/radianceType'
  8. Variable 'MetaData/receiptTimeSignificance'
  9. Variable 'ObsValue/clearSkyStandardDeviation'_

All these variables have been removed from the YAML file, except clearSkyStandardDeviation, which still needs to be added to the ObsSpace.yaml file.

  • A discussion will be scheduled with users and experts to determine if these variables should be included.

rmclaren and others added 25 commits February 25, 2025 09:40
…ow pycodestye (#30)

**This PR updates two things:**
- Update mapping file and Python script for IASI, CrIS , ATMS 

   Update the following to IASI:**
   1. Rename mtiasi to iasi
   2. Change logging to self.log.warning
   3. Add map_path function

   Add new data type - cris-fsr**

   Update the following for ATMS:**
   1. Change logging to self.log.warning
   2. Add map_path function

- Add Python coding norm check (pycodestyle) --- this is an initial
implementation so we
have a coding norm check for Python script. This will be updated to use
pytest in another PR
   To use it:
   - Load obsforge modules (~eliu/modules/env_obsforge.sh)
   - go to ./sorc/spoc/build
   - ctest -VV -R spoc_python_coding_norms

- Modify all Python scripts to follow pycodestyle (ctest to be added in
another PR soon)
   (No change in science)
This PR addes two files for ASCAT
- mapping YAML
- Python  script  --- pass Python coding norm check

Notes:
- This PR should be tested with [bufr-query PR
#73](NOAA-EMC/bufr-query#73)
- A new PR will be opened to modify the standalone AMV converters
accordingly after this PR is merged.

ASCAT data processing has the following features:
- Convert wind speed and direction to u and v wind components
- Add obs type (290)

Documentation is in Sphinx style 

Test: script2netcdf validated
Validation plots

IODA windEastward 


![gdas_ObsValue_windEastward_satwnd_ascat_metop-b](https://github.com/user-attachments/assets/3d71ed27-1d94-4df6-a3e1-a230dca6a9d1)

GSI windEastward


![gdas_ObsValue_windEastward_ascatw_ascat_metop-b](https://github.com/user-attachments/assets/35473373-4236-4031-985b-0c118529315c)


IODA windNorthward


![gdas_ObsValue_windNorthward_satwnd_ascat_metop-b](https://github.com/user-attachments/assets/a753cdfe-2bac-461f-a418-078ac0ceaa41)


GSI windNorthward

![gdas_ObsValue_windNorthward_ascatw_ascat_metop-b](https://github.com/user-attachments/assets/5e49b097-007a-46d7-a9c2-0c13274fd819)

---------

Co-authored-by: Emily Liu <eliu@hercules-login-4.hpc.msstate.edu>
Co-authored-by: Emily Liu <eliu@hercules-login-3.hpc.msstate.edu>
This PR adds two files for SSMIS
- mapping YAML
- Python script   --- pass Python coding norm test

Notes:
- This PR should be tested with [bufr-query PR
#74](NOAA-EMC/bufr-query#74)

SSMIS data processing has the following features:
- spatial averaging (this is implemented in bufr-query variable
transform) and it can be used by activated the feature from YAML
- Add new variables via the obs builder Python API
- satellite ascending/descending orbit flag (1 for ascending and -1 for
descending)
    - solar zenith and azimuth angles (use pysolar)

Notes:
- Documentation is in Sphnix style (following discussion in Issue #35 )
- SSMIS data conversion includes spatial averaging. Therefore the
processing can only run with one MPI task.
- The solar angles calculation is done using pysolar. The functions used
do not support vectors. Therefore, the calculation of solar angles are
implemented with multiprocessing (e.g., one MPI task and spawned with 12
CPUs)

   ```
             srun -n 1 --cpus_per_tasks=12 python bufr_ssmis.py
   ```
   or 
   ```
             export CPUS_PER_TASKS=12
             python bufr_ssmis.py``
   ```
   
Test: script2netcdf validated
Plots for output netCDF from SSMIS converter   
 

![gdas_solarZenithAngle_ssmis_f17_channel_4](https://github.com/user-attachments/assets/8a90a7c6-9f69-435a-8d15-46b3aa6e698d)


![gdas_satelliteAscendingFlag_ssmis_f17_channel_4](https://github.com/user-attachments/assets/c583697f-7ce7-435c-969b-1ef953fcd090)


![gdas_ObsValue_ssmis_f17_channel_4](https://github.com/user-attachments/assets/74e80396-4865-4ffa-a18f-3bf822ff98d9)

---------

Co-authored-by: Emily Liu <eliu@hercules-login-3.hpc.msstate.edu>
Co-authored-by: Emily Liu <eliu@hercules-login-4.hpc.msstate.edu>
Comment thread dump/mapping/bufr_ahicsr.py
Comment thread dump/mapping/bufr_ahicsr.yaml Outdated

- name: "source"
type: string
value: "U.S. National Weather Service, National Centres for Environmental Prediction (NCEP)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Centers" not Centres

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicholasesposito thanks, fixed.

Comment thread dump/mapping/bufr_ahicsr.yaml Outdated

- name: "providerFullName"
type: string
value: "Japan Meteorological Agencyi (JMA)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Agency"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicholasesposito thanks, fixed.

category: ["h8"]
cache categories: # optional
- ["h8"]
- ["h9"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in assuming we're not doing h9?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicholasesposito thanks for pointing this. We need both, h8 and h9. The backend YAMls were updated for this change.

Praveen.Kumar and others added 5 commits May 30, 2025 16:37
### This PR updates the YAML and Python scripts for SSMIS ATMS, IASI and
CrIS

For all four sensors:
1. Simplify the handling of missing categories using the
`add_dummy_variable` function
2. Use `map_path` from import.obs_builder for ATMS, CrIS, and IASI
3. Remove "type: netcdf" from the encoder section in the YAML
4. Updates `globals` in YAML
5. The output files were validated against the IODA validator with
ObsSpace.yaml; new variables were added to obsSpace.yaml. This validator
checks if the variables in the file follow IODA convention in terms of
name, unit, and dimension.

Here is an example of the output from running the ioda validator for
SSMIS output
```
Reading YAML from ../obsForge/sorc/ioda/share/ioda/yaml/validation/ObsSpace.yaml
Processing data file: ./testoutput/2024021900/script2netcdf/gdas.t00z.ssmis_f17.tm00.nc
 Verifying that all required groups exist
 Verifying group MetaData
 Verifying group ObsValue
 Verifying group /
 Verifying dimension names
 Verifying variable information
  Variable MetaData/earthSurfaceType
  Variable MetaData/sensorZenithAngle
  Variable MetaData/satelliteIdentifier
  Variable MetaData/sensorScanPosition
  Variable MetaData/longitude
  Variable MetaData/latitude
  Variable MetaData/sensorViewAngle
  Variable MetaData/scanLineNumber
  Variable MetaData/solarZenithAngle
  Variable MetaData/sensorChannelNumber
  Variable MetaData/satelliteAscendingFlag
  Variable MetaData/sensorAzimuthAngle
  Variable MetaData/rainFlag
  Variable MetaData/dateTime
  Variable MetaData/solarAzimuthAngle
  Variable ObsValue/brightnessTemperature
Final results:
  # errors:      0
  # warnings:    0

```

Notes:
- SSMIS specific - ssmis conversion uses updated `comupte_solar_angles`
which is under review in [bufr-query PR
#96](NOAA-EMC/bufr-query#96)
- The update of ObsSpace.yaml from IODA is ongoing. We will add new
variables in the [ObsSpace.yaml
](https://github.com/JCSDA-internal/ioda/blob/feature/ObsSpace_Validator/share/ioda/yaml/validation/ObsSpace.yaml)in
IODA branch feature/ObsSpace_Validator

Specific to IASI and CrIS
Modifications made to cloud related variables - `cloudHeight`,
`cloudCoverTotal`, `fractionOfClearInFOV`:
- change group from `MetaData` to `ObsValue`
- change variable type from `int` to `float`
- scale the variables so they range between 0 and 1
- change `ObsValue/radiance` to `ObsValue/spectralRadiance` and unit
accordingly

The above changes are to following IODA convention.



These changes do not alter the results (scientific)

---------

Co-authored-by: Emily Liu <eliu@hercules-login-3.hpc.msstate.edu>
Co-authored-by: Emily Liu <eliu@hercules-login-4.hpc.msstate.edu>
@emilyhcliu
Copy link
Copy Markdown
Collaborator

emilyhcliu commented May 31, 2025

@PraveenKumar-NOAA
I tested the ahicsr converter.
The channel dimension is missing in the IODA file (output)

netcdf gdas.t00z.ahi_h9.tm00 {
dimensions:
        Location = 317847 ;
variables:
        int Location(Location) ;
                Location:_FillValue = 2147483647 ;

This is because your YAML file does not include the dimension section in the encoder section.

Here is the example from ATMS:

encoder:
dimensions:
- name: Channel
source: variables/sensorChannelNumber
path: "*/ATMSCH"

Comment on lines +101 to +102
encoder:

Copy link
Copy Markdown
Collaborator

@emilyhcliu emilyhcliu May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to include dimension section

Here is the example from ATMS:

encoder:
dimensions:
- name: Channel
source: variables/sensorChannelNumber
path: "*/ATMSCH"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emilyhcliu thanks, done.

@PraveenKumar-NOAA
Copy link
Copy Markdown
Contributor Author

@PraveenKumar-NOAA I tested the ahicsr converter. The channel dimension is missing in the IODA file (output)

netcdf gdas.t00z.ahi_h9.tm00 {
dimensions:
        Location = 317847 ;
variables:
        int Location(Location) ;
                Location:_FillValue = 2147483647 ;

This is because your YAML file does not include the dimension section in the encoder section.

Here is the example from ATMS:

encoder:
dimensions:
- name: Channel
source: variables/sensorChannelNumber
path: "*/ATMSCH"

@emilyhcliu thanks. A dimension section is added in the encoder section for the Channel dimension, there are 12 Channels.

@PraveenKumar-NOAA
Copy link
Copy Markdown
Contributor Author

@emilyhcliu A brightness temperature plot has been created for the HIMAWARI-8 CLEAR SKY RADIANCES channel and added to the following issue: #41. This completes the validation for this converter, as the test input BUFR file contains only HIMAWARI-8 data.

Base automatically changed from feature/obs_builder to develop September 18, 2025 21:29
HyundeokChoi-NOAA added a commit that referenced this pull request Apr 7, 2026
…m Praveen.Kumar (#101)

This PR have 2 updates.
1. Enable extraction of redistribution‑restriction metadata by adding
restrictionFlag (RSRD) and restrictionExpiration (EXPRSRD) to the
BUFR→IODA conversion. This ensures downstream restriction‑filter logic
has the required fields available in MetaData.
2. Add modified IODA-Converters that originally from Praveen in PRs
(#45, #55, #61, #62, #69).

---------

Co-authored-by: hyundeok choi <hyundeok.choi@clogin09.cactus.wcoss2.ncep.noaa.gov>
Co-authored-by: hyundeok choi <hyundeok.choi@clogin04.cactus.wcoss2.ncep.noaa.gov>
Co-authored-by: Cory Martin <cory.r.martin@noaa.gov>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hyundeok choi <hyundeok.choi@clogin02.cactus.wcoss2.ncep.noaa.gov>
Co-authored-by: hyundeok choi <hyundeok.choi@clogin06.cactus.wcoss2.ncep.noaa.gov>
Co-authored-by: hyundeok choi <hyundeok.choi@clogin08.cactus.wcoss2.ncep.noaa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants