Skip to content

Rule build_cutout

Workflow Diagram

See the complete workflow in the repository.

digraph snakemake_dag { graph [bgcolor=white, margin=0, size="8,5" ]; node [fontname=sans, fontsize=10, penwidth=2, shape=box, style=rounded ]; edge [color=grey, penwidth=2 ]; 9 [color="0.22 0.6 0.85", label=build_renewable_profiles]; 10 [color="0.44 0.6 0.85", label=build_hydro_profile]; 13 [color="0.17 0.6 0.85", fillcolor=gray, label=build_cutout, style=filled]; 13 -> 9; 13 -> 10; }

Script Documentation

Create cutouts with atlite <https://atlite.readthedocs.io/en/latest/>_.

For this rule to work you must have

  • installed the Copernicus Climate Data Store <https://cds.climate.copernicus.eu>_ cdsapi package (install withpip``) and
  • registered and setup your CDS API key as described on their website <https://cds.climate.copernicus.eu/api-how-to>_. The CDS API allows an automatic filedownload by executing this script

.. seealso:: For details on the weather data read the atlite documentation <https://atlite.readthedocs.io/en/latest/>. If you need help specifically for creating cutouts the corresponding section in the atlite documentation <https://atlite.readthedocs.io/en/latest/examples/create_cutout.html> should be helpful.

Relevant Settings

.. code:: yaml

atlite:
    nprocesses:
    cutouts:
        {cutout}:

.. seealso:: Documentation of the configuration file config.yaml at :ref:atlite_cf

Inputs

None

Outputs

  • cutouts/{cutout}: weather data from either the ERA5 <https://www.ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era5> reanalysis weather dataset or SARAH-2 <https://wui.cmsaf.eu/safira/action/viewProduktSearch> satellite-based historic weather data with the following structure:

ERA5 cutout:

===================  ==========  ==========  =========================================================
Field                Dimensions  Unit        Description
===================  ==========  ==========  =========================================================
pressure             time, y, x  Pa          Surface pressure
-------------------  ----------  ----------  ---------------------------------------------------------
temperature          time, y, x  K           Air temperature 2 meters above the surface.
-------------------  ----------  ----------  ---------------------------------------------------------
soil temperature     time, y, x  K           Soil temperature between 1 meters and 3 meters
                                             depth (layer 4).
-------------------  ----------  ----------  ---------------------------------------------------------
influx_toa           time, y, x  Wm**-2      Top of Earth's atmosphere TOA incident solar radiation
-------------------  ----------  ----------  ---------------------------------------------------------
influx_direct        time, y, x  Wm**-2      Total sky direct solar radiation at surface
-------------------  ----------  ----------  ---------------------------------------------------------
runoff               time, y, x  m           `Runoff <https://en.wikipedia.org/wiki/Surface_runoff>`_
                                             (volume per area)
-------------------  ----------  ----------  ---------------------------------------------------------
roughness            y, x        m           Forecast surface roughness
                                             (`roughness length <https://en.wikipedia.org/wiki/Roughness_length>`_)
-------------------  ----------  ----------  ---------------------------------------------------------
height               y, x        m           Surface elevation above sea level
-------------------  ----------  ----------  ---------------------------------------------------------
albedo               time, y, x  --          `Albedo <https://en.wikipedia.org/wiki/Albedo>`_
                                             measure of diffuse reflection of solar radiation.
                                             Calculated from relation between surface solar radiation
                                             downwards (Jm**-2) and surface net solar radiation
                                             (Jm**-2). Takes values between 0 and 1.
-------------------  ----------  ----------  ---------------------------------------------------------
influx_diffuse       time, y, x  Wm**-2      Diffuse solar radiation at surface.
                                             Surface solar radiation downwards minus
                                             direct solar radiation.
-------------------  ----------  ----------  ---------------------------------------------------------
wnd100m              time, y, x  ms**-1      Wind speeds at 100 meters (regardless of direction)
===================  ==========  ==========  =========================================================

.. image:: /img/era5.png
    :width: 40 %

A SARAH-2 cutout can be used to amend the fields temperature, influx_toa, influx_direct, albedo, influx_diffuse of ERA5 using satellite-based radiation observations.

.. image:: /img/sarah.png
    :width: 40 %

Description