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

Add support for ECMWF BUFR data using external tables. #926

Open
dwfncar opened this issue Dec 7, 2017 · 6 comments
Open

Add support for ECMWF BUFR data using external tables. #926

dwfncar opened this issue Dec 7, 2017 · 6 comments
Assignees
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle priority: high High Priority requestor: METplus Team METplus Development Team type: new feature Make it do something new

Comments

@dwfncar
Copy link
Contributor

dwfncar commented Dec 7, 2017

Based upon meetings with ECMWF staff, the ECMWF BUFR tables are external to the BUFR data files. This task is to enhance MET as follows:


(1) Enable pb2nc to read ECMWF BUFR files.


(2) Determine the BUFR table that specified for this data.


(3) Check if the specified BUFR table is included with the BUFR file.


(4) If so, use it.


(5) If not, look for the MET_BUFR_TABLES environment variable which specifies a directory containing BUFR tables.


(6) Read the specified BUFR table and use it to interpret the data.


The ECMWF BUFR tables are available here:
   https://software.ecmwf.int/wiki/display/BUFR/BUFRDC+Home

That website contains a tarball of BUFR tables used by ECMWF along with many other institutions around the world. Rather than redistributing the BUFRDC tables ourselves, just point users to where they can download them.

Also, suggest enhancing PB2NC so that if the BUFR table is not included with the data and an external table can't be located in the MET_BUFR_TABLES directory, print a useful error message. [MET-926] created by johnhg

Charge Key: 2799991

@dwfncar
Copy link
Contributor Author

dwfncar commented Jan 26, 2018

Moving down to major because I think it can wait until June 2018
by jensen

@TaraJensen
Copy link
Contributor

TaraJensen commented Jun 11, 2019

Charge 2799991

@JohnHalleyGotway JohnHalleyGotway modified the milestones: MET 9.0, MET 9.1 Jan 7, 2020
@JohnHalleyGotway JohnHalleyGotway modified the milestones: MET 9.1, MET 10.0 Jun 8, 2020
@JohnHalleyGotway JohnHalleyGotway added the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Sep 10, 2020
@JohnHalleyGotway JohnHalleyGotway removed the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Nov 5, 2020
@JohnHalleyGotway JohnHalleyGotway added requestor: UK Met Office United Kingdom Met Office type: new feature Make it do something new labels Nov 5, 2020
@JohnHalleyGotway JohnHalleyGotway added the alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle label Jan 19, 2021
@JohnHalleyGotway
Copy link
Collaborator

Moved to 10.1 since this is not needed by UK Met Office.

@TaraJensen TaraJensen added the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Sep 13, 2021
@TaraJensen TaraJensen removed the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Sep 24, 2021
@JohnHalleyGotway JohnHalleyGotway added the alert: NEED ACCOUNT KEY Need to assign an account key to this issue label Oct 7, 2021
@TaraJensen TaraJensen added requestor: METplus Team METplus Development Team and removed requestor: UK Met Office United Kingdom Met Office labels Mar 2, 2022
@JohnHalleyGotway JohnHalleyGotway added priority: high High Priority and removed priority: high labels May 9, 2022
@hsoh-u
Copy link
Collaborator

hsoh-u commented Oct 17, 2022

This can be done by using python embedding. There is a python package. PyBufrKit & Documenation.

@John-Sharples
Copy link

@hsoh-u do you have an example of how to implement python embedding for pb2nc? Specifically, what object is it expecting the python script to create? e.g. python embedding for grid_stat needs a numpy array named met_data plus an attrs dict. What does pb2nc expect?

Apologies if this is already in the docs somewhere. I can't seem to find it.

@hsoh-u
Copy link
Collaborator

hsoh-u commented Feb 8, 2023

Unlike ascii2nc, the python embedding for pb2nc is not supported. pb2nc was implemented with APIs from the PREPBUFR library. The python embedding for ECMWF BUFR should do what pb2nc does for PREPBUFR in python. Two options are available for the python object for MET point observation data.

  1. Make CSV output with 'typ', 'sid', 'vld', 'lat', 'lon', 'elv', 'var', 'lvl', 'hgt', 'qc', 'obs' columns (string columns: 'typ', 'sid', 'vld', 'var', 'qc') and call ["MET_BASE/python/read_ascii_point.py"]
    (https://github.com/dtcenter/MET/blob/main_v11.0/scripts/python/read_ascii_point.py)
    • read_ascii_point.py supports white-space separated values
    • create your own python script from read_ascii_point.py to support comma separated values
  2. Build a python dictionary named "met_point_data"
    • 1 dimensional arrays for lat, lon, elv, msg_type_idx, station_id_idx, valid_time_idx
    • 1 dimensional arrays for header_id, variable_id_idx, height, vlevel, qc_idx, obs_value
    • 1 dimensional string arrays for msg_types, station_ids, valid_times, QC_strings, variable_names

We are working to simplify the method 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert: NEED ACCOUNT KEY Need to assign an account key to this issue alert: NEED CYCLE ASSIGNMENT Need to assign to a release development cycle priority: high High Priority requestor: METplus Team METplus Development Team type: new feature Make it do something new
Projects
None yet
Development

No branches or pull requests

5 participants