Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a converter for amusa from bufr to ioda #754

Open
wants to merge 78 commits into
base: develop
Choose a base branch
from

Conversation

xincjin-NOAA
Copy link
Collaborator

@xincjin-NOAA xincjin-NOAA commented Nov 20, 2023

Amsua has two NCEP bufr files which need to be converted to ioda format and merged together.

The two ncep bufr example files are gdas.t00z.esamua.tm00.bufr_d and gdas.t00z.1bamua.tm00.bufr_d.

  1. created one json file for the converter:: bufr2ioda_ncep_amsua.json
  2. created two yaml files for the converter: bufr2ioda_combine_ncep_esamua.yml, bufr2ioda_combine_ncep_1bamua_ta.yml
  3. fix files are added: amsua_metop-c_v2.ACCoeff.nc [might need more]
  4. the following python scripts are added to transfer bufr to ioda format and merge them.
    • antcorr_application.py
    • bufr2ioda_base.py
    • bufr2ioda_combine_ncep_amsua.py
    • utils.py
  5. run_bufr2ioda.py is updated for the converter

To test the changes in this PR, we will need to checkout feature/query_python_ext for iodaconv.
https://github.com/JCSDA-internal/ioda-converters/tree/feature/query_python_ext

RussTreadon-NOAA and others added 30 commits November 9, 2023 13:48
Two updates for GOES AMV

1. BUFR Converter:
- remove wind direction and speed
- change sensorZenithAngle to satelliteZenithAngle
2. UFO Filters:
- change `sensorZenithAngle` to `satelliteZenithAngle`
- add `linear obs operator` section
The declaration of `linear obs operator" is necessary for GOES AMV since
there is no linearized component for applying the 10-meter factor.

The increments look reasonable:
```
0: ----------------------------------------------------------------------------------------------------
  0: Increment print | number of fields = 8 | cube sphere face size: C768
  0: eastward_wind                                | Min:-1.642335e-01 Max:+1.660654e-01 RMS:+2.746685e-04
  0: northward_wind                               | Min:-2.120068e-01 Max:+1.663539e-01 RMS:+2.631295e-04
  0: air_temperature                              | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: surface_pressure                             | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: specific_humidity                            | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: cloud_liquid_ice                             | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: cloud_liquid_water                           | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: ozone_mass_mixing_ratio                      | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: ----------------------------------------------------------------------------------------------------
```

The UFO filter results vs. GSI  -- looks good


![ufo_abi_goes-16_omf_windEastward_qc_time1](https://github.com/NOAA-EMC/GDASApp/assets/36091766/017aeabc-d6ca-4643-b037-16f46dde76a0)


![gsi_abi_goes-16_omf_windEastward_qc_time1](https://github.com/NOAA-EMC/GDASApp/assets/36091766/d99599a2-3f36-4ef6-aa2e-4611500b8c43)
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.
Two updates for MetOp SCATWIND; one minor updates for GOES AMV 

1. BUFR Converter:
    - remove wind direction and speed
    - add `stationElevation` as zero 

2. UFO Filters:
    - add linear obs operator section
The declaration of `linear obs operator" is necessary for GOES AMV since
there is no
      linearized component for applying the 10-meter factor.
- add `Gaussian Thinning` filter to thin data with 75 km box (equal box
size, prefer data close to central of the box)

3. For GOES AMV YAML files, change output data extension from `nc4` to
`nc`

UFO vs. GSI O-F and QC comparison: O-F and data count passed look close
![ufo_ascat_metop-b_omf_windEastward_qc
(1)](https://github.com/NOAA-EMC/GDASApp/assets/36091766/f234543e-e0b5-4c6e-add9-3c7365c0c469)

![gsi_ascat_metop-b_omf_windEastward_qc](https://github.com/NOAA-EMC/GDASApp/assets/36091766/37f4fba8-bd2a-4a54-b45e-4055e3ef3142)

3Dvar increments are reasonable with MetOp-B SCATWIND alone.
```
0: ----------------------------------------------------------------------------------------------------
  0: Increment print | number of fields = 8 | cube sphere face size: C768
  0: eastward_wind                                | Min:-1.741092e+00 Max:+1.712287e+00 RMS:+2.282584e-03
  0: northward_wind                               | Min:-1.825957e+00 Max:+1.930385e+00 RMS:+2.496075e-03
  0: air_temperature                              | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: surface_pressure                             | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: specific_humidity                            | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: cloud_liquid_ice                             | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: cloud_liquid_water                           | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: ozone_mass_mixing_ratio                      | Min:+0.000000e+00 Max:+0.000000e+00 RMS:+0.000000e+00
  0: ----------------------------------------------------------------------------------------------------

```

3DVar increments are also reasonable with MetOp-B + MetOp-A assimilated
…oda.x (#730)

This PR allows for all obtypes to be processed in two loops.

We still need to figure out a way to process these in parallel
(somewhat).
Using python multiprocessing to generate obs in parallel. The current
list of obs goes from 10+ minutes to completing in ~5.5 minutes.
@RussTreadon-NOAA noted that `obs linear operator` should be `linear obs
operator` in the GOES-17 satwind YAML. This fixes that.
This reduces runtime further to run everything in one parallel pool.
Now, things complete in under 4 minutes (as of now).
Adding satwinds from the Advanced Himawari Imager (AHI) from Himawari-8
to GDASApp end-to-end testing

new files include:
parm/atm/obs/config/satwind_ahi_h8.yaml: QC filter YAML for AHI
Himawari-8 satwinds
parm/ioda/bufr2ioda/bufr2ioda_satwind_amv_ahi.json: JSON containing data
format, sensor, and satellite information for AHI Himawari-8 satwinds
ush/ioda/bufr2ioda/bufr2ioda_satwind_amv_ahi.py: bufr2ioda code for
extracting AHI Himawari-8 satwinds from BUFR

modified files include:
ush/ioda/bufr2ioda/run_bufr2ioda.py: added `"satwind_amv_ahi"` to list
`BUFR_py`

See #741 for details on testing. JEDI/GSI comparisons look good with GSI
thinning turned off, but there are large ob-count disparities both
before and after QC when comparing GSI+thinning to JEDI+thinning. The
tested `Gaussian Thinning` filter is included in the YAML but commented
out with a note.

---------

Co-authored-by: Brett Hoover <[email protected]>
Co-authored-by: Cory Martin <[email protected]>
merge gdas-validation
Instead of writing the filled out `.json` and `.yaml` files to
`$COM_OBS`, we write them to `$DATA` so that they get purged unless
`KEEPDATA="YES"`
@emilyhcliu
Copy link
Collaborator

emilyhcliu commented Mar 19, 2024

The merge is a bit odd and tricky.
The AMSU-A yaml files under parm/atm/obs/config in your branch before merging with the develop are new yaml files except for amsua_n19. So, when you merge your branch with the develop (yaml file has j2 extension under config), you will get a conflict for amsua_n19.yaml

The amsua_n19.yaml.j2 in the develop is old. Could you confirm that the amsua_n19.yaml.j2 in the merged branch has all the updates (e.g. thinning and some changes in the filters) from your branch?
Also, it looks like you will need to manually add j2 extension for the merged amsua yaml files under config.

@xincjin-NOAA
Copy link
Collaborator Author

@emilyhcliu I will check those and make a test run then.

Thanks,

@xincjin-NOAA
Copy link
Collaborator Author

Merged the develop into this branch and tested on orion.

@xincjin-NOAA
Copy link
Collaborator Author

@ADCollard and @emilyhcliu , After a small modifying of QC filters on the GSI run the OmF and final ObsError difference between GSI and JEDI become smaller(the plots were updated), though there still a little differences. We also plot the maps of them and don't find any odd behaviors. We conclude that the differences are caused mainly by the difference of filters.

Not sure if we still want to make more tests to make the differences smaller.

@ADCollard
Copy link
Collaborator

@xincjin-NOAA Can you confirm that the plots have been updated (channel and maps plots)? They say they were most recently edited last week.

Having said that they do look a little better than I remember. Do you have the unthinned versions of these plots?

Can you also explain what was changed in the GSI to improve the agreement?

Thanks.

@xincjin-NOAA
Copy link
Collaborator Author

@ADCollard Yes I updated the plots (might be it is better just add new plots later). @emilyhcliu ran the new GSI with some changes in the filters. I am going to see if I can find the results from the unthinned runs.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 20, 2024

Figure 3

**Obs comparisons between those from GSI and IODA(after converter and not thinned) **

GSI JEDI
image image
GSI JEDI
image image

Conclusion
The Obs are almost the same after convert to ioda format.

@ADCollard
Copy link
Collaborator

@xincjin-NOAA Can you plot O-B after QC? Thanks.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 20, 2024

@ADCollard These are from the files directly converted from the bufr file and no QC yet in case of IODA. Is O-F the same as O-B? The O-F plots above are after QC.

@ADCollard
Copy link
Collaborator

@xincjin-NOAA Yes O-F is the same as O-B. I thought you had produced the O-B plots after QC but before thinning? Maybe @emilyhcliu did?

@emilyhcliu
Copy link
Collaborator

emilyhcliu commented Mar 21, 2024

@xincjin-NOAA Are you now running the end-to-end with the latest T2O fix? If so, then your result from GADS is high resolution (C768). Please confirm if you are running end-to-end in C768 resolution. Check your config.base and search CASE.
Let me know which resolution you are using. I will point you to the correct IODA file from GSI.

@emilyhcliu
Copy link
Collaborator

@xincjin-NOAA I checked out your branch and will test them today.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 21, 2024

Figure 4

Here are the channel statistics plots for results without thinning and with QC. ( the amsua n19 file is merged from two files)

O-F Bias/Standard Deviation

GSI JEDI
GSI_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_ChannelStates_amsua_19_diag_2021080100_amsua_19

Final ObsError

GSI JEDI
GSI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19

Numbers PassedQC

GSI JEDI
GSI_PassedQC_Countsamsua_19_diag_2021080100_amsua_19 JEDI_PassedQC_Countsamsua_19_diag_2021080100_amsua_19

Maps for Channel 3 .

O - F

GSI JEDI
ioda_amsua_n19_GSI_IODA_3_ObsValue_GsiHofXBc ioda_amsua_n19_IODA_3_ObsValue_hofx0

Final ObsError

GSI JEDI
ioda_amsua_n19_GSI_IODA_3_GsiFinalObsError ioda_amsua_n19_IODA_3_EffectiveError0

There are no large differences found.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 22, 2024

Figure 5

Here are the channel statistics plots for results without thinning and after QC for a single 1bamsua file.

O-F Bias/Standard Deviation

GSI JEDI
GSI_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_ChannelStates_amsua_19_diag_2021080100_amsua_19

Final ObsError

GSI JEDI
GSI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19

Numbers PassedQC

GSI JEDI
GSI_PassedQC_Countsamsua_19_diag_2021080100_amsua_19 JEDI_PassedQC_Countsamsua_19_diag_2021080100_amsua_19

Maps for Channel 3 .

O - F

GSI JEDI
ioda_amsua_n19_GSI_IODA_3_ObsValue_GsiHofXBc ioda_amsua_n19_IODA_3_ObsValue_hofx0

Final ObsError

GSI JEDI
ioda_amsua_n19_GSI_IODA_3_GsiFinalObsError ioda_amsua_n19_IODA_3_EffectiveError0

They agree well with each other in general.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 22, 2024

Summary

Figure 1 , the channel statistics plots (#obs, bias/std for OMF and final obs error) for JEDI and GSI runs show general agreement between GSI and JEDI results, except for the channel 3 which show some differences in O-F and Final-error. In order to understand this we explored different causes as follow:

  • The maps for channel 3 (Figure 2) show that there are not any place where significant differences existed.
  • Figure 3 demonstrated that there are no differences between GSI and JEDI after converted to IODA data format.
  • Figure 4, the plots from results without thinning and after QC, show no large differences
  • Figure 5, the plots which is drawn based on the results with a single amsua file without merging, also show no large differences, though some differences are existed here or there.

Therefore, we can conclude that the small differences come from different methods used in GSI and JEDI in terms of thinning, different QC filters in general. The difference identified in Figure 1 for channel 3 is from different thinning methods between GSI and JEDI.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 22, 2024

There are two concerns left from this PR:

  • find a place to store the Antenna Coefficient NetCDF files
  • merge two .nc files is okay for now, but it is better to implement it in the ObSpace

create another issue for this: #987

@emilyhcliu
Copy link
Collaborator

@xincjin-NOAA The result for the unthinned case looks OK in general. The obs errors for low-peaking channels 1-2 have slightly lower final obs error standard deviation values. I will run end-to-end with your branch to check the initial/final them obs error and compared with GSI. I am a bit curious about the slight difference for channels 1-2. I will post the results of my test here.

One more comment:
Please add error handling in the Python converter for missing input files or missing subsets
- the need to add the error handling was identified by @RussTreadon-NOAA (see PR #937 for more infomation)
- here is the example of error handling added in the converter

Screenshot 2024-03-21 at 11 34 43 PM

@emilyhcliu
Copy link
Collaborator

There are two concerns left from this PR:

  • find a place for *.nc files
  • merge two .nc files

create another issue for this: #987

Your amsua python code can merge the 1bamua and esamua, isn't it?

For your first concern, do you mean we need to find a place to store the Antenna Coefficient NetCDF files?

@xincjin-NOAA
Copy link
Collaborator Author

@emilyhcliu

For the first, Yes. @CoryMartin-NOAA commented that it is better to merge the two .nc files in Obspace, though it is okay for now.

I will put details there.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 25, 2024

After some experiments by turn off different combinations of filters and found that the step 10 which is the filter of Grosscheck filter might play a key role in the differences found. I am going to explore the map of them to see if we can find something.

Figure 6

Final ObsError

Before After
JEDI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 27, 2024

Numbers in Gross Check

Channel 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IODA 165 164 54 9 56 27 0 0 163 24 28 76 157 54 39
GSI 148 130 59 8 62 40 0 0 156 18 29 69 149 52 36

The numbers in channel 1, 2, are much larger than that for channel 3. This can explain the feature noticed above.

Figure 7

Map for Gross Check

GSI JEDI
ioda_amsua_n19_gsi_3_gross_check ioda_amsua_n19_ioda_3_gross_check

Gross filter are quite different between GSI and IODA.

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 29, 2024

Figure 8 Comparisons of the Initial ObsError between GSI and JEDI.

Initial ObsError

GSI JEDI
GSI_input_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19 JEDI_Derived_ObsError_ChannelStates_amsua_19_diag_2021080100_amsua_19

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 29, 2024

Figure 9 Map comparisons of the Initial ObsError, retrieved clw, and hofx0 between GSI and JEDI (un-thinned data, Channel 1)

Initial ObsError

GSI JEDI
ioda_amsua_n19_GSI_IODA_1_GsiInputObsError ioda_amsua_n19_IODA_1_InitialObsError

Retrieved CLW

GSI JEDI
ioda_amsua_n19_GSI_IODA_1_cloudWaterRetrievedFromSimulatedObservation ioda_amsua_n19_IODA_2_CLWRetFromBkg

Hofx0

GSI JEDI
ioda_amsua_n19_GSI_IODA_1_GsiHofXBc ioda_amsua_n19_IODA_1_hofx0

@xincjin-NOAA
Copy link
Collaborator Author

xincjin-NOAA commented Mar 29, 2024

Figures 8 and 9 showed un-thinned statics of initial errors and related retrieved clw and hofx0.

  1. Figure 8 show the initial errors agree well between GSI and JEDI with a little higher in GSI for channels 2 and 3 as noticed by @emilyhcliu above.
  2. From the map in Figure 9 we can see a little difference between GSI and JEDI in the initial error and related clw and hofx0

In summary, we think these differences, (mean and std differences are 1%, and 4%, respectively) are acceptable considering there are many differences between two systems. Any comments from @emilyhcliu and @ADCollard?

@xincjin-NOAA
Copy link
Collaborator Author

@emilyhcliu error handling in the codes were checked and added some more.

@CoryMartin-NOAA
Copy link
Contributor

This PR is 11 months old. Is it still relevant? Do we need to close it and open a new one later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants