Read-only mirror of https://github.com/MeteoSwiss-APN/plot_profile — MeteoSchweiz. Issues & pull requests at the source.
  • Python 82%
  • Makefile 16.3%
  • Shell 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-06-04 11:12:23 +02:00
.github initial commit 2021-09-30 16:54:28 +02:00
docs initial commit 2021-09-30 16:54:28 +02:00
example_graphs replaced grid_file with height_file 2022-10-13 12:25:46 +02:00
requirements completed requirements.txt 2021-12-08 08:48:14 +01:00
src/plot_profile Nicer docu, type hinting since python 3.8 2023-03-15 16:57:26 +01:00
tests/plot_profile initial commit 2021-09-30 16:54:28 +02:00
.bumpversion.cfg new version v0.1.1 (patch bump) 2022-02-01 12:33:38 +01:00
.gitignore added arome timeseries 2022-03-28 15:19:09 +02:00
.pre-commit-config.yaml fix pre-commit 2023-03-10 22:00:30 +01:00
AUTHORS.rst initial commit 2021-09-30 16:54:28 +02:00
CONTRIBUTING.rst initial commit 2021-09-30 16:54:28 +02:00
HISTORY.rst initial commit 2021-09-30 16:54:28 +02:00
LICENSE initial commit 2021-09-30 16:54:28 +02:00
Makefile Update Makefile 2022-10-17 07:41:25 +02:00
Makefile.conda.mk initial commit 2021-09-30 16:54:28 +02:00
Makefile.pip-venv.mk initial commit 2021-09-30 16:54:28 +02:00
MANIFEST.in initial commit 2021-09-30 16:54:28 +02:00
mypy.ini initial commit 2021-09-30 16:54:28 +02:00
plot_profile_crash_test.sh small test script to test all subpackages 2022-01-16 16:16:41 +01:00
pyproject.toml initial commit 2021-09-30 16:54:28 +02:00
README.rst Unmaintained 2024-06-03 15:35:25 +02:00
setup.py fix docu 2023-03-10 22:02:31 +01:00
tox.ini initial commit 2021-09-30 16:54:28 +02:00
USAGE.txt initial commit 2021-09-30 16:54:28 +02:00
VERSION new version v0.1.1 (patch bump) 2022-02-01 12:33:38 +01:00

$${\color{red} This \space repository \space is \space deprecated \space and \space unmaintained}$$


============
plot_profile
============

*plot_profile* is a Python-based command line tool to retrieve and visualise both observational data as well as variables simulated with ICON

.. contents:: **Content**

------------
Installation
------------
1. ``git clone https://github.com/MeteoSwiss-APN/plot_profile.git``
2. ``conda activate base``
3. ``conda install pip``
4. ``conda deactivate``
5. ``module load python``
6. ``cd plot_profile``
7. ``make venv install-dev`` (or just: ``install``)

-----
Usage
-----
This package only works on tsa, where access to the DWH is possible.
The package expects hourly output files in netcdf-format in a folder with the name corresponding to the init-time of the simulation, YYMMDDHH.
The filenames need to follow the MeteoSwiss-style convention: lfffDDHHMMSS.nc
(e.g. lfff00010000.nc corresponds to a model leadtime of +1h).

First activate the conda environment: ``conda activate plot_profile``.

The available entrypoints of the package can be displayed with: ``plot_profile -h``.
The available stations can be listed with: ``plot_profile --stations``.
The available variables can be listed with: ``plot_profile --variables``.

Further down you find example commands and corresponding graphs for each entrypoint.

Most important options
======================

- ``date``: Init or valid date. -> YYMMDDHH, except for radiosounding plots which include the full year.
- ``add_obs``: Observation, 2 arguments -> device, variable.
- ``add_model``: Simulated variable, 3 arguments -> model, variable, identifier.
- ``model_src``: Information about model -> identifier, folder, YYMMDDHH of simulation init.
- ``height_src``: File containing HEIGHT/HHL -> identifier, full path.
- ``height_file``: File containing HEIGHT/HHL -> full path.
- ``colours``: Matplotlib colour name -> one colour for each line, ordering does not necessarily follow user input.
- ``xmin``, ``xmax``, ``ymin``, ``ymax``: Min and max values for x- and y-axis.

plot_rs
=======
Plot radiosoundings

``plot_rs --date 2021111912 --params temp --params dewp_temp --alt_top 2500`` 

.. image:: example_graphs/rs_211119_12_temp_dewp_temp_pay.png
  :width: 400
  
``plot_rs --date 2022011112 --params temp --clouds --relhum_thresh 95 --grid``

.. image:: example_graphs/rs_220111_12_temp_pay.png
  :width: 400
  
``plot_rs --date 2022041912 --params temp --params dewp_temp --params wind_vel --params wind_dir``

.. image:: example_graphs/rs_220419_12_temp_dewp_temp_wind_vel_wind_dir_pay.png
  :width: 400
  
``plot_rs --date 2017101602 --params temp --params dewp_temp --loc inn``

.. image:: example_graphs/rs_171016_02_temp_dewp_temp_inn.png
  :width: 400
  
plot_profiles
=============
Compare vertical profiles of e.g. temperature measured by radiosounding and simulated by model *for 1 specific leadtime*.
``exp`` and ``ref`` serve as identifiers to connect an ``add_model``-statement to the ``model_src``.

- ``add_model``: *model variable identifier*

- ``model_src``: *identifier path date*

``plot_profiles --loc ifl --date 19091312 --add_model icon temp ref --add_model icon qv ref --model_src ref /store/s83/swester/teamx/tdf_2019091212/output/ 19091212 --height_src ref /store/s83/swester/teamx/tdf_2019091212/output/19091212/lfff00000000c.nc``

.. image:: example_graphs/profiles_190913_12_ifl_icon~ref_temp_qv.png
  :width: 300

``plot_profiles --loc pay --date 21111900 --add_obs rs temp --add_model icon temp ref --add_model icon temp exp --model_src ref /scratch/swester/output_icon/ICON-1/ 21111812 --model_src exp /scratch/swester/output_icon/exp1/ 21111812``

.. image:: example_graphs/profiles_211119_00_pay_icon~ref_temp_icon~exp_temp_rs_temp.png
  :width: 300
  
plot_timeseries
===============
Timeseries of 1 or multiple observed and/or modelled variables. The selected variables overall may not have more than 2 differing units.

! ``start`` of variables which are accumulated in ICON (radiation, precip) always has to match the init-date of the simulation

``plot_timeseries --loc ulr --start 19091212 --end 19091318 --add_obs 2m sw_down --add_model icon sw_down 1 exp --model_src exp  /store/s83/swester/teamx/tdf_2019091212/output/ 19091212 --height_file /store/s83/swester/teamx/tdf_2019091212/output/19091212/lfff00000000c.nc``

.. image:: example_graphs/timeseries_190912_12-190913_18_ulr_icon~exp_sw_down~1_2m_sw_down.png
  :width: 400
  
``plot_timeseries --loc pay --start 21111900 --end 21111912 --add_obs 2m ver_vis --add_obs 2m cbh``

.. image:: example_graphs/timeseries_211119_00-211119_12_pay_2m_ver_vis_2m_cbh.png
  :width: 400
  
``plot_timeseries --loc pay --start 21111900 --end 21111906 --add_model icon temp 1 ref --add_model icon temp 1 exp --add_obs 10m_tower temp --model_src ref /scratch/swester/output_icon/ICON-1/ 21111812 --model_src exp /scratch/swester/output_icon/exp1/ 21111812``

.. image:: example_graphs/timeseries_211119_00-211119_06_pay_icon~ref_temp~1_icon~exp_temp~1_10m_tower_temp.png
  :width: 400

plot_icon_profiles
==================
Plot profiles of 1 variable for multiple leadtimes. Option to add observations of the same variable for times where they are available.
It is possible to plot 2 different variables in 1 graph. If more than 2 variables are specified, 3 separate plots are created.


``plot_icon_profiles --date 17101512 --folder /store/s83/swester/teamx/cap_2017101512/output/ --var temp --leadtime 6 --leadtime 8 --leadtime 10 --leadtime 12 --leadtime 14 --height_file /store/s83/swester/teamx/cap_2017101512/output/17101512/lfff00000000c.nc --loc ifl``

.. image:: example_graphs/profile_icon-1_171015_12_+6_+14_ifl_temp.png
  :width: 300

``plot_icon_profiles --date 21111812 --folder /scratch/swester/output_icon/ICON-1/ --var qc --var qc_dia --leadtime 18  --loc pay``

.. image:: example_graphs/profile_icon-1_211118_12_+18_pay_qc_qc_dia.png
  :width: 300

``plot_icon_profiles --date 21111012 --folder /scratch/swester/output_icon/ICON-1/ --var qv --var temp --var qc --leadtime 12 --leadtime 13 --loc gre``

.. image:: example_graphs/profile_icon-1_211110_12_+12_+13_gre_temp.png
  :width: 300

  
plot_icon_heatmap
=================
Plot heatmaps (also called "time-height-crosssections") of modelled 3D variables. Optionally add cloud base height measured by ceilometers.

! for some reason currently not understood the start_leadtime is not correctly used on the x-axis, always use *--start_leadtime 0*

``plot_icon_heatmap --date 17101512 --folder /store/s83/swester/teamx/cap_2017101512/output/ --var temp --alt_top 2500 --start_leadtime 0 --end_leadtime 18 --loc ifl --height_file /store/s83/swester/teamx/cap_2017101512/output/17101512/lfff00000000c.nc``

.. image:: example_graphs/heatmap_icon-1_171015_12_+0_+18_ifl_temp.png
  :width: 500

``plot_icon_heatmap --date 21111812 --folder /scratch/swester/output_icon/ICON-1/ --var temp --alt_top 2000 --start_leadtime 0 --end_leadtime 12 --verbose``

.. image:: example_graphs/heatmap_icon-1_211118_12_+0_+12_pay_temp.png
  :width: 500

``plot_icon_heatmap --date 21111812 --folder /scratch/swester/output_icon/ICON-1/ --var clc --alt_top 2000 --start_leadtime 0 --end_leadtime 24 --add_cbh``

.. image:: example_graphs/heatmap_icon-1_211118_12_+0_+24_pay_clc.png
  :width: 500
  

-------
Credits
-------

This package was created with `Cookiecutter`_ and the `MeteoSwiss-APN/mch-python-blueprint`_ project template.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`MeteoSwiss-APN/mch-python-blueprint`: https://github.com/MeteoSwiss-APN/mch-python-blueprint