WxData 3.0 Released - WxData Clients Now Have a Command-Line Interface Tool Bringing WxData into the Shell For Advanced ETL Weather Data Pipelines

:tada: WxData 3.0 Released on conda-forge and PyPi:tada:

WxData 3.0 brings the WxData clients into the shell where you can download and process over 20+ Weather Models, Observed Soundings, NWS Forecasts/SPC Outlooks, NEXRAD II Radar Data straight from the command-line. Users can now use the WxData Command-Line Interface tool to build advanced ETL pipelines in shell scripts that can bulk download the data from various source servers (i.e. NCEP/NOMADS or ECMWF Open-Data vs. Amazon Web Services and Google Cloud) (and you can use a proxy server if necessary) → subset the data to a bounding box → decode the GRIB2 variable keys into plain-language → convert from GRIB2 to NETCDF → export the end result as a NETCDF (.nc) file.

TLDR: WxData 3.0 allows you to build automated pipelines in shell scripts (and native Python too) for large scale weather model data downloads, clean the data and export to a NETCDF (.nc) file. Download → Clean → Decode → Convert GRIB2 to NETCDF → Export to NETCDF.

WxData 3.0 introduces several new real-time ECMWF data clients and significant performance improvements to the existing ECMWF data clients.

Finally, WxData 3.0 introduces several new clients that retrieve and process archived weather model data and NEXRAD II Radar data. This can be useful to researchers who want archived weather model data for a case study or ongoing research.

Here are some helpful links to help you get started building your ETL pipelines

  1. Full WxData Documentation (I just created a new GitHub web page for this)
  2. Full WxData 3.0 Release Notes
  3. WxData GitHub Repository
  4. WxData Jupyter Notebook Repository
  5. WxData Shell Scripting Repository

Get started by either:

conda install -c conda-forge wxdata

OR

pip install wxdata

WxData 3.0 requires Python >= 3.10.

Great question!

Here is a detailed explanation of how the process works:

  1. The client uses byte-range requests when downloading the data. This is done by scanning the index (.idx) files for the variables requested for a given level_type (i.e. ‘pressure’, ‘height above ground’ etc.). These byte-ranges are then passed in as headers when performing the HTTP request on the GRIB2 file so we only download the variables we need. To my knowledge, the only server that has a GRIB filter is NCEP/NOMADS, however byte-range requests is the methodology to use to limit the download size when there is no GRIB filter present to use (Amazon Web Services, Google Cloud, etc. do not have a GRIB filter). There is no way to my knowledge to perform the bounding box subsetting on the download (without a GRIB filter to use on the server) as there is no information in the index files regarding coordinates. However, being able to query the variables at a given level type allows for reducing the file size during the download because the only alternative is to download the entire file.

  2. The subsetting occurs during the first step of data processing. The client will extract the data using xarray.open_mfdataset() and then subset the data in this xarray.array. In this example, let’s use a bounding box of 130W, 65W, 20N, 50N.

  3. The next step of processing is the client decodes the GRIB2 variable keys into plain-language (i.e. 'r2' → '2m_relative_humidity').

  4. When wanting to convert and export to a netCDF file you need to set to_netcdf=True in python or --netcdf True in shell and if you want to use paths and filenames other than the default you need to change the settings for netcdf_path=f"{path_to_your_netCDF_file}" in python or --ncdir path_to_your_netCDF_file in shell and netcdf_filename={your_filename.nc} in python or --ncfname your_file_name.nc in shell.

The bounding box subsetting and decoding of the GRIB2 variable keys occurrs before converting and exporting to netCDF. The resulting netCDF file should reflect the 130W, 65W, 20N, 50N bounding box to reduce the file size of the netCDF file.

I hope this helps!