ghg_forcing_for_cmip.download_satellite#
Download satellite data
In this module we download the OBS4MIPs data used for satellite measurements of CO2 and CH4
Functions:
| Name | Description |
|---|---|
download_satellite_data |
Download and preprocess satellite GHG concentration |
make_api_request |
Request data from Climate Data Store via API |
validate_obs4mips_data |
Preprocess OBS4MIPS data from nc to csv format |
download_satellite_data #
download_satellite_data(
gas: str,
remove_original_files: bool,
save_to_path: str = "data/downloads",
) -> None
Download and preprocess satellite GHG concentration
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gas
|
str
|
greenhouse gas, either ch4 or co2 |
required |
save_to_path
|
str
|
path to save the results |
'data/downloads'
|
remove_original_files
|
bool
|
whether downloaded files should be kept; otherwise they are removed |
required |
Source code in src/ghg_forcing_for_cmip/download_satellite.py
make_api_request #
Request data from Climate Data Store via API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gas
|
str
|
target greenhouse gas variable Currently supported gas variables are 'co2' and 'ch4' |
required |
save_to_path
|
Path
|
path to save downloaded data |
required |
References
Copernicus Climate Change Service, Climate Data Store, (2018): Methane data from 2002 to present derived from satellite observations. Copernicus Climate Change Service (C3S) Climate Data Store (CDS). DOI: 10.24381/cds.b25419f8
Copernicus Climate Change Service, Climate Data Store, (2018): "Carbon dioxide data from 2002 to present derived from satellite observations". Copernicus Climate Change Service (C3S) Climate Data Store (CDS). DOI: 10.24381/cds.f74805c8
Notes
A login and further pre-setup is required to be able to download the data from the API. Please refer to the following link for further details: https://cds.climate.copernicus.eu/how-to-api
Source code in src/ghg_forcing_for_cmip/download_satellite.py
validate_obs4mips_data #
validate_obs4mips_data(
path_to_nc: Path,
gas: str = "co2",
factor: float = 1000000.0,
) -> DataFrame
Preprocess OBS4MIPS data from nc to csv format
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_to_nc
|
Path
|
path where OBS4MIPS dataset is stored as nc format |
required |
gas
|
str
|
target greenhouse gas variable |
'co2'
|
factor
|
float
|
factor for converting ghg concentration from unitless to ppb (ch4; factor = 1e9) or ppm (co2; factor = 1e6) |
1000000.0
|