You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

You might find it easier for your to handle data in a CSV file rather than in a GRIB file. This how-to shows you how to do that using ECMWF's ecCodes. You are expected to have it installed on a Linux machine before you continue. You are also recommended to add ecCodes' "bin" directory to your PATH.

Step-by-step guide

  1. Download 2m temperature from the Copernicus Climate Change Service (C3S)'s Climate Data Store (CDS) and save the data as file t2m_20000801.grib. In this example, selections are set as below:
    1. Dataset: ERA5 hourly data on single levels from 2000 to 2017 (you may see different years as new data is released)
    2. Parameter: 2m temperature
    3. Product type: Reanalysis
    4. Year: 2000
    5. Month: August
    6. Day: 01
    7. Time: 06:00, 12:00 and 18:00
    8. Format: GRIB
  2. Check the GRIB file by issuing the "grib_ls -P time t2m_20000801.grib", you should see three GRIB messages in the file at three different times: 600, 1200, 1800. Remember three time values were selected in step 1.
  3. Say I want to extract lat, lon, 2t (2m temperature) at time = 12:00 from the GRIB file. Run "grib_get_data -w time=1200 t2m_20000801.grib > t2m_20000801.csv" and you will get a file containing data like below:

    Latitude, Longitude, Value
       90.000    0.000 2.7346786499e+02
       90.000    0.250 2.7346786499e+02
       90.000    0.500 2.7346786499e+02
       90.000    0.750 2.7346786499e+02
    ...
  4. Make t2m_20000801.csv a proper CSV file

 

If you have CDS API and ecCodes (with its Python interface) installed, you can do the above by writing up a Python script.



  • No labels