From 85ccede7f006bc596c18311045c0437d1a432621 Mon Sep 17 00:00:00 2001 From: XANTRONIX Industrial Date: Fri, 14 Mar 2025 17:18:30 -0400 Subject: [PATCH] Implement draw_special_isobar() Implement draw_special_isobar() to draw an orange dashed isobar --- lib/xmet/skew_t.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/xmet/skew_t.py b/lib/xmet/skew_t.py index 2320d1e..30bb4d0 100644 --- a/lib/xmet/skew_t.py +++ b/lib/xmet/skew_t.py @@ -221,6 +221,21 @@ class SkewTGraph(): cr.stroke() cr.restore() + def draw_special_isobar(self, + cr: cairo.Context, + x: float, + y: float, + pressure: float): + cr.save() + + cr.set_line_width(0.5) + cr.set_dash([5, 5], 1) + cr.set_source_rgb(1.0, 0.4, 0.0) + + self.draw_isobar(cr, x, y, pressure) + + cr.restore() + def draw(self, cr: cairo.Context, x: float, @@ -236,16 +251,13 @@ class SkewTGraph(): params = SoundingParameters.from_sounding(sounding) if self.opts.draw_lcl: - cr.set_source_rgb(1.0, 0.4, 0.0) - self.draw_isobar(cr, x, y, params.lcl[1]) + self.draw_special_isobar(cr, x, y, params.lcl[1]) if self.opts.draw_lfc: - cr.set_source_rgb(1.0, 0.4, 0.0) - self.draw_isobar(cr, x, y, params.lfc[1]) + self.draw_special_isobar(cr, x, y, params.lfc[1]) if self.opts.draw_el: - cr.set_source_rgb(1.0, 0.4, 0.0) - self.draw_isobar(cr, x, y, params.el[1]) + self.draw_special_isobar(cr, x, y, params.el[1]) if self.opts.draw_cape_dry_adiabat: cr.set_source_rgb(1.0, 0.8, 0.2)