pyrtlib.apiwebservices.IGRAUpperAir.request_data#
- classmethod IGRAUpperAir.request_data(time: datetime, site_id: str, beg2021: Optional[bool] = False, derived: Optional[bool] = False) Tuple[DataFrame, DataFrame] #
Retreive IGRA version 2 data files contain the full period of record.
- Parameters:
time (datetime) – The date and time of the desired observation. If list of two times is given, dataframes for all dates within the two dates will be returned.
site_id (str) – 11-character IGRA2 station identifier.
beg2021 (Optional[bool], optional) – If True retrieve files of derived sounding parameters. Defaults to False.
derived (Optional[bool], optional) – If True retrieve files only contain soundings from the current (or current and previous) year. Defaults to False.
- Returns:
A dataframe containing the data and header information.
- Return type:
Tuple[pandas.DataFrame, 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 IGRAUpperAir >>> from datetime import datetime >>> date = datetime(2022, 6, 22, 12) >>> station = 'SPM00060018' >>> df, header = IGRAUpperAir.request_data(date, station) >>> df.attrs['units'] {'etime': 'second', 'pressure': 'hPa', 'height': 'meter', 'temperature': 'degC', 'dewpoint': 'degC', 'direction': 'degrees', 'speed': 'meter / second', 'u_wind': 'meter / second', 'v_wind': 'meter / second'}