From 01416295f664500d078b6db4b4ea5cf52df78a3f Mon Sep 17 00:00:00 2001 From: rcooke Date: Fri, 9 Aug 2024 20:31:33 +0100 Subject: [PATCH 1/2] fix trc_name when None as input --- pypeit/alignframe.py | 3 +-- pypeit/display/display.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pypeit/alignframe.py b/pypeit/alignframe.py index 2cfc6b28d8..fb899525a9 100644 --- a/pypeit/alignframe.py +++ b/pypeit/alignframe.py @@ -316,8 +316,7 @@ def show_alignment(alignframe, align_traces=None, slits=None, clear=False): if slt%2 == 0: color = 'magenta' # Display the trace - display.show_trace(viewer, channel, align_traces[:, bar, slt], trc_name="", - color=color) + display.show_trace(viewer, channel, align_traces[:, bar, slt], color=color) class AlignmentSplines: diff --git a/pypeit/display/display.py b/pypeit/display/display.py index 2b53dc466f..948ca1f2f8 100644 --- a/pypeit/display/display.py +++ b/pypeit/display/display.py @@ -485,6 +485,7 @@ def show_trace(viewer, ch, trace, trc_name=None, maskdef_extr=None, manual_extr= ntrace = trace.shape[1] _maskdef_extr = ntrace*[False] if maskdef_extr is None else maskdef_extr _manual_extr = ntrace*[False] if manual_extr is None else manual_extr + _trc_name = ntrace*[''] if trc_name is None else trc_name # Show if yval is None: @@ -507,8 +508,8 @@ def show_trace(viewer, ch, trace, trc_name=None, maskdef_extr=None, manual_extr= # Text ohf = len(trace[:,i])//2 # Do it - canvas_list += [dict(type='text',args=(float(y[ohf,i]), float(trace[ohf,i]), str(trc_name[i])) if rotate - else (float(trace[ohf,i]), float(y[ohf,i]), str(trc_name[i])), + canvas_list += [dict(type='text',args=(float(y[ohf,i]), float(trace[ohf,i]), str(_trc_name[i])) if rotate + else (float(trace[ohf,i]), float(y[ohf,i]), str(_trc_name[i])), kwargs=dict(color=_color, fontsize=17., rot_deg=90.))] canvas.add('constructedcanvas', canvas_list) From 844c2a85bfe0ed0db03c362db484f6efcac1de23 Mon Sep 17 00:00:00 2001 From: rcooke Date: Mon, 12 Aug 2024 18:45:30 +0100 Subject: [PATCH 2/2] update release logs --- doc/releases/1.16.1dev.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/releases/1.16.1dev.rst b/doc/releases/1.16.1dev.rst index 632725788c..120e5f1595 100644 --- a/doc/releases/1.16.1dev.rst +++ b/doc/releases/1.16.1dev.rst @@ -52,3 +52,4 @@ Bug Fixes - Fixed a fault caused when all frames in a pypeit file are identified as being part of ``all`` calibration groups. - Allow for empty 2D wavecal solution in HDU extension of WaveCalib file +- Fixed a bug in the ginga display function, when the user doesn't provide the `trc_name` argument. \ No newline at end of file