Commits

Rui Xue authored a01f4c39c0e
PIPE-2483: cleanup unused variables; fix potential issue of "antName" as unbound variables in multiple locations; eliminate redundant conditional logic.
No tags

pipeline/hifv/tasks/circfeedpolcal/display.py

Modified
102 102 antPlot = str(ii)
103 103
104 104 stage = 'stage%s' % result.stage_number
105 105 stage_dir = os.path.join(context.report_dir, stage)
106 106 # construct the relative filename, eg. 'stageX/testdelay0.png'
107 107
108 108 figfile = os.path.join(stage_dir, filename)
109 109
110 110 plotrange = []
111 111
112 + # Get antenna name
113 + domain_antennas = self.ms.get_antenna(antPlot)
114 + idents = [a.name if a.name else a.id for a in domain_antennas]
115 + antName = ','.join(idents)
116 +
112 117 if not os.path.exists(figfile):
113 118 try:
114 - # Get antenna name
115 - antName = antPlot
116 - if antPlot != '':
117 - domain_antennas = self.ms.get_antenna(antPlot)
118 - idents = [a.name if a.name else a.id for a in domain_antennas]
119 - antName = ','.join(idents)
120 119
121 120 job = casa_tasks.plotms(vis=self.caltable, xaxis='freq', yaxis='amp', field='',
122 - antenna=antPlot, spw='', timerange='', plotrange=plotrange, coloraxis='',
123 - title='POL table: {!s} Antenna: {!s}'.format(self.caltable, antName),
124 - titlefont=8, xaxisfont=7, yaxisfont=7, showgui=False, plotfile=figfile,
125 - xconnector='step')
121 + antenna=antPlot, spw='', timerange='', plotrange=plotrange, coloraxis='',
122 + title='POL table: {!s} Antenna: {!s}'.format(self.caltable, antName),
123 + titlefont=8, xaxisfont=7, yaxisfont=7, showgui=False, plotfile=figfile,
124 + xconnector='step')
126 125
127 126 job.execute()
128 127
129 128 except Exception as ex:
130 129 LOG.warning("Unable to plot " + filename + str(ex))
131 130 else:
132 131 LOG.debug('Using existing ' + filename + ' plot.')
133 132
134 133 try:
135 134 plot = logger.Plot(figfile, x_axis='Frequency', y_axis='Amplitude', field='',

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut