😁"Good" GRIB
GRIB format is widely used for weather reanalysis and forecast.
Last updated
GRIB format is widely used for weather reanalysis and forecast.
Last updated
GRIB files could contain multiple data layers, and working with them in GIS could be difficult. But tools like xarray could help pre-process them.
ERA5 hourly data on single levels from 1940 to present.
The downloaded GRIB file contains hourly Surface pressure and Sea surface temperature for the 13th-17th of March 2023.
GRIB files are supported by QGIS and could be easily added to the map. But not all the metadata from the file is displayed properly.
The layer is georeferenced, but sub-dataset names are not read properly, and time in the metadata is read as a Unix time tag.
Xarray is a Python library for working with multidimensional data. It provides the capability of reading almost every multidimensional data format along with its metadata, as well as subsetting, resampling, and saving the data. It is convenient to use Jupyter Notebook GUI to study and work with datasets.
The full notebook download is below. To run it, set up conda environment, save the notebook to your working directory, and run jupyter notebook from this directory. Data for the notebook is not provided.
It is very useful to study the dataset structure by printing it.
You can see, that dataset has 3 dimensions: time
, latitude
, and longitude
. 2 data variables are listed: sst
- sea surface temperature, and sp
- surface pressure, they have the same dimensions: 120*721*1440. Every variable line could be expanded to view the details.
As all the dimensions are labeled, it is enough to name the dimension and pass the value for data selection.
To view a separate 1-hour layer
To view values for a specific point
As it was shown before, subsetting by coordinates is very simple, as all the dimensions are labeled with physical values. To subset to South Georgia's extent we will use vector file.
To convert temperature to Celsius
The output file is georeferenced, has variable name and readable time.
Converting NetCDF to GeoTIFF will be covered in the next section.