{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# More about areas and pyresample\n", "\n", "## Summary\n", "\n", "In this tutorial, we will learn more about defining areas to work with in pytroll/satpy, and how to save them for later use.\n", "\n", "## Defining Area Definitions\n", "\n", "The areas in pytroll/satpy are defined through the pyresample package.\n", "\n", "To define an area, have a look at the pyresample documentation:\n", "https://pyresample.readthedocs.io/en/latest/geo_def.html\n", "\n", "In this tutorial, we will create an area definition that covers Sweden, following the official SWEREF99TM.\n", "\n", "The projection to use is transverse mercator, with the following parameter:\n", "- reference longitude is 15\n", "- scale factor is 0.9996\n", "\n", "Sweden is included in a lon/lat box spanning approximately 10 to 25 degrees east and 55 to 70 degrees north. (If you're curious, look here: https://en.wikipedia.org/wiki/Geography_of_Sweden#Latitude_and_longitude)\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4.1\n", "Use pyproj to determine the area extent in projection coordinate of the bounding box.\n", "\n", "Pyproj documentation: https://jswhit.github.io/pyproj/\n", "\n", "The transverse mercator projection parameters https://proj4.org/operations/projections/tmerc.html" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4.2\n", "Create a pyresample AreaDefinition object using your computed parameters, with a resolution of ~1km" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4.3\n", "Resample your metop data on your newly defined area definition." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Saving the area\n", "The area definitions can be saved in yaml format. An `areas.yaml` file is provided in the satpy installation (https://github.com/pytroll/satpy/blob/feature-areas-yaml/satpy/etc/areas.yaml), but for areas you want to save, it is best to have an `areas.yaml` file in your working directory that will complete or replace the standard one. Alternatively, you can place your areas file in a directory pointed to by the `PPP_CONFIG_DIR` environment variable.\n", "To export the area you created, use the area's `create_areas_def` method." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 4.4\n", "Save the area you just defined into your own `areas.yaml` file. Resample your metop data using the saved area definition, ie by refering to it by name in the `scn.resample` call." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.6" } }, "nbformat": 4, "nbformat_minor": 2 }