Skip to content

Add IMS stationIdentification to ioda formatted output#34

Closed
yuanxue2870 wants to merge 2 commits into
NOAA-PSL:developfrom
yuanxue2870:feature/add_IMSid
Closed

Add IMS stationIdentification to ioda formatted output#34
yuanxue2870 wants to merge 2 commits into
NOAA-PSL:developfrom
yuanxue2870:feature/add_IMSid

Conversation

@yuanxue2870
Copy link
Copy Markdown
Collaborator

@yuanxue2870 yuanxue2870 commented May 9, 2025

Describe your changes

Summarise all code changes included in PR:
Modified imsfv3_scf2iodaTemp.py to output IMS stationIdentification to the ioda formatted output.

List any associated PRs in the submodules.
NOAA-EMC/land-SCF_proc#1 (Note: this is in a different repo) due to conversations in NOAA-PSL/land-SCF_proc#13

Issue ticket number and link

List the git Issue that this PR addresses:
#35

Test output

Is this PR expected to pass the DA_IMS_test (ie., does it change the output)?
Yes.
Does it pass the DA_IMS_test?
Yes.
If changes to the test results are expected, what are these changes? Provide a link to the output directory when running the test:
N/A

Checklist before requesting a review

  • My branch being merged is up to date with the latest develop.
  • I have performed a self-review of my code by examining the differences that will be merged.
  • I have not made any unnecessary code changes / changed any default behavior.
  • My code passes the DA_IMS_test, or differences can be explained.

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

Offline tests are done and passed. The IODA-compatible IMS stationIdentification now will be output as a nine-digit integer. Please review when you get a chance. Thank you! @CoryMartin-NOAA, @youlong.xia@noaa.gov

Once this PR is approved, I will submit another PR to ioda-bundle to get these edits in their repo. Thanks!

@CoryMartin-NOAA
Copy link
Copy Markdown
Collaborator

@YoulongXia-NOAA @yuanxue2870 @jiaruidong2017 should it be an integer or a string?

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

@YoulongXia-NOAA @yuanxue2870 @jiaruidong2017 should it be an integer or a string?

According to Line 421-422 in https://github.com/NOAA-EMC/land-SCF_proc/pull/1/files, 'stid' is an integer.

@CoryMartin-NOAA
Copy link
Copy Markdown
Collaborator

Yes, my question is when we write it out in IODA compatible format, should it be a string? I think yes, but need to confirm

@YoulongXia-NOAA
Copy link
Copy Markdown

@YoulongXia-NOAA @yuanxue2870 @jiaruidong2017 should it be an integer or a string?

Here it is an integer. But it does not matter as Python script in ioda-converter can easily convert an integer into string. I recalled that station identification should be a string.

@YoulongXia-NOAA
Copy link
Copy Markdown

Yes, my question is when we write it out in IODA compatible format, should it be a string? I think yes, but need to confirm

@YoulongXia-NOAA, Modify ioda coveter uing example data IMSscf.20230501.oro_C48.nc in /scratch2/NCEPDEV/land/Youlong.Xia/CycledLandDA/land-IMS_proc/test, from ioda-bundle to find src and land, and modify ims ioda python converter to add read in and write out station identification. For station identification, you can refer GHCN ioda python converter at the same directory.

@jiaruidong2017
Copy link
Copy Markdown
Collaborator

I would suggest to use string here for stid showing the actual required format in downstream codes.

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

OK. Thanks all! Will convert to string as required. Convert the PR to draft during edits.

@yuanxue2870 yuanxue2870 marked this pull request as draft May 9, 2025 15:45
@YoulongXia-NOAA
Copy link
Copy Markdown

@yuanxue2870, it is string for station identification after I checked ghcn ioda format data. python uses string_value = str(integer_value) to convert.

@YoulongXia-NOAA
Copy link
Copy Markdown

@yuanxue2870, ioda-bundle seems to stop to use and now it is jedi-bundle. I also need to learn this bundle. See https://jointcenterforsatellitedataassimilation-jedi-docs.readthedocs-hosted.com/en/latest/using/building_and_running/building_jedi.html. @CoryMartin-NOAA, is this what we need to learn when update any ioda converters?

@CoryMartin-NOAA
Copy link
Copy Markdown
Collaborator

ioda-converters is its own repository, you can build it through several ways including jedi-bundle, GDASApp, or ObsForge

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

yuanxue2870 commented May 9, 2025

Redo offline tests and the test case is passed without issues. The IODA-compatible IMS stationIdentification now will be output as a nine-digit string. A snippet of an example ncdump of the stationIdentification part is attached for your reference. Please review when you get a chance. Thank you! @CoryMartin-NOAA, @youlong.xia@noaa.gov, @jiaruidong2017
Capture

@yuanxue2870 yuanxue2870 marked this pull request as ready for review May 9, 2025 18:08
Comment on lines +110 to +111
for i in range(len(lons)):
strstid[i] = str(stid[i])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for i in range(len(lons)):
strstid[i] = str(stid[i])
+ strstid = np.vectorize(str)(stid)

Copy link
Copy Markdown
Collaborator Author

@yuanxue2870 yuanxue2870 May 9, 2025

Choose a reason for hiding this comment

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

The suggested edit above did not work. ERROR: Unrecognized data type <U9. I understand the loop is the least favorable option here: I have also tried other integer to string conversions before using a loop, e.g., astype(str) to convert integer array directly, but a similar error message is acquired (i.e., ERROR: Unrecognized data type <U21).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok got it, loop is fine in this case

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

@yuanxue2870, ioda-bundle seems to stop to use and now it is jedi-bundle. I also need to learn this bundle. See https://jointcenterforsatellitedataassimilation-jedi-docs.readthedocs-hosted.com/en/latest/using/building_and_running/building_jedi.html. @CoryMartin-NOAA, is this what we need to learn when update any ioda converters?

Thanks for pointing out this. So once this PR looks good to you all, I will submit a PR to https://github.com/JCSDA-internal/ioda-converters to make sure the new edits will go to G-W, is that correct? @CoryMartin-NOAA @YoulongXia-NOAA Thanks!

Copy link
Copy Markdown

@YoulongXia-NOAA YoulongXia-NOAA left a comment

Choose a reason for hiding this comment

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

look fine with me. I approve this PR

@ClaraDraper-NOAA
Copy link
Copy Markdown
Collaborator

@yuanxue2870 @CoryMartin-NOAA

Is this PR still relevant?

Have the changes to the IMS IODA converter been added to the JEDI repo?

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

@yuanxue2870 @CoryMartin-NOAA

Is this PR still relevant?

Have the changes to the IMS IODA converter been added to the JEDI repo?

I think this PR is needed to be merged for the offline workflow. The JCSDA repo of the ioda-coverters have already merged relevant edits in this PR (JCSDA-internal/ioda-converters#1668). Offline workflow has its own standalone ``jedi/ioda/imsfv3_scf2iodaTemp.py`, which requires being updated through this PR. @CoryMartin-NOAA, please feel free to correct me if I am wrong.

@CoryMartin-NOAA
Copy link
Copy Markdown
Collaborator

does it make more sense to just use the one in ioda-converters?

@ClaraDraper-NOAA
Copy link
Copy Markdown
Collaborator

I have the same question as Cory. The converter included here was temporary while we waited for the one in the JEDI repo to be updated. Are there still any differences in functionality between the two?

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

I have the same question as Cory. The converter included here was temporary while we waited for the one in the JEDI repo to be updated. Are there still any differences in functionality between the two?

They are exactly identical. No differences at all.

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

does it make more sense to just use the one in ioda-converters?

Ideally yes if we can make edits in the offline workflow repo to link imsfv3_scf2iodaTemp.py directly from JCSDA repo.

@ClaraDraper-NOAA
Copy link
Copy Markdown
Collaborator

Thanks @yuanxue2870 . I will close the PR, and link in the JEDI converter in a separate PR that I'm working on.

@yuanxue2870
Copy link
Copy Markdown
Collaborator Author

Thanks @yuanxue2870 . I will close the PR, and link in the JEDI converter in a separate PR that I'm working on.

Sounds great! Thanks!

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