How to use GEOP4TH to generate figures ========================================== .. admonition:: Under development :class: important Scripts and documentation in progress... .. hint:: A broader overview of GEOP4TH graphical functionalities will be available at the :doc:`gallery<../5_gallery/gallery>` (*in progress*) Besides :doc:`preprocessing functionalities `, GEOP4TH provides graphical tools handy for checking on data prior or after preprocessing. - Quick graphical tools, such as extracting **timeseries** from netCDF maps, **comparing** maps or generating **animated** maps, are available in ``ncplot`` - Visualization of **aggregated timeseries** or **metrics** from **collections of datasets** can be done with ``trajplot`` - Tools specific to datasets can be further added to GEOP4TH (as for example ``SIM2_tools``) ncplot ------- .. hint:: *doc in progress* Trajplot ----------- .. admonition:: Under heavy development :class: important This script is undergoing major changes. This documentation refers to the latest version of the script (unstable). Required data ^^^^^^^^^^^^^^^ Download the SIM2 and EXPLORE2 datasets """""""""""""""""""""""""""""""""""""""" - https://www.data.gouv.fr/fr/datasets/donnees-changement-climatique-sim-quotidienne/ - https://www.drias-climat.fr/ - https://www.drias-eau.fr/ .. hint:: more details to come Figures ^^^^^^^^ Seasonality curves """""""""""""""""""""""""""""""""""""""" .. figure:: ../5_gallery/T_and_SWI_Lorient_projections_small.jpg :align: center Saisonnalité des températures et de l’indice d’humidité des sols (« |nbsp| SWI |nbsp| ») sur Lorient Agglomération. Ces moyennes sur 15 ans montrent le climat « |nbsp| normal |nbsp| » sur chaque période et son évolution sous l’effet du changement climatique. Les variations naturelles inter-annuelles, intrinsèques à la météo et au climat, sont illustrées par l’ombre grise . L’épaisseur des bandes orange et violette rend compte des « |nbsp| incertitudes de modélisation |nbsp| » liées à l’imperfection des modèles. Aux variabilités mentionnées s’ajoute enfin l’incertitude due aux choix d’aménagements du territoire et d’usages de l’eau. Les projections futures correspondent au scénario de teneur en gaz à effet de serre « |nbsp| RCP 8.5 |nbsp| », qui a été le plus à même de décrire notre trajectoire récente et qui, au vu des engagements actuels des états, continuera vraisemblablement de décrire avec pertinence les 25 prochaines années. Par soucis de lisibilité, les courbes sont moyennées sur 30 jours, sauf pour l’ombre grise. This type of figure is designed to show at a glance climate seasonality and its past and future evolutions. Compared to more classical representations of seasonal values, this type of figure in the form of an annual continuous timeseries highlights the **relationships between seasons**. *Is it warmer in May because summer comes earlier? Or because summer cover a longer period? Or because the seasons are more contrasted?* *Or because the temperature has risen in every season?* Considerations of this kind can be grasped here at first glance. This figure can be obtained with the following commands in the IDE: .. code-block:: python3 from geop4th import trajplot as tjp F = tjp.Figure( var = 'T', # temperature root_folder = "myDataPath", scenario = 'rcp8.5', coords = r"myMasks/myStudyArea.shp", ) F.plot( plot_type = 'temporality_mean', # 365-day curves period_years = [(2025, 2040), (2045, 2060)], # plot averages for specific periods rolling_days = 30, # additional smoothing step annuality = 3, # x-axis starts from March ) F.layout( filename = 'myAreaName.html', # or '.png' or '.svg'... language = 'en', plotsize = 'paper', color = 'discrete', # predefined colormap shadow = 'last', # for the last plotted period, the daily envelopp will be plotted ) Other example: .. figure:: ../5_gallery/DRAINC_Nive-Nivelle_rcp85_area_10y_30d_ms10_fr_small.gif :align: center Percolation at the bottom of the soil (SIM2) Illustration of the predicted evolution of the variable *DRAINC* (~recharge ~baseflow) from the `EXPLORE2-SIM2 dataset `_, under a RCP 8.5 scenario, over the catchments of Nive and Nivelle (Pays Basque). Obtained as follow: .. code-block:: python3 from geop4th import trajplot as tjp F = tjp.Figure( var = 'DRAINC', # ~recharge ~baseflow root_folder = "myDataPath", scenario = 'rcp8.5', coords = r"myMasks/Nive-Nivelle.shp", name = 'Nive-Nivelle', ) F.plot( plot_type = 'temporality', # 365-day curves period_years = 10, # plot 10-year averages rolling_days = 30, # additional smoothing step annuality = 10, # x-axis starts from October ) Metrics plots """""""""""""""""""""""""""""""""""""""" From the same data loading of the previous figure, it is possible to derive other types of figures. .. code-block:: python3 F.plot( plot_type = '>30', # number of days over 30°C # no need to repeat the previous arguments: # period_years = 15, # plot 15-year averages # rolling_days = 60, # additional smoothing step # annuality = 10, # x-axis starts from October ) # One wide version: F.export( name = 'myAreaName', language = 'en', plotsize = 'wide', ) # One smaller version: F.export( name = 'myAreaName', language = 'en', plotsize = 'paper', ) For instance : .. figure:: ../5_gallery/PRETOT_RCP85_MJJA_sum_inf_100_sum_bar_2periods_1d.png :align: center Likelihood to have a dry summer (precipitations < 100 mm over May-August) in two 20-year periods. *More details on data source* Obtained as follow: .. code-block:: python3 from geop4th import trajplot as tjp F = tjp.Figure( var = 'PRETOT', # total precipitations root_folder = r"", scenario = 'rcp8.5', coords = r"", ) F.plot( plot_type = 'MJJA_sum<100_sum', period_years = [(2005, 2025), (2060, 2080)], rolling_days = 1, # no data smoothing with rolling average annuality = 10, # periods go from october to september (hydrological year) repres = "bar", # cumul = False, # plotsize = "paper", # filename = r"" ) Visualizations for specific data ----------------------------------- It is possible in GOEP4TH to develop graphical tools specific to one dataset, and make them available in their own script in *graphics* folder. Interactive maps for SIM2 data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These interactive maps designed for |SIM2| data make it possible to explore the past climate trend period by period (using the cursor), while observing how the national scale articulates with the local scale (by zooming in). Many visualization modes are detailled below: - absolute values (annual, seasonal or by semester) - seasonal or by-semester values expressed as a percentage of annual values - values as a percentage of precipitations - values as difference to precipitations - deviation from reference period (1958-1970), and - deviations as percentages. .. figure:: ../5_gallery/SWI_annual_mean_cumdiff_preview_small.gif :align: center SWI decennal mean evolution Data are from MeteoFrance historical reanalysis (`SIM2 `_). .. hint:: *in progress...* .. |IDE| raw:: html IDE .. |SIM2| raw:: html SIM2 .. # define a hard line break for HTML .. |br| raw:: html
.. |nbsp| unicode:: 0xA0 :trim: