Commit 9c3fdbf6 authored by Julia Wagemann's avatar Julia Wagemann
Browse files

LTPy v0.6 release

parent a05b1af2
%% Cell type:markdown id: tags:
<img src='./img/EU-Copernicus-EUM_3Logos.png' alt='Logo EU Copernicus EUMETSAT' align='right' width='50%'></img>
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
# LTPy - Learning Tool for Python on Atmospheric Composition Data
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
**LTPy - Learning tool for Python on Atmospheric Composition Data** is a Python-based training course on Atmospheric Composition Data. The training course covers [10 - DATA ACCESS](#data_access), [20 - DATA DISCOVERY](#data_discovery), [30 - CASE STUDIES](#case_studies) and [40 - EXERCISES](#exercises) of satellite- and model-based data on Atmospheric Composition.
The course is based on [Jupyter notebooks](https://jupyter.org/), which allow for a high-level of interactive learning, as code, text description and visualisation is combined in one place. If you have not worked with `Jupyter Notebooks` before, you can look at the module [01 - Python and Project Jupyter 101](./01_Python_and_Jupyter_101.ipynb) to get a short introduction to Jupyter notebooks and their benefits.
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
## Data on Atmospheric Composition
%% Cell type:markdown id: tags:
This course features the following **satellite** data:
* `Metop-A/B GOME-2 Level 2` data
* `Metop-A/B GOME-2 Level 3` reprocessed and regridded data
* `Metop-A/B/C GOME-2 Level 2` data
* `Metop-A/B/C GOME-2 Level 3` reprocessed and regridded data
* `Polar Multi-Sensor Aerosol Optical Properties (PMAp) Level 2` data
* `Metop-A/B IASI Level 2` data
* `Metop-A/B/C IASI Level 2` data
* `Copernicus Sentinel-5P TROPOMI Level 2` data
* `Copernicus Sentinel-3 OLCI Level 1B` data
* `Copernicus Sentinel-3 SLSTR NRT FRP Level 2` data
* `Copernicus Sentinel-3 SLSTR NRT AOD Level 2` data
And the following **model-based** data:
* `Copernicus Atmosphere Monitoring Service (CAMS) Global Reanalysis (EAC4)` data
* `Copernicus Atmosphere Monitoring Service (CAMS) Global Fire Assimilation System (GFAS)` data
* `Coperncus Emergency Management Service (CEMS) Global ECMWF Fire Forecast (GEFF)` data
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
## Course material
%% Cell type:markdown id: tags:
The course follows a modular approach and offers modules on:
- [10 - DATA ACCESS](#data_access)
- [20 - DATA DISCOVERY](#data_discovery)
- [30 - CASE STUDIES](#case_studies)
- [40 - EXERCISES](#exercises)
<br>
<div class="alert alert-block alert-info">
<b><a id='data_access'></a>10 - DATA ACCESS</b>
</div>
* [11 - Atmospheric Composition data overview and acccess](./10_data_access/11_ac_data_access_overview.ipynb)
* [12 - WEkEO Harmonized Data Access API](./10_data_access/12_WEkEO_harmonized_data_access_api.ipynb)
<br>
<div class="alert alert-block alert-success">
<b><a id='data_discovery'></a>20 - DATA DISCOVERY</b>
</div>
#### *Metop-A/B/C GOME-2 Level 2 and Level 3 data*
* [211 - Metop-A GOME-2 - Tropospheric NO<sub>2</sub> - Level 2 - Load and browse](./20_data_discovery/211_Metop-A_GOME-2_NO2Tropo_L2_load_browse.ipynb)
* [212 - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub> - Level 2 - Pre-process](./20_data_discovery/212_Metop-AB_GOME-2_NO2Tropo_L2_preprocess.ipynb)
* [213 - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub> - Level 3 - Load and browse](./20_data_discovery/213_Metop-AB_GOME-2_NO2Tropo_L3_load_browse.ipynb)
* [214 - Metop-A/B/C GOME-2 - Absorbing Aerosol Index - Level 3 - Load and browse](./20_data_discovery/214_Metop-ABC_GOME-2_AAI_L3_load_browse.ipynb)
#### *Polar Multi-Sensor Aerosol Optical Properties (PMAp) Level 2 data*
* [221 - Polar Multi-Sensor Aerosol Optical Properties (PMAp) - Aerosol Optical Depth - Level 2 - Load and browse](./20_data_discovery/221_PMAp_AOD_L2_load_browse.ipynb)
#### *Metop-A/B IASI Level 2 data*
* [231 - Metop-A/B IASI - Ammonia (NH<sub>3</sub>) - Level 2 - Load and browse](./20_data_discovery/231_Metop-AB_IASI_NH3_L2_load_browse.ipynb)
#### *Sentinel-5P TROPOMI Level 2 data*
* [241 - Sentinel-5P TROPOMI - Carbon Monoxide - Level 2 - Load and browse](./20_data_discovery/241_Sentinel-5P_TROPOMI_CO_L2_load_browse.ipynb)
#### *Sentinel-3 data*
* [251 - Sentinel-3 OLCI - Radiances - Level 1 - Load and browse](./20_data_discovery/251_Sentinel-3_OLCI_radiance_L1_load_browse.ipynb)
* [252 - Sentinel-3 SLSTR NRT - Fire Radiative Power (FRP) - Level 2 - Load and browse](./20_data_discovery/252_Sentinel-3_SLSTR_NRT_FRP_L2_load_browse.ipynb)
* [253 - Sentinel-3 SLSTR NRT - Aerosol Optical Depth (AOD) - Level 2 - Load and browse](./20_data_discovery/253_Sentinel-3_SLSTR_NRT_AOD_L2_load_browse.ipynb)
#### *Copernicus Atmosphere Monitoring Service (CAMS) data*
* [261 - CAMS Global reanalysis (EAC4) - Organic Matter Aerosol Optical Depth - Load and browse](./20_data_discovery/261_CAMS_EAC4_OMAOD_load_browse.ipynb)
* [262 - CAMS Global Fire Assimilation System (GFAS) - Fire Radiative Power - Load and browse](./20_data_discovery/262_CAMS_GFAS_FRPFIRE_load_browse.ipynb)
#### *Copernicus Emergency Management Service (CEMS) data*
* [271 - CEMS Global ECMWF Fire Forecast - Fire Weather Index - Load and browse](./20_data_discovery/271_CEMS_GEFF_FWI_load_browse.ipynb)
* [272 - CEMS Global ECMWF Fire Forecast - Fire Weather Index - Harmonized Danger Classes](./20_data_discovery/272_CEMS_GEFF_FWI_harmonized_danger_classes.ipynb)
* [273 - CEMS Global ECMWF Fire Forecast - Fire Weather Index - Custom Danger Classes](./20_data_discovery/273_CEMS_GEFF_FWI_custom_danger_classes.ipynb)
<br>
<div class="alert alert-block alert-warning">
<b><a id='case_studies'></a>30 - CASE STUDIES</b>
</div>
#### *Fires*
* [311 - Amazon fires 2019](./30_case_studies/311_fire_amazon_2019.ipynb)
* [312 - Siberian fires 2019](./30_case_studies/312_fire_siberia_2019.ipynb)
* [313 - Californian fires 2020](./30_case_studies/313_fire_california_2020.ipynb)
* [314 - Chernobly fires 2020 - Sentinel-3 SLSTR NRT - Fire Radiative Power](./30_case_studies/314_fire_chernobyl_2020_Sentinel-3_SLSTR_NRT_FRP_L2.ipynb)
* [315 - Californian fires 2020 - Sentinel-3 SLSTR NRT - Fire Radiative Power](./30_case_studies/315_fire_california_2020_Sentinel-3_SLSTR_NRT_FRP_L2.ipynb)
* [316 - Californian fires 2020 - Sentinel-3 SLSTR NRT - Aerosol Optical Depth](./30_case_studies/316_fire_california_2020_Sentinel-3_SLSTR_NRT_AOD_L2.ipynb)
#### *Air pollution*
* [321 - Map and time-series analysis - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub>](./30_case_studies/321_air_pollution_map_time-series_Metop-AB_GOME-2_NO2Tropo_L3.ipynb)
* [322 - Produce gridded dataset - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub>](./30_case_studies/322_air_pollution_produce_gridded_Metop-AB_GOME-2_NO2Tropo_L2.ipynb)
* [323 - Create an anomaly map - Europe - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub>](./30_case_studies/323_air_pollution_map_europe_2020_Metop-AB_GOME-2_NO2Tropo_L2.ipynb)
* [324 - Time-series analysis - Europe - Metop-A/B GOME-2 - Tropospheric NO<sub>2</sub>](./30_case_studies/324_air_pollution_time-series_europe_2020_Metop-AB_GOME-2_NO2Tropo_L2.ipynb)
* [325 - Create an anomaly map - Europe - Sentinel-5P TROPOMI - Tropospheric NO<sub>2</sub>](./30_case_studies/325_air_pollution_map_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb)
* [326 - Time-series analysis - Europe - Sentinel-5P TROPOMI - Tropospheric NO<sub>2</sub>](./30_case_studies/326_air_pollution_time-series_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb)
#### *Stratospheric Ozone*
* [331 - Antarctic ozone hole - Summer 2019](./30_case_studies/331_stratospheric_ozone_2019.ipynb)
* [332 - Antarctic ozone hole - CAMS animation - Summer 2019](./30_case_studies/332_stratospheric_ozone_animation_2019.ipynb)
* [331 - Antarctic ozone hole 2019 - Multi-data](./30_case_studies/331_stratospheric_ozone_Antarctic_2019.ipynb)
* [332 - Antarctic ozone hole 2019 - CAMS animation](./30_case_studies/332_stratospheric_ozone_Antarctic_2019_CAMS_EAC4_animation.ipynb)
* [333 - Antarctic ozone hole 2020 - Metop-A/B/C GOME-2 Level 2](./30_case_studies/333_stratospheric_ozone_Antarctic_2020_Metop-ABC_GOME-2_O3_L2.ipynb)
* [334 - Arctic ozone hole 2020 - Metop-A/B/C IASI Level 2 ](./30_case_studies/334_stratospheric_ozone_Arctic_2020_Metop-ABC_IASI_O3_L2.ipynb)
<br>
<div class="alert alert-block alert-danger">
<b><a id='exercises'></a>40 - EXERCISES</b>
</div>
#### *Sentinel-5P TROPOMI*
* [411 - Sentinel-5P TROPOMI - Carbon Monoxide - Level 2](./40_exercises/411_Sentinel-5P_TROPOMI_CO_L2_exercise.ipynb)
#### *Sentinel-3*
* [421 - Sentinel-3 OLCI - Radiances - Level 1](./40_exercises/421_Sentinel-3_OLCI_radiance_L1_exercise.ipynb)
* [422 - Sentinel-3 SLSTR NRT - Fire Radiative Power](./40_exercises/422_Sentinel-3_SLSTR_NRT_FRP_L2_exercise.ipynb)
* [423 - Sentinel-3 SLSTR NRT - Aerosol Optical Depth](./40_exercises/423_Sentinel-3_SLSTR_NRT_AOD_L2_exercise.ipynb)
#### *Copernicus Atmosphere Monitoring Service*
* [431 - CAMS Global Reanalysis (EAC4) - Total Column Carbon Monoxide](./40_exercises/431_CAMS_EAC4_tcco_exercise.ipynb)
#### *Metop-A/B/C GOME-2 and IASI*
* [441 - Metop-A/B/C GOME-2 - Ozone](./40_exercises/441_Metop-ABC_GOME-2_O3_L2_exercise.ipynb)
* [442 - Metop-A/B/C IASI - Ozone](./40_exercises/442_Metop-ABC_IASI_O3_L2_exercise.ipynb)
<br>
**NOTE:** Throughout the course, general functions to `load`, `re-shape`, `process` and `visualize` the datasets are defined. These functions are re-used when applicable. The [functions notebook](./functions.ipynb) gives you an overview of all the functions defined and used for the course.
If a notebook makes use of these functions, they are loaded as **helper functions** at the beginning of the notebook. With `?function_name`, you can load the function's docstring to see what it does and which keyword arguments the function requires.
See the example to load the docstring of the function [visualize_pcolormesh](./functions.ipynb#visualize_pcolormesh):
%% Cell type:code id: tags:
``` python
%run ./functions.ipynb
```
%% Cell type:code id: tags:
``` python
?visualize_pcolormesh
```
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
## Learning outcomes
%% Cell type:markdown id: tags:
The course is designed for `medium-level users`, who have basic Python knowledge and understanding of Atmospheric composition data.
After the course, you should have:
* an idea about the **different datasets on Atmospheric Composition data**,
* knowledge about the most useful **Python packages** to handle, process and visualise large volumes of Earth Observation data
* an idea about different **data application areas**
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
## Access to the `LTPy JupyterHub`
%% Cell type:markdown id: tags:
The course material is made available on a JupyterHub instance, a pre-defined environment that give learners direct access to the data and Python packages required for following the course.
The `JupyterHub` can be accessed as follows:
%% Cell type:markdown id: tags:
* Web address: [https://ltpy.adamplatform.eu](https://ltpy.adamplatform.eu)
* Create an account: [https://login.ltpy.adamplatform.eu/](https://login.ltpy.adamplatform.eu/)
* Log into the `JupyterHub` with your account created.
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
## Reproduce LTPy on Atmospheric Compostion data locally
%% Cell type:markdown id: tags:
In case you wish to reproduce the course modules on your local setup, the following Python version and Python packages will be required:
* Python version: **Python3.8**
* Python packages: see [requirements.txt](./requirements.txt)
Python packages can be installed as follows: `pip install -r requirements.txt`.
%% Cell type:markdown id: tags:
The `eodata` folder with all the data required for the training course can be accessed and downloaded from [https://sftp.eumetsat.int](https://sftp.eumetsat.int/login). Find the user name and password in order to be able to login [here](https://gitlab.eumetsat.int/eumetlab/atmosphere/atmosphere/-/blob/master/sftp_login.txt).
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
<p><img src='./img/copernicus_logo.png' align='left' alt='Logo EU Copernicus' width='25%'></img></p>
<br clear=left>
<p style="text-align:left;">This project is licensed under the <a href="./LICENSE">MIT License</a> <span style="float:right;"><a href="https://gitlab.eumetsat.int/eumetlab/atmosphere/atmosphere">View on GitLab</a> | <a href="https://training.eumetsat.int/">EUMETSAT Training</a>
......
......@@ -19,8 +19,8 @@
"metadata": {},
"source": [
"<a href=\"../00_index.ipynb\"><< Index</a><br>\n",
"<a href=\"./325_air_pollution_map_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb\"><< 325 - Sentinel-5P TROPOMI anomaly map</a><span style=\"float:right;\"><a href=\"./331_stratospheric_ozone_2019.ipynb\n",
"\">331 - Stratospheric Ozone 2019 >></a></span>"
"<a href=\"./325_air_pollution_map_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb\"><< 325 - Sentinel-5P TROPOMI anomaly map</a><span style=\"float:right;\"><a href=\"./331_stratospheric_ozone_Antarctic_2019.ipynb\n",
"\">331 - Stratospheric Ozone 2019 - Antarctic >></a></span>"
]
},
{
......@@ -2243,8 +2243,8 @@
"metadata": {},
"source": [
"<a href=\"../00_index.ipynb\"><< Index</a><br>\n",
"<a href=\"./325_air_pollution_map_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb\"><< 325 - Sentinel-5P TROPOMI anomaly map</a><span style=\"float:right;\"><a href=\"./331_stratospheric_ozone_2019.ipynb\n",
"\">331 - Stratospheric Ozone 2019 >></a></span>"
"<a href=\"./325_air_pollution_map_europe_2020_Sentinel-5P_TROPOMI_NO2Tropo_L2.ipynb\"><< 325 - Sentinel-5P TROPOMI anomaly map</a><span style=\"float:right;\"><a href=\"./331_stratospheric_ozone_Antarctic_2019.ipynb\n",
"\">331 - Stratospheric Ozone 2019 - Antarctic >></a></span>"
]
},
{
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
%% Cell type:markdown id: tags:
<img src='../img/EU-Copernicus-EUM_3Logos.png' alt='Logo EU Copernicus EUMETSAT' align='right' width='50%'></img>
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
<a href="../00_index.ipynb"><< Index</a><br>
<a href="./423_Sentinel-3_SLSTR_NRT_AOD_L2_exercise.ipynb"><< 423 - Sentinel-3 SLSTR NRT - AOD - Level 2 - Exercise</a>
<a href="./423_Sentinel-3_SLSTR_NRT_AOD_L2_exercise.ipynb"><< 423 - Sentinel-3 SLSTR NRT - AOD - Level 2 - Exercise</a><span style="float:right;"><a href="./441_Metop-ABC_GOME-2_O3_L2_exercise.ipynb">441 - Metop-A/B/C GOME-2 - Ozone - Level 2 - Exercise >></a></span>
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-danger">
<b>40 - EXERCISES</b>
</div>
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-danger">
<b>PREREQUISITES </b>
The following **20 - DATA DISCOVERY** module is a prerequisite:
- [261 - CAMS Global reanalysis (EAC4) - Organic Matter Aerosol Optical Depth - Load and browse](../20_data_discovery/261_CAMS_EAC4_OMAOD_load_browse.ipynb)
It is recommended to go through the module before you do this exercise workbook.
</div>
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
# 4.3.1 CAMS - Global reanalysis (EAC4) - Organic Matter AOD
%% Cell type:markdown id: tags:
The Copernicus Atmopshere Monitoring Service (CAMS) provides consistent and quality-controlled information related to air pollution and health and greenhouse gases. CAMS data consist of `global forecasts and analyses`, `global reanalyses (EAC4)`, `fire emissions` and `greenhouse gas flux inversions`.
This notebook is an `exercise workbook`, where you can practise the data handling with CAMS Global reanalysis (EAC4) data.
This notebook is an `exercise workbook`, where you can practise the data handling with CAMS Global reanalysis (EAC4) data.
%% Cell type:markdown id: tags:
### How it works
%% Cell type:markdown id: tags:
This exercise workbook consists of two types of exercises:
%% Cell type:markdown id: tags:
#### Coding assignments
Coding assignments ask you to fill an empty code cell with code.
You recognize `coding assignments` as the yellow-coloured boxes.
<div class="alert alert-block alert-warning">
<b>Coding assignment</b>
</div>
%% Cell type:markdown id: tags:
#### Questions
Questions ask you to reflect on a result and output. `Questions` are provided as green-coloured boxes.
<div class="alert alert-block alert-success">
<b>Question</b>
</div>
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
### Outline:
* [1 - Load and browse EAC4 reanalysis data](#load_browse)
* [2 - Bring longitude coordinates onto a [-180,180] grid](#shift)
* [3 - Retrieve the data variable total_colomn_carbon_monoxide as xarray.DataArray](#retrieve)
* [4 - Visualize total column carbon monoxide reanalysis data](#visualize)
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
#### Load required libraries
%% Cell type:code id: tags:
``` python
import os
import xarray as xr
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib.cm import get_cmap
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import cartopy.feature as cfeature
import warnings
warnings.simplefilter(action = "ignore", category = RuntimeWarning)
```
%% Cell type:markdown id: tags:
#### Load helper functions
%% Cell type:code id: tags:
``` python
%run ../functions.ipynb
```
%% Cell type:markdown id: tags:
<hr>
%% Cell type:markdown id: tags:
### <a id='load_browse'></a>Load and browse `EAC4 reanalysis` data
%% Cell type:markdown id: tags:
CAMS global reanalysis data is available either in `GRIB` or `netCDF`. The data for this example is available in `netCDF`. You can use xarray's function `xr.open_dataset()` to open the netCDF file as a xarray.Dataset.
%% Cell type:code id: tags:
``` python
file = xr.open_dataset('../eodata/cams/eac4/20191225-31_cams_eac4.nc')
file
```
%%%% Output: execute_result
<xarray.Dataset>
Dimensions: (latitude: 241, longitude: 480, time: 56)
Coordinates:
* longitude (longitude) float32 0.0 0.75 1.5 2.25 ... 357.0 357.8 358.5 359.2
* latitude (latitude) float32 90.0 89.25 88.5 87.75 ... -88.5 -89.25 -90.0
* time (time) datetime64[ns] 2019-12-25 ... 2019-12-31T21:00:00
Data variables:
omaod550 (time, latitude, longitude) float32 ...
aod550 (time, latitude, longitude) float32 ...
tcco (time, latitude, longitude) float32 ...
Attributes:
Conventions: CF-1.6
history: 2020-09-25 08:11:01 GMT by grib_to_netcdf-2.16.0: /opt/ecmw...
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-success">
<b>Question:</b><br>
Let us inspect the three dimensions (`latitude`, `longitude` and `time`) of the loaded file:
- What data variables does it contain and what `long_name` do they have?
</div>
%% Cell type:markdown id: tags:
You can retrieve the `long_name` of a data variable as follows: `file.omaod550.long_name` retrieves the long name of the `omaod550` variable.
The file contains three data variables:
* `omaod550`: Organic Matter Aerosol Optical Depth at 550nm
* `aod550`: Total Aerosol Optical Depth at 550nm
* `tcco`: Total column Carbon monoxide
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
### <a id='shift'></a>Bring longitude coordinates onto a [-180,180] grid
%% Cell type:markdown id: tags:
You can assign new values to coordinates in an xarray.Dataset. You can do so with the `assign_coords()` function from the xarray library, which you can apply onto an xarray.Dataset.
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-warning">
<b>Coding assignment:</b><br>
Enter below the code which re-assigns the longitude values from a [0,360] grid to a [-180,180] degrees grid.<br>
Inspect the newly assigned `longitude` coordinates afterwards and sort the longitude values in an ascending order.
<br>
**HINT:** <br>
You can use xarray's function `assign_coords()` for this operation.
</div>
%% Cell type:code id: tags:
``` python
# Enter your solution here
```
%% Cell type:code id: tags:
``` python
file_assigned = file.assign_coords(longitude=(((file.longitude + 180) % 360) - 180)).sortby('longitude')
file_assigned.longitude
```
%%%% Output: execute_result
<xarray.DataArray 'longitude' (longitude: 480)>
array([-180. , -179.25, -178.5 , ..., 177.75, 178.5 , 179.25],
dtype=float32)
Coordinates:
* longitude (longitude) float32 -180.0 -179.2 -178.5 ... 177.8 178.5 179.2
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
### <a id='data_retrieve'></a>Retrieve the data variable `total column carbon monoxide` as xarray.DataArray
%% Cell type:markdown id: tags:
Let us store the data variable `total column carbon monoxide` as xarray.DataArray with the name `tcco`.
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-warning">
<b>Coding assignment:</b><br>
Enter below the code that retrieves the data variable `tcco` (Total Column Carbon Monoxide). Call the resulting DataArray `tcco`.<br>
<br>
%% Cell type:code id: tags:
``` python
# Enter your solution here
```
%% Cell type:code id: tags:
``` python
tcco = file_assigned.tcco
tcco
```
%%%% Output: execute_result
<xarray.DataArray 'tcco' (time: 56, latitude: 241, longitude: 480)>
[6478080 values with dtype=float32]
Coordinates:
* longitude (longitude) float32 -180.0 -179.2 -178.5 ... 177.8 178.5 179.2
* latitude (latitude) float32 90.0 89.25 88.5 87.75 ... -88.5 -89.25 -90.0
* time (time) datetime64[ns] 2019-12-25 ... 2019-12-31T21:00:00
Attributes:
units: kg m**-2
long_name: Total column Carbon monoxide
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-success">
<b>Question:</b><br>
Can you identify the unit of the `tcco` variable?
</div>
%% Cell type:markdown id: tags:
The unit of the `total column carbon monoxide` variable is `kg m**-2`.
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-warning">
<b>Coding assignment:</b><br>
Retrieve `long_name`, `units`, `latitude` and `longitude` information from the `tcco` xarray.DataArray and store them as individual variables.<br>
<br>
%% Cell type:code id: tags:
``` python
# Enter your solution here
```
%% Cell type:code id: tags:
``` python
long_name = tcco.long_name
units = tcco.units
latitude = tcco.latitude
longitude = tcco.longitude
```
%% Cell type:markdown id: tags:
<br>
%% Cell type:markdown id: tags:
### <a id='visualize'></a>Visualize `total column carbon monoxide`
%% Cell type:markdown id: tags:
Let us visualize the dataset. You can use the function [visualize_pcolormesh](../functions.ipynb#visualize_pcolormesh), which makes use of matploblib's function `pcolormesh` and the [Cartopy](https://scitools.org.uk/cartopy/docs/latest/) library.
%% Cell type:markdown id: tags:
<div class="alert alert-block alert-warning">
<b>Coding assignment:</b><br>
Enter below the code that visualizes the `total column carbon monoxide` xarray.DataArray and make use of the following:
* the function [visualize_pcolormesh](../functions.ipynb#visualize_pcolormesh),