pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.
https://pysteps.github.io/
BSD 3-Clause "New" or "Revised" License
466 stars 168 forks source link

`dB_transform` ignores existing metadata #198

Open dnerini opened 3 years ago

dnerini commented 3 years ago

Original report

(by Valentina Gregori)

I also noticed another small issue (already in the previous version of pysteps). When I do a conversion to reflectivity using the function conversion.to_reflectivity(R, metadata) the output value of metadata['zerovalue'] is not as expected. I think this happens because in the transformation.dB_transform function, which is called by conversion.to_reflectivity, the code that checks if "zerovalue" is a key of metadata is missing:

if zerovalue is None:
    zerovalue = metadata.get("zerovalue", threshold-5)

for now, it seems that the "zerovalue" is only replaced by "threshold-5". Do you think it makes sense? Thanks in advance!