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

Enhance ASCII2NC to read NDBC buoy data #2276

Closed
20 tasks done
JohnHalleyGotway opened this issue Sep 23, 2022 · 12 comments · Fixed by #2294
Closed
20 tasks done

Enhance ASCII2NC to read NDBC buoy data #2276

JohnHalleyGotway opened this issue Sep 23, 2022 · 12 comments · Fixed by #2294
Assignees
Labels
MET: PreProcessing Tools (Point) priority: high High Priority reporting: DTC NOAA R2O NOAA Research to Operations DTC Project requestor: NOAA/EMC NOAA Environmental Modeling Center requestor: NOAA/OPC NOAA Ocean Prediction Center type: new feature Make it do something new
Milestone

Comments

@JohnHalleyGotway
Copy link
Collaborator

JohnHalleyGotway commented Sep 23, 2022

Describe the New Feature

The desire to use buoy data in ASCII format for verification within MET has come up twice recently as seen in this GitHub discussion. This functionality is needed by both NOAA/EMC and NOAA/OPC. While the interim solution is using python embedding of point observations, the task for this issue is to support it directly via the ASCII2NC tool in MET. Please refer to this dtcenter/METplus#1482 issue for a related METplus use case.

Recommend supporting NDBC Buoy data. This issue includes:

  • Contacting @DeannaSpindler-NOAA to retrieve sample data.
  • Adding support for a new -format option to read this data.
  • Add new unit test(s) to demonstrate this functionality.
  • Update the User's Guide accordingly.

Acceptance Testing

List input data types and sources.
Describe tests required for new functionality.

Time Estimate

Estimate the amount of work required here.
Issues should represent approximately 1 to 3 days of work.

Sub-Issues

Consider breaking the new feature down into sub-issues.
None needed.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

2773542

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required: @davidalbo
  • Select scientist(s) or no scientist required: @j-opatz

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Select Repository and/or Organization level Project(s) or add alert: NEED PROJECT ASSIGNMENT label
  • Select Milestone as the next official version or Future Versions

Define Related Issue(s)

Consider the impact to the other METplus components.

New Feature Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding source.
  • Fork this repository or create a branch of develop.
    Branch name: feature_<Issue Number>_<Description>
  • Complete the development and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into develop.
    Pull request: feature <Issue Number> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s) and Linked issues
    Select: Repository level development cycle Project for the next official release
    Select: Milestone as the next official version
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Close this issue.
@JohnHalleyGotway JohnHalleyGotway added requestor: NOAA/EMC NOAA Environmental Modeling Center type: new feature Make it do something new alert: NEED ACCOUNT KEY Need to assign an account key to this issue requestor: NOAA/OPC NOAA Ocean Prediction Center MET: PreProcessing Tools (Point) priority: high High Priority labels Sep 23, 2022
@JohnHalleyGotway JohnHalleyGotway added this to the MET 11.0.0 milestone Sep 23, 2022
@davidalbo
Copy link
Contributor

I'm starting to work on this issue, to put buoy data into ascii2nc so you can input multiple files directly. What would be helpful is sample data files, and a description of the format. @DeannaSpindler-NOAA can you get me going?

@DeannaSpindler-NOAA
Copy link

DeannaSpindler-NOAA commented Sep 28, 2022 via email

@davidalbo
Copy link
Contributor

@DeannaSpindler-NOAA thanks! A few questions.

  1. Do you need support for all the formats here https://www.ndbc.noaa.gov/measdes.shtml , or one particular one? A subset?
  2. Many of the file formats do not have latitude/longitude I assume because they don't move. Is there a mapping from buoy number to latitude/longitude?

@DeannaSpindler-NOAA
Copy link

DeannaSpindler-NOAA commented Sep 28, 2022 via email

@davidalbo
Copy link
Contributor

davidalbo commented Sep 28, 2022

@DeannaSpindler-NOAA the input file names will be things like 410001.txt, correct?

If so, @JohnHalleyGotway looks like I'll need to parse these input file names to lookup a lat/lon. The buoy numbers are not inside the file anywhere. What do you think, does it break the design?

@DeannaSpindler-NOAA
Copy link

DeannaSpindler-NOAA commented Sep 28, 2022 via email

@davidalbo
Copy link
Contributor

I found this and downloaded it: https://www.ndbc.noaa.gov/activestations.xml
With a little minor XML parsing, should be able to create an ID to lat/lon lookup.
@JohnHalleyGotway might want to put XML parsing into library code somewhere, unless something already exists. I do have familiarity with an existing library from another project outside of MET that reads/writes XML. We should discuss options.

@TaraJensen TaraJensen added reporting: DTC NOAA R2O NOAA Research to Operations DTC Project and removed alert: NEED ACCOUNT KEY Need to assign an account key to this issue labels Sep 30, 2022
@davidalbo
Copy link
Contributor

@JohnHalleyGotway I can't tell if its working or not. The difference between this and the other ascii input data I worked on (airnow) is that in this case each file has many times, for airnow each file had only one time. When I try to do these things to see if it's working:

plot_point_obs
Rscript ./pntnc2ascii.R

it seems like it's not working, yet the code seems identical as far as adding observations no matter how much I look at it.

Is it ok to put many times into a single netCDF output file?

@davidalbo
Copy link
Contributor

From @hsoh-u, saving for reference: The GRIB code can be saved by creating "obs_gc" variable instead of the "obs_vid". In this case, the global attribute "use_var_id" must be "false". I think MET prefers to use variable_ID over GRIB code. This means what is passed into the Observation constructor as 'grib_code' is actually index into the variables (0,1,2..)

@davidalbo
Copy link
Contributor

@jprestop, I have another file that is external and must be read in, just like previously for airnow data, to look up latitude/longitude. It is a table_file. Previously I handed a file to you and it showed up on a web page, if I'm remembering. You did 'something', not sure what. The file I need this time: /scratch/dave/ndbc_stations.xml

I did add the file on my development branch here:
data/table_files/ndbc_stations.xml
and modified the Makefiles accordingly.

@jprestop
Copy link
Collaborator

jprestop commented Oct 6, 2022

Thanks @davidalbo. The last time I added data for you, I followed the instructions in this comment from @JohnHalleyGotway. However, looking at the content on mohawk at this location, /d2/www/dtcenter/dfiles/code/METplus/MET/MET_unit_test, it does not appear that table_files are considered unit_test data, so I do not believe that any further action is needed other than what you have already done.

@davidalbo
Copy link
Contributor

I had it backwards, I needed @jprestop to help to put unit test data into place, not for the table file. That is now done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MET: PreProcessing Tools (Point) priority: high High Priority reporting: DTC NOAA R2O NOAA Research to Operations DTC Project requestor: NOAA/EMC NOAA Environmental Modeling Center requestor: NOAA/OPC NOAA Ocean Prediction Center type: new feature Make it do something new
Projects
No open projects
6 participants