wolfhece.irm_qdf

Author: HECE - University of Liege, Pierre Archambeau Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

wolfhece.irm_qdf.Montana_a1 = 'a1'[source]
wolfhece.irm_qdf.Montana_a2 = 'a2'[source]
wolfhece.irm_qdf.Montana_a3 = 'a3'[source]
wolfhece.irm_qdf.Montana_b1 = 'b1'[source]
wolfhece.irm_qdf.Montana_b2 = 'b2'[source]
wolfhece.irm_qdf.Montana_b3 = 'b3'[source]
wolfhece.irm_qdf.RT2 = '2'[source]
wolfhece.irm_qdf.RT5 = '5'[source]
wolfhece.irm_qdf.RT10 = '10'[source]
wolfhece.irm_qdf.RT15 = '15'[source]
wolfhece.irm_qdf.RT20 = '20'[source]
wolfhece.irm_qdf.RT25 = '25'[source]
wolfhece.irm_qdf.RT30 = '30'[source]
wolfhece.irm_qdf.RT40 = '40'[source]
wolfhece.irm_qdf.RT50 = '50'[source]
wolfhece.irm_qdf.RT75 = '75'[source]
wolfhece.irm_qdf.RT100 = '100'[source]
wolfhece.irm_qdf.RT200 = '200'[source]
wolfhece.irm_qdf.RT[source]
wolfhece.irm_qdf.freqdep[source]
wolfhece.irm_qdf.freqndep[source]
wolfhece.irm_qdf.dur10min = '10 min'[source]
wolfhece.irm_qdf.dur20min = '20 min'[source]
wolfhece.irm_qdf.dur30min = '30 min'[source]
wolfhece.irm_qdf.dur1h = '1 h'[source]
wolfhece.irm_qdf.dur2h = '2 h'[source]
wolfhece.irm_qdf.dur3h = '3 h'[source]
wolfhece.irm_qdf.dur6h = '6 h'[source]
wolfhece.irm_qdf.dur12h = '12 h'[source]
wolfhece.irm_qdf.dur1d = '1 d'[source]
wolfhece.irm_qdf.dur2d = '2 d'[source]
wolfhece.irm_qdf.dur3d = '3 d'[source]
wolfhece.irm_qdf.dur4d = '4 d'[source]
wolfhece.irm_qdf.dur5d = '5 d'[source]
wolfhece.irm_qdf.dur7d = '7 d'[source]
wolfhece.irm_qdf.dur10d = '10 d'[source]
wolfhece.irm_qdf.dur15d = '15 d'[source]
wolfhece.irm_qdf.dur20d = '20 d'[source]
wolfhece.irm_qdf.dur25d = '25 d'[source]
wolfhece.irm_qdf.dur30d = '30 d'[source]
wolfhece.irm_qdf.durationstext[source]
wolfhece.irm_qdf.durations[source]
wolfhece.irm_qdf.durationsd[source]
wolfhece.irm_qdf.durations[source]
class wolfhece.irm_qdf.MontanaIRM(coeff: pandas.DataFrame, time_bounds=None)[source]

Classe pour la gestion des relations de Montana pour les précipitations

get_ab(dur, T)[source]

Get the Montana coefficients for a given duration and return period

Parameters:
  • dur – the duration

  • T – the return period

get_meanrain(dur, T, ab=None)[source]

Get the mean rain for a given duration and return period

Parameters:
  • dur – the duration

  • T – the return period

  • ab – the Montana coefficients

get_instantrain(dur, T, ab=None)[source]

Get the instantaneous rain for a given duration and return period

Parameters:
  • dur – the duration

  • T – the return period

  • ab – the Montana coefficients

get_Q(dur, T)[source]

Get the quantity of rain for a given duration and return period

Parameters:
  • dur – the duration

  • T – the return period

get_hyeto(durmax, T, r=0.5)[source]

Get the hyetogram for a given return period

Parameters:
  • durmax – the maximum duration of the hyetogram

  • T – the return period

  • r – Decentration coefficient

plot_hyeto(durmax, T, r=0.5)[source]

Plot the hyetogram for a given return period

Parameters:
  • durmax – the maximum duration of the hyetogram

  • T – the return period

  • r – Decentration coefficient

plot_hyetos(durmax, r=0.5)[source]

Plot the hyetograms for all return periods

Parameters:
  • durmax – the maximum duration of the hyetograms

  • r – Decentration coefficient

class wolfhece.irm_qdf.Qdf_IRM(store_path='irm', code: int = 0, name='', force_import=False, ins: Literal[2018, 2019, 2025, 2018, 2019, 2025] = 2018, localities: wolfhece.ins.Localities = None)[source]

Gestion des relations QDF calculées par l’IRM

Exemple d’utilisation :

Pour importer les fichiers depuis le site web de l’IRM meteo.be from wolfhece.irm_qdf import Qdf_IRM qdf = Qdf_IRM(force_import=True) qdf =

Il est possible de spécifier le répertoire de stockage des fichiers Excel Par défaut, il s’agit d’un sous-répertoire ‘irm’ du répertoire courant qui sera créé s’il n’exsiste pas

Une fois importé/téléchargé, il est possible de charger une commune sur base de l’INS ou de son nom

myqdf = Qdf_IRM(name=’Jalhay’)

Les données sont ensuite disponibles dans les propriétés, qui sont des “dataframes” pandas (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) :

  • qdf : les relation Quantité/durée/fréquence

  • standarddev : l’écart-type de l’erreur

  • confintlow : la valeur inférieure de l’intervalle de confiance (-2*stddev)

  • confintup : la valeur supérieure de l’intervalle de confiance (+2*stddev)

  • montanacoeff : les coeffciients de Montana

Il est par exemple possible d’accéder aux coefficients de Montana via l’une de ces lignes ou une combinaison :

display(myqdf.montanacoeff) rt = myqdf.montanacoeff.index display(myqdf.montanacoeff.loc[rt[0]]) display(myqdf.montanacoeff.iloc[0]) display(myqdf.get_Montanacoeff(qdf.RT2))

property name[source]
property code[source]
property code_name[source]
property name_code[source]
export_allmontana2xls()[source]

Export all Montana coefficients to an Excel file

classmethod importfromwebsite(store_path='irm', verbose: bool = False, waitingtime: float = 0.01, ins: Literal[2018, 2019, 2025, 2018, 2019, 2025] = 2018)[source]

Import Excel files for all municipalities from the IRM website

Parameters:
  • store_path – Where to store the downloaded data. Directory will be created if it doesn’t exists.

  • verbose – If True, will print some progress information. If False, will do nothing. If a callable, then will call it with a float in [0, 1]. 0 means nothing downloaded, 1 means everything downloaded.

  • waitingtime – How long to wait (in seconds) betwenn the download of each station (will make sure we don’t overwhelm IRM’s website).

  • ins – The year of the INS codes to use.

ins_read_excel(code='', name='')[source]

Lecture des caractéristiques d’une commune depuis le fichier Excel associé au code INS

classmethod convert_xls2csv(store_path='irm', ins: Literal[2018, 2019, 2025, 2018, 2019, 2025] = 2018)[source]

Convert all Excel files to JSON files

Parameters:
  • store_path – Where to store the downloaded data. Directory will be created if it doesn’t exists.

  • ins – The year of the INS codes to use.

plot_idf(T=None, which='All', color=[27.0 / 255.0, 136.0 / 255.0, 245.0 / 255.0])[source]

Plot IDF relations on a new figure

:param T : the return period (based on RT constants) :param which : information to plot

  • ‘Montana’

  • ‘QDFTable’

  • ‘All’

plot_qdf(T=None, which='All', color=[27.0 / 255.0, 136.0 / 255.0, 245.0 / 255.0])[source]

Plot QDF relations on a new figure :param T : the return period (based on RT constants) :param which : information to plot

  • ‘Montana’

  • ‘QDFTable’

  • ‘All’

plot_cdf(dur=None)[source]

Plot the cdf of the QDF data for a given duration

fit_all()[source]

Fit all durations with a Generalized Extreme Value distribution

save_fits_json()[source]

Save the fits in a csv file

load_fits_json()[source]

Load the fits from a json file

fit_cdf(dur=None, plot=False)[source]

Fit the cdf of the QDF data with a Generalized Extreme Value distribution

Parameters:
  • dur – the duration to fit

  • plot – if True, will plot the cdf with the fit

get_Tfromrain(Q, dur=dur1h)[source]

Get the return period for a given quantity of rain

Parameters:
  • Q – the quantity of rain

  • dur – the duration

get_rainfromT(T, dur=dur1h)[source]

Get the quantity of rain for a given return period and duration

Parameters:
  • T – the return period

  • dur – the duration

get_MontanacoeffforT(return_period)[source]

Get the Montana coefficients for a given return period

Parameters:

return_period – the return period

plot_hyeto(durmax, T, r=0.5)[source]

Plot the hyetogram for a given return period

Parameters:
  • durmax – the maximum duration of the hyetogram

  • T – the return period

  • r – the decentration coefficient

plot_hyetos(durmax, r=0.5)[source]

Plot the hyetograms for all return periods

Parameters:
  • durmax – the maximum duration of the hyetograms

  • r – the decentration coefficient

class wolfhece.irm_qdf.QDF_Belgium(store_path='irm', ins: Literal[2018, 2019, 2025, 2018, 2019, 2025] = 2018)[source]