Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay map tutorial #25

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ quickly with pyaerocom.
- `Basic data analysis <getting_started_analysis.html>`__ | *getting_started_analysis.ipynb*
- `Using pyaerocom to create colocated data objects where colocation was done outside of pyaerocom <making_a_colocated_data_object_with_pyaerocom.html>`__ | *making_a_colocated_data_object_with_pyaerocom.ipynb*
- `Reading EMEP data into PyAerocom<intro_emep.html>`__ | *intro_emep.ipynb*
- `Using overlay (pixel) maps<overlay_maps.html>`__ | *overlay_maps.ipynb*


Evaluations
Expand Down
91 changes: 91 additions & 0 deletions overlay_maps.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using overlay plots (pixel maps)\n",
"Lewis Blake\n",
"[email protected]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we present a basic tutorial on how to add overlay plots (AKA pixel maps) to an evaluation on Aeroval. Pyaerocom offers both the ability to plot model and observations as pixel maps amd/or contour maps as of version 0.25.0. These selcetions can be made specific to each model and observation.\n",
lewisblake marked this conversation as resolved.
Show resolved Hide resolved
"\n",
"Let's say I have an evaluation where I want to compare EMEP model data with TROPOMI satellite data. Moreover, let's assume that the resolution of each of these data is so large that I do not want to have the standard Aeroval evaluation as that is computationally prohibitive. (Keep in mind that by default each collocated pixel is treated as a single station, and so all statistics are computed over th4ese `StationData` objects.) Rather, what I want is to just show the maps of both the EMEP and TROPOMI data. I need to make the following adjustments in my `CFG` dict.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# Model Maps\n",
"only_model_maps=True,\n",
thorbjoernl marked this conversation as resolved.
Show resolved Hide resolved
"pages = (\"maps\",), \n",
"plot_types={\n",
" \"TROPOMI\": [\"overlay\"],\n",
" \"EMEP\": [\"overlay\"],\n",
"},\n",
"boundaries={\"west\": -50, \"east\": 90, \"south\": 25.0, \"north\": 85.0},\n",
"right_menu = (\"TROPOMI\",),\n",
"overlay_save_format = \"png\",\n",
"maps_freq = \"monthly\", "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Explanation of these arguments:\n",
"\n",
"- `only_model_map=True`: tells pyaerocom to only produce maps and not do collocation\n",
"- `pages = (\"maps\",)`: tells the Aeroval webpage that the only page to show is the maps. corresponds to contents of `data/contour` in the pyaeroval output\n",
thorbjoernl marked this conversation as resolved.
Show resolved Hide resolved
"- `plot_types`: This is a dictionary where each key is a model or observation provided elsehwere in the config file, and the values are a list, set, or tuple, of the types of plots you which to have. THe options are `\"overlay\"` and `\"contour\"`. If not provided, the default is to make contour plots for all models.\n",
lewisblake marked this conversation as resolved.
Show resolved Hide resolved
"- `boundaries`: Can be passed as a dictionary but is of type `BoundingBox`. Keys are `\"west\"`, `\"east\"`, `\"north\"`, `\"south\"` and the values are the bounding box edges in degrees. Note that this must be consistent across all models and observation networks.\n",
"- `right_menu`: Tell Aeroval which of the model or observations to play in the right menu when comparing the maps. In this case the EMEP model maps will appear on the left and the TROPOMI data will appear on the right.\n",
thorbjoernl marked this conversation as resolved.
Show resolved Hide resolved
"- `overlay_save_format`: Overlay maps can be saved as wither png files or webp files. The options are `\"webp\"` and `\"png\"` and the default is `\"webp\"`.\n",
thorbjoernl marked this conversation as resolved.
Show resolved Hide resolved
"- `maps_freq`: This is the frequency of which to sample the data the make the maps, either overlay or contour. The default is `\"coarsest\"`, but it is recommended to set this explictly.\n",
"\n",
"\n",
"NB: Pyaerocom will save overlay maps in grayscale, and then Aeroval will apply color to them dynamically on the web."
lewisblake marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}