pyrtlib.apiwebservices.ERA5Reanalysis.read_data#

classmethod ERA5Reanalysis.read_data(file: str, lonlat: tuple) DataFrame#

Read data from the ERA5 Reanalysis dataset.

Parameters:
  • file (str) – The netcdf file

  • lonlat (tuple) – longitude and latitude

Returns:

Dataframe containing the variables retrieved.

Return type:

pandas.DataFrame

Note

Variables name and units information are reported within the attribute units of the returned dataframe (see example below).

Example

>>> from pyrtlib.apiwebservices import ERA5Reanalysis
>>> lonlat = (15.8158, 38.2663)
>>> date = datetime(2020, 2, 22, 12)
>>> nc_file = ERA5Reanalysis.request_data(tempfile.gettempdir(), date, lonlat)
>>> df_era5 = ERA5Reanalysis.read_data(nc_file, lonlat)
>>> df_era5.attrs['units']
{'p': 'hPa',
'z': 'km',
't': 'K',
'rh': '%',
'clwc': 'kg kg-1',
'ciwc': 'kg kg-1',
'crwc': 'kg kg-1',
'cswc': 'kg kg-1',
'o3': 'kg kg-1',
'q': 'kg kg-1'}

Note

To convert specific cloud water content (CLWC) or specific cloud ice water content (CIWC) from kg kg-1 to g m-3 using this function pyrtlib.utils.kgkg_to_gm3()

Examples using pyrtlib.apiwebservices.ERA5Reanalysis.read_data#

Performing Upwelling Brightness Temperature calculation using ERA5 Reanalysis Observations.

Performing Upwelling Brightness Temperature calculation using ERA5 Reanalysis Observations.

Performing Upwelling Brightness Temperature calculation using ERA5 Reanalysis Observations in cloudy condition.

Performing Upwelling Brightness Temperature calculation using ERA5 Reanalysis Observations in cloudy condition.