You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The multiplicative quantile delta mapping procedure produces nan values in some cases if the basis of delta is negative.
The delta can be described as:
\Delta(i) = \frac{
X_{sim,p}(i)
} {
F^{-1}{sim,h} \left{ F{sim,p } \left[ X_{sim,p}(i) \right] \right} }
where
$F^{-1}{sim,h}$ represents the inverse cumulative distribution function of the modeled data of the control period
$F{sim,p}$ represents the cumulative distribution function of the modeled data that is to be adjusted $X_{sim,p}(i)$ is the value of a climate variable $X$ at time step $i$
So if the basis is zero - the mentioned part return a zero as scaling factor instead of the maximum scaling factor (10 as default).
EDIT:
This also occurs on every place where the devision is applied.
And if the numerator is zero the value should remain zero - and not nan in some cases.
To Reproduce
A real world example would be: $X_{sim,p}(i)$ is the value of precipitation at time step $i$ and is 0.0001 mm. So if the value inserted into the cumulative distribution function returns a precipitation value that equals zero - for example when the precipitation in the control data was much higher than in the data stat is to be adjusted.
Expected behaviour
The change should not be zero (this means no change) - instead the maximum scaling factor should be applied.
Additional context
python-cmethods v1.0.0
The text was updated successfully, but these errors were encountered:
Describe the bug
The multiplicative quantile delta mapping procedure produces nan values in some cases if the basis of delta is negative.
The delta can be described as:
\Delta(i) = \frac{
$X_{sim,p}(i)$ is the value of a climate variable $X$ at time step $i$
X_{sim,p}(i)
} {
F^{-1}{sim,h} \left{ F{sim,p } \left[ X_{sim,p}(i) \right] \right} }
where
$F^{-1}{sim,h}$ represents the inverse cumulative distribution function of the modeled data of the control period
$F{sim,p}$ represents the cumulative distribution function of the modeled data that is to be adjusted
see: v1.0.0/cmethods/init.py#L1055-L1059
So if the basis is zero - the mentioned part return a zero as scaling factor instead of the maximum scaling factor (10 as default).
EDIT:
To Reproduce$X_{sim,p}(i)$ is the value of precipitation at time step $i$ and is 0.0001 mm. So if the value inserted into the cumulative distribution function returns a precipitation value that equals zero - for example when the precipitation in the control data was much higher than in the data stat is to be adjusted.
A real world example would be:
Expected behaviour
The change should not be zero (this means no change) - instead the maximum scaling factor should be applied.
Additional context
python-cmethods v1.0.0
The text was updated successfully, but these errors were encountered: