From 710ba6c6c1ed46987624aa8187b0111190c8b5ff Mon Sep 17 00:00:00 2001 From: brettjrob <59444330+brettjrob@users.noreply.github.com> Date: Thu, 2 Jan 2020 08:59:52 -0600 Subject: [PATCH] Fix data point skipping on hodo This seems to be a subtle off-by-one index error when drawing each colored 3-km segment of the hodo. The first data point after a segment cutoff is skipped when connecting u,v points. If z = [..., 2900, 3100, 3300, ...], then the u,v point at 3100 m AGL is skipped, since it's the first index after the 3-km segment cutoff. Only becomes noticeable with vertically sparse data. --- sharppy/viz/hodo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharppy/viz/hodo.py b/sharppy/viz/hodo.py index c01d68e7..f9be9463 100644 --- a/sharppy/viz/hodo.py +++ b/sharppy/viz/hodo.py @@ -1228,7 +1228,7 @@ def draw_hodo(self, qp, prof, colors, width=2): path = QPainterPath() path.moveTo(seg_x[idx], seg_y[idx]) - for z_idx in xrange(seg_idxs[idx] + 1, seg_idxs[idx + 1]): + for z_idx in xrange(seg_idxs[idx], seg_idxs[idx + 1]): path.lineTo(xx[z_idx], yy[z_idx]) path.lineTo(seg_x[idx + 1], seg_y[idx + 1])