openradar / xradar

A tool to work in weather radar data in xarray
https://docs.openradarscience.org/projects/xradar
MIT License
85 stars 17 forks source link

ENH: add IRIS DB_VELC decoding and tests #83

Closed kmuehlbauer closed 1 year ago

kmuehlbauer commented 1 year ago

closes #78

Unfortunately the description in the docs is inaccurate. I've taken a reasonable approach to decode as probably intended.

4.4.42 1-byte Unfolded Velocity Format (DB_VELC)

This is the mean radial velocity corrected for both Nyquist folding and fall speed. It is scaled to cover a fixed span of +/- 75 meters/second. In data product files, the value 255 is used to indicate area not scanned.

0 | Velocity data not available at this range 1 | -75.0 m/s (towards the radar) 2 | -74.4 m/s 128 | Zero velocity 129 | +0.6 m/s 254 | +75.0 m/s (away from the radar) 255 | Area not scanned

This will now be decoded to:

[ inf, -75., -74.409449, 0., 0.590551, 74.409449, 75.]

kmuehlbauer commented 1 year ago

Sorry, this PR ended up not in my fork! I'll clean up here asap.

codecov[bot] commented 1 year ago

Codecov Report

Merging #83 (2108be6) into main (23ff112) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage   87.99%   87.99%           
=======================================
  Files          18       18           
  Lines        3233     3233           
=======================================
  Hits         2845     2845           
  Misses        388      388           
Flag Coverage Δ
unittests 87.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
xradar/io/backends/iris.py 84.85% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.