text stringlengths 81 112k |
|---|
Configure the |SequenceManager| object available in module
|pub| following the definitions of the actual XML `reader` or
`writer` element when available; if not use those of the XML
`series_io` element.
Compare the following results with `single_run.xml` to see that the
first `w... |
A nested |collections.defaultdict| containing the model specific
information provided by the XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> series_io ... |
A |collections.defaultdict| containing the node-specific
information provided by XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> series_io = interface.... |
Call |IOSequence.activate_ram| of all sequences selected by
the given output element of the actual XML file.
Use the memory argument to pass in already prepared sequences;
newly prepared sequences will be added.
>>> from hydpy.core.examples import prepare_full_example_1
>>> pre... |
Load time series data as defined by the actual XML `reader`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
>>> with TestIO():
... hp.p... |
Save time series data as defined by the actual XML `writer`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
>>> with TestIO():
... hp.p... |
ToDo
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface, pub
>>> hp = HydPy('LahnH')
>>> pub.timegrids = '1996-01-01', '1996-01-06', '1d'
>>> with TestIO():
... hp.prepare... |
Write the complete base schema file `HydPyConfigBase.xsd` based
on the template file `HydPyConfigBase.xsdt`.
Method |XSDWriter.write_xsd| adds model specific information to the
general information of template file `HydPyConfigBase.xsdt` regarding
reading and writing of time series data ... |
Return a sorted |list| containing all application model names.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS
[...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...]
def get_modelnames() -> List[str]:
"""Return a ... |
Return the complete string to be inserted into the string of the
template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_insertion()) # doctest: +ELLIPSIS
<element name="arma_v1"
substitutionGroup="hpcb:sequenceGroup"
... |
Return the insertion string required for the given application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_modelinsertion(model, 1)) # doctest: +ELLIPSIS
<element nam... |
Return the insertion string required for the given group of
sequences.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_subsequencesinsertion(
... model.sequences.fluxes, 1... |
Return the complete string related to the definition of exchange
items to be inserted into the string of the template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_exchangeinsertion()) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathitemType">
... |
Return a string defining a model specific XML type extending
`ItemType`.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_mathitemsinsertion(1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathitemType">
<complexContent>
... |
Return a string defining the XML element for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemsinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<element name="setitems">
<complexType>
... |
Return a string defining the required types for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypesinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_setitemsType">
...
... |
Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypeinsertion(
... 'setitems', 'hland_v1', 1)) # doctest: +ELLIPSIS
<com... |
Return a string defining the required types for the given
combination of an exchange item group and |Node| objects.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_nodesitemtypeinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<complexType name... |
Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_subgroupsiteminsertion(
... 'setitems', 'hland_v1', 1)) # doctest: +ELLIPSIS
... |
Return a string defining the required types for the given
combination of an exchange item group and a specific variable
subgroup of an application model or class |Node|.
Note that for `setitems` and `getitems` `setitemType` and
`getitemType` are referenced, respectively, and for all oth... |
Create a new mask object based on the given |numpy.ndarray|
and return it.
def array2mask(cls, array=None, **kwargs):
"""Create a new mask object based on the given |numpy.ndarray|
and return it."""
kwargs['dtype'] = bool
if array is None:
return numpy.ndarray.__new_... |
Return a new |DefaultMask| object associated with the
given |Variable| object.
def new(cls, variable, **kwargs):
"""Return a new |DefaultMask| object associated with the
given |Variable| object."""
return cls.array2mask(numpy.full(variable.shape, True)) |
Return a new |IndexMask| object of the same shape as the
parameter referenced by |property| |IndexMask.refindices|.
Entries are only |True|, if the integer values of the
respective entries of the referenced parameter are contained
in the |IndexMask| class attribute tuple `RELEVANT_VALUES... |
A |list| of all currently relevant indices, calculated as an
intercection of the (constant) class attribute `RELEVANT_VALUES`
and the (variable) property |IndexMask.refindices|.
def relevantindices(self) -> List[int]:
"""A |list| of all currently relevant indices, calculated as an
inter... |
Determine the reference discharge within the given space-time interval.
Required state sequences:
|QZ|
|QA|
Calculated flux sequence:
|QRef|
Basic equation:
:math:`QRef = \\frac{QZ_{new}+QZ_{old}+QA_{old}}{3}`
Example:
>>> from hydpy.models.lstream import *
>... |
Determine the actual traveling time of the water (not of the wave!).
Required derived parameter:
|Sek|
Required flux sequences:
|AG|
|QRef|
Calculated flux sequence:
|RK|
Basic equation:
:math:`RK = \\frac{Laen \\cdot A}{QRef}`
Examples:
First, note that t... |
Calculate the flown through area and the wetted perimeter
of the main channel.
Note that the main channel is assumed to have identical slopes on
both sides and that water flowing exactly above the main channel is
contributing to |AM|. Both theoretical surfaces seperating water
above the main chann... |
Calculate the discharge of the main channel after Manning-Strickler.
Required control parameters:
|EKM|
|SKM|
|Gef|
Required flux sequence:
|AM|
|UM|
Calculated flux sequence:
|lstream_fluxes.QM|
Examples:
For appropriate strictly positive values:
... |
Calculate the flown through area and the wetted perimeter of both
forelands.
Note that the each foreland lies between the main channel and one
outer embankment and that water flowing exactly above the a foreland
is contributing to |AV|. The theoretical surface seperating water
above the main chann... |
Calculate the discharge of both forelands after Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AV|
|UV|
Calculated flux sequence:
|lstream_fluxes.QV|
Examples:
For appropriate strictly positive values:
... |
Calculate the flown through area and the wetted perimeter of both
outer embankments.
Note that each outer embankment lies beyond its foreland and that all
water flowing exactly above the a embankment is added to |AVR|.
The theoretical surface seperating water above the foreland from water
above its... |
Calculate the discharge of both outer embankments after
Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AVR|
|UVR|
Calculated flux sequence:
|QVR|
Examples:
For appropriate strictly positive values:
... |
Sum the through flown area of the total cross section.
Required flux sequences:
|AM|
|AV|
|AVR|
Calculated flux sequence:
|AG|
Example:
>>> from hydpy.models.lstream import *
>>> parameterstep()
>>> fluxes.am = 1.0
>>> fluxes.av= 2.0, 3.0
>... |
Calculate the discharge of the total cross section.
Method |calc_qg_v1| applies the actual versions of all methods for
calculating the flown through areas, wetted perimeters and discharges
of the different cross section compartments. Hence its requirements
might be different for various application mo... |
Determine an starting interval for iteration methods as the one
implemented in method |calc_h_v1|.
The resulting interval is determined in a manner, that on the
one hand :math:`Qmin \\leq QRef \\leq Qmax` is fulfilled and on the
other hand the results of method |calc_qg_v1| are continuous
for :math... |
Approximate the water stage resulting in a certain reference discarge
with the Pegasus iteration method.
Required control parameters:
|QTol|
|HTol|
Required flux sequence:
|QRef|
Modified aide sequences:
|HMin|
|HMax|
|QMin|
|QMax|
Calculated flux sequen... |
Calculate outflow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required flux sequence:
|RK|
Required state sequence:
|QZ|
Updated state sequence:
|QA|
... |
Update inflow.
def pick_q_v1(self):
"""Update inflow."""
sta = self.sequences.states.fastaccess
inl = self.sequences.inlets.fastaccess
sta.qz = 0.
for idx in range(inl.len_q):
sta.qz += inl.q[idx][0] |
Update outflow.
def pass_q_v1(self):
"""Update outflow."""
sta = self.sequences.states.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += sta.qa |
Adjust the measured air temperature to the altitude of the
individual zones.
Required control parameters:
|NmbZones|
|TCAlt|
|ZoneZ|
|ZRelT|
Required input sequence:
|hland_inputs.T|
Calculated flux sequences:
|TC|
Basic equation:
:math:`TC = T - TCAlt \... |
Calculate the areal mean temperature of the subbasin.
Required derived parameter:
|RelZoneArea|
Required flux sequence:
|TC|
Calculated flux sequences:
|TMean|
Examples:
Prepare two zones, the first one being twice as large
as the second one:
>>> from hydp... |
Determine the temperature-dependent fraction of (liquid) rainfall
and (total) precipitation.
Required control parameters:
|NmbZones|
|TT|,
|TTInt|
Required flux sequence:
|TC|
Calculated flux sequences:
|FracRain|
Basic equation:
:math:`FracRain = \\frac{TC-(T... |
Calculate the corrected fractions rainfall/snowfall and total
precipitation.
Required control parameters:
|NmbZones|
|RfCF|
|SfCF|
Calculated flux sequences:
|RfC|
|SfC|
Basic equations:
:math:`RfC = RfCF \\cdot FracRain` \n
:math:`SfC = SfCF \\cdot (1 - Frac... |
Apply the precipitation correction factors and adjust precipitation
to the altitude of the individual zones.
Required control parameters:
|NmbZones|
|PCorr|
|PCAlt|
|ZoneZ|
|ZRelP|
Required input sequence:
|P|
Required flux sequences:
|RfC|
|SfC|
C... |
Adjust potential norm evaporation to the actual temperature.
Required control parameters:
|NmbZones|
|ETF|
Required input sequence:
|EPN|
|TN|
Required flux sequence:
|TMean|
Calculated flux sequences:
|EP|
Basic equation:
:math:`EP = EPN \\cdot (1 + ET... |
Apply the evaporation correction factors and adjust evaporation
to the altitude of the individual zones.
Calculate the areal mean of (uncorrected) potential evaporation
for the subbasin, adjust it to the individual zones in accordance
with their heights and perform some corrections, among which one
... |
Calculate throughfall and update the interception storage
accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
|IcMax|
Required flux sequences:
|PC|
Calculated fluxes sequences:
|TF|
Updated state sequence:
|Ic|
Basic equation:
:math:`TF ... |
Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|EPC|
Calculated fluxes sequences:
|EI|
Updated state sequence:
|Ic|
Basic equation:
:math:`EI ... |
Add throughfall to the snow layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|TF|
|RfC|
|SfC|
Updated state sequences:
|WC|
|SP|
Basic equations:
:math:`\\frac{dSP}{dt} = TF \\cdot \\frac{SfC}{SfC+RfC}` \n
:math:... |
Calculate refreezing of the water content within the snow layer and
update both the snow layers ice and the water content.
Required control parameters:
|NmbZones|
|ZoneType|
|CFMax|
|CFR|
Required derived parameter:
|TTM|
Required flux sequences:
|TC|
Calculat... |
Calculate the actual water release from the snow layer due to the
exceedance of the snow layers capacity for (liquid) water.
Required control parameters:
|NmbZones|
|ZoneType|
|WHC|
Required state sequence:
|SP|
Required flux sequence
|TF|
Calculated fluxes sequence... |
Calculate melting from glaciers which are actually not covered by
a snow layer and add it to the water release of the snow module.
Required control parameters:
|NmbZones|
|ZoneType|
|GMelt|
Required state sequence:
|SP|
Required flux sequence:
|TC|
Calculated fluxes... |
Calculate effective precipitation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|Beta|
Required fluxes sequence:
|In_|
Calculated flux sequence:
|R|
Updated state sequence:
|SM|
Basic equations:
:math:`\\frac{dS... |
Calculate capillary flow and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|CFlux|
Required fluxes sequence:
|R|
Required state sequence:
|UZ|
Calculated flux sequence:
|CF|
Updated state sequence:
|SM|
Basic e... |
Calculate soil evaporation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|LP|
|ERed|
Required fluxes sequences:
|EPC|
|EI|
Required state sequence:
|SP|
Calculated flux sequence:
|EA|
Updated state sequenc... |
Accumulate the total inflow into the upper zone layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandZoneArea|
Required fluxes sequences:
|R|
|CF|
Calculated flux sequence:
|InUZ|
Basic equation:
:math:`InUZ = R... |
Determine the relative size of the contributing area of the whole
subbasin.
Required control parameters:
|NmbZones|
|ZoneType|
|RespArea|
|FC|
|Beta|
Required derived parameter:
|RelSoilArea|
Required state sequence:
|SM|
Calculated fluxes sequences:
... |
Perform the upper zone layer routine which determines percolation
to the lower zone layer and the fast response of the hland model.
Note that the system behaviour of this method depends strongly on the
specifications of the options |RespArea| and |RecStep|.
Required control parameters:
|RecStep|
... |
Update the lower zone layer in accordance with percolation from
upper groundwater to lower groundwater and/or in accordance with
lake precipitation.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandArea|
|RelZoneArea|
Required fluxes ... |
Calculate lake evaporation.
Required control parameters:
|NmbZones|
|ZoneType|
|TTIce|
Required derived parameters:
|RelZoneArea|
Required fluxes sequences:
|TC|
|EPC|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ... |
Calculate the slow response of the lower zone layer.
Required control parameters:
|K4|
|Gamma|
Calculated fluxes sequence:
|Q1|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ}{dt} = -Q1` \n
:math:`Q1 = \\Bigl \\lbrace
{
... |
Calculate the unit hydrograph input.
Required derived parameters:
|RelLandArea|
Required flux sequences:
|Q0|
|Q1|
Calculated flux sequence:
|InUH|
Basic equation:
:math:`InUH = Q0 + Q1`
Example:
The unit hydrographs receives base flow from the whole sub... |
Calculate the unit hydrograph output (convolution).
Required derived parameters:
|UH|
Required flux sequences:
|Q0|
|Q1|
|InUH|
Updated log sequence:
|QUH|
Calculated flux sequence:
|OutUH|
Examples:
Prepare a unit hydrograph with only th... |
Calculate the total discharge after possible abstractions.
Required control parameter:
|Abstr|
Required flux sequence:
|OutUH|
Calculated flux sequence:
|QT|
Basic equation:
:math:`QT = max(OutUH - Abstr, 0)`
Examples:
Trying to abstract less then available, a... |
Save all defined auxiliary control files.
The target path is taken from the |ControlManager| object stored
in module |pub|. Hence we initialize one and override its
|property| `currentpath` with a simple |str| object defining the
test target path:
>>> from hydpy import pub
... |
Remove the defined variables.
The variables to be removed can be selected in two ways. But the
first example shows that passing nothing or an empty iterable to
method |Variable2Auxfile.remove| does not remove any variable:
>>> from hydpy import dummies
>>> v2af = dummies.v2af
... |
A list of all handled auxiliary file names.
>>> from hydpy import dummies
>>> dummies.v2af.filenames
['file1', 'file2']
def filenames(self):
"""A list of all handled auxiliary file names.
>>> from hydpy import dummies
>>> dummies.v2af.filenames
['file1', 'file2... |
Return the auxiliary file name the given variable is allocated
to or |None| if the given variable is not allocated to any
auxiliary file name.
>>> from hydpy import dummies
>>> eqb = dummies.v2af.eqb[0]
>>> dummies.v2af.get_filename(eqb)
'file1'
>>> eqb += 500.0
... |
Calculate the smoothing parameter values.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy import pub
>>> pub.timegrids = '2000.01.01', '2000.01.03', '1d'
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> remoted... |
Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> waterlevelminimumremotetolerance(0.0)
>>> derived.waterlevelminimumremotesmoothpar.update()
... |
Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> highestremotedischarge(1.0)
>>> highestremotetolerance(0.0)
>>> derived.highestremotesm... |
Execute the given command in a new process.
Only when both `verbose` and `blocking` are |True|, |run_subprocess|
prints all responses to the current value of |sys.stdout|:
>>> from hydpy import run_subprocess
>>> import platform
>>> esc = '' if 'windows' in platform.platform().lower() else '\\\\'
... |
Execute the given Python commands.
Function |exec_commands| is thought for testing purposes only (see
the main documentation on module |hyd|). Seperate individual commands
by semicolons and replaced whitespaces with underscores:
>>> from hydpy.exe.commandtools import exec_commands
>>> import sys
... |
Prepare an empty log file eventually and return its absolute path.
When passing the "filename" `stdout`, |prepare_logfile| does not
prepare any file and just returns `stdout`:
>>> from hydpy.exe.commandtools import prepare_logfile
>>> prepare_logfile('stdout')
'stdout'
When passing the "filen... |
Execute a HydPy script function.
Function |execute_scriptfunction| is indirectly applied and
explained in the documentation on module |hyd|.
def execute_scriptfunction() -> None:
"""Execute a HydPy script function.
Function |execute_scriptfunction| is indirectly applied and
explained in the docum... |
Return a single value for a string understood as a positional
argument or a |tuple| containing a keyword and its value for a
string understood as a keyword argument.
|parse_argument| is intended to be used as a helper function for
function |execute_scriptfunction| only. See the following
examples ... |
Print the given string and the current date and time with high
precision for logging purposes.
>>> from hydpy.exe.commandtools import print_textandtime
>>> from hydpy.core.testtools import mock_datetime_now
>>> from datetime import datetime
>>> with mock_datetime_now(datetime(2000, 1, 1, 12, 30, 0,... |
Write the given string as explained in the main documentation
on class |LogFileInterface|.
def write(self, string: str) -> None:
"""Write the given string as explained in the main documentation
on class |LogFileInterface|."""
self.logfile.write('\n'.join(
f'{self._string}{su... |
Solve the differential equation of HydPy-L.
At the moment, HydPy-L only implements a simple numerical solution of
its underlying ordinary differential equation. To increase the accuracy
(or sometimes even to prevent instability) of this approximation, one
can set the value of parameter |MaxDT| to a va... |
Calculate the auxiliary term.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Required aide sequence:
|llake_aides.V|
Calculated aide sequence:
|llake_aides.VQ|
Basic equation:
:math:`VQ = 2 \\cdot V + \\frac{Seconds}{NmbSubs... |
Calculate the lake outflow based on linear interpolation.
Required control parameters:
|N|
|llake_control.Q|
Required derived parameters:
|llake_derived.TOY|
|llake_derived.VQ|
Required aide sequence:
|llake_aides.VQ|
Calculated aide sequence:
|llake_aides.QA|
... |
Update the stored water volume based on the equation of continuity.
Note that for too high outflow values, which would result in overdraining
the lake, the outflow is trimmed.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Updated aide sequenc... |
Calculate the actual water stage based on linear interpolation.
Required control parameters:
|N|
|llake_control.V|
|llake_control.W|
Required state sequence:
|llake_states.V|
Calculated state sequence:
|llake_states.W|
Examples:
Prepare a model object:
... |
Adjust the water stage drop to the highest value allowed and correct
the associated fluxes.
Note that method |corr_dw_v1| calls the method `interp_v` of the
respective application model. Hence the requirements of the actual
`interp_v` need to be considered additionally.
Required control parameter... |
Add water to or remove water from the calculated lake outflow.
Required control parameter:
|Verzw|
Required derived parameter:
|llake_derived.TOY|
Updated flux sequence:
|llake_fluxes.QA|
Basic Equation:
:math:`QA = QA* - Verzw`
Examples:
In preparation for the f... |
Update the outlet link sequence.
def pass_q_v1(self):
"""Update the outlet link sequence."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.qa |
Threshold values of the response functions.
def thresholds(self):
"""Threshold values of the response functions."""
return numpy.array(
sorted(self._key2float(key) for key in self._coefs), dtype=float) |
Prepare and return two |numpy| arrays based on the given arguments.
Note that many functions provided by module |statstools| apply function
|prepare_arrays| internally (e.g. |nse|). But you can also apply it
manually, as shown in the following examples.
Function |prepare_arrays| can extract time seri... |
Calculate the efficiency criteria after Nash & Sutcliffe.
If the simulated values predict the observed values as well
as the average observed value (regarding the the mean square
error), the NSE value is zero:
>>> from hydpy import nse
>>> nse(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])
0.0
... |
Calculate the absolute difference between the means of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import bias_abs
>>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> round_(bias_abs(sim=[5.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
1.0
... |
Calculate the ratio between the standard deviation of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import std_ratio
>>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> round_(std_ratio(sim=[1.0, 1.0, 1.0], obs=[1.0, 2.0, 3.0]))
-1.0
... |
Calculate the product-moment correlation coefficient after Pearson.
>>> from hydpy import round_
>>> from hydpy import corr
>>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0]))
1.0
>>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2.0, 3.0]))
-1.0
>>> round_(corr(sim=[1.0, 2.0, 1.0], obs... |
Calculate the probability densities based on the
heteroskedastic skewed exponential power distribution.
For convenience, the required parameters of the probability density
function as well as the simulated and observed values are stored
in a dictonary:
>>> import numpy
>>> from hydpy import ro... |
Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
The following examples are taken from the documentation of function
|hsepd_pdf|, which is used by function |hsepd_manual|. The first
one deals with a heteroscedastic normal dist... |
Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
Function |hsepd| serves the same purpose as function |hsepd_manual|,
but tries to estimate the parameters of the heteroscedastic skewed
exponential distribution via an optimizati... |
Return the weighted mean of the given timepoints.
With equal given weights, the result is simply the mean of the given
time points:
>>> from hydpy import calc_mean_time
>>> calc_mean_time(timepoints=[3., 7.],
... weights=[2., 2.])
5.0
With different weights, the resulting m... |
Return the weighted deviation of the given timepoints from their mean
time.
With equal given weights, the is simply the standard deviation of the
given time points:
>>> from hydpy import calc_mean_time_deviation
>>> calc_mean_time_deviation(timepoints=[3., 7.],
... wei... |
Return a table containing the results of the given evaluation
criteria for the given |Node| objects.
First, we define two nodes with different simulation and observation
data (see function |prepare_arrays| for some explanations):
>>> from hydpy import pub, Node, nan
>>> pub.timegrids = '01.01.2000... |
Set all primary parameters at once.
def set_primary_parameters(self, **kwargs):
"""Set all primary parameters at once."""
given = sorted(kwargs.keys())
required = sorted(self._PRIMARY_PARAMETERS)
if given == required:
for (key, value) in kwargs.items():
setat... |
True/False flag that indicates wheter the values of all primary
parameters are defined or not.
def primary_parameters_complete(self):
"""True/False flag that indicates wheter the values of all primary
parameters are defined or not."""
for primpar in self._PRIMARY_PARAMETERS.values():
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.