-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initializing noise field with default arguments returns array of zeros. Is this expected behavior? #451
Comments
Adding a small piece of code as example:
|
Hi @bwalraven thanks for the detailed issue report. I'll try to have a close look, but in essence the tapering is probably behaving as expected as we exclude rainy pixels at the edges when computing the power spectra to avoid artefacts. However, the plot of the tapering function does look a bit weird, and, more importantly, it should handle zero fields more graciously instead of raising an error. |
Hi @dnerini thanks for looking into this. Curious to what you can find out. And understandable to exclude some pixels at the edges, though what strikes me in the example I showed is the difference in excluded pixels in x and y direction (approx. 1 pixel vs. almost 50 pixels). Note that the image I included is a little bit distorted as there are more y-pixels (199) than x-pixels (113). |
I am running a probabilistic nowcast for a rectangular precipitation field (199x113) using the steps function with the following settings:
and run into the following error before the noise adjustment coefficients are computed:
ValueError: field contains non-finite values
.This points me to the following statement in the cascade decomposition:
which in turn points me to
decomp_N = decomp_method(N, F, mask=MASK_)
in the following function:pysteps/pysteps/noise/utils.py
Line 24 in e332585
This stems from the fact that the noise field F returned in the function:
pysteps/pysteps/noise/fftgenerators.py
Line 214 in e332585
is an array of zeroes, and thus N in the following lines in noise generation returns a
nan
.It appears the issue lies in the following lines in the function
pysteps/pysteps/noise/fftgenerators.py
Line 214 in e332585
Using the default arguments, with window_function="tukey" and a field size of 199x113, the tapering returns an oval shape (black for values >0):
This essentially means that if we have a precipitation field, with precipitation only at the edges, and use the default steps settings, this would return a noise field of zeros and eventually lead to an error in the cascade decomposition.
Though the function appears to numerically behave as expected, is this an error or is this desired behavior? Does this mean it's not possible to compute a nowcast if we have precipitation only around the edges of our domain?
The text was updated successfully, but these errors were encountered: