Commits
Laszlo Szucs authored 278dab9ff19 Merge
227 227 | Create a PlotLeaf for each spw in the applied calibration. |
228 228 | """ |
229 229 | # reference to the PlotLeaf class to call |
230 230 | leaf_class = None |
231 231 | |
232 232 | def __init__(self, context, output_dir, calto, xaxis, yaxis, ant='', field='', intent='', **kwargs): |
233 233 | ms = context.observing_run.get_ms(calto.vis) |
234 234 | |
235 235 | children = [] |
236 236 | for spw in ms.get_spectral_windows(calto.spw): |
237 + | # For PIPE-690 it was requested to create plots only for a certain spw/field |
238 + | # selection. This is accomplished by passing a dictionary to the field |
239 + | # override parameter. |
240 + | if isinstance(field, dict): |
241 + | field_spec = field.get(spw.id, None) |
242 + | if field_spec is None: |
243 + | continue |
244 + | else: |
245 + | field_spec = field |
237 246 | # only create plots for scans with data |
238 - | scans = ms.get_scans(spw=spw.id, field=field, scan_intent=intent) |
247 + | scans = ms.get_scans(spw=spw.id, field=field_spec, scan_intent=intent) |
239 248 | if not scans: |
240 249 | continue |
241 250 | |
242 251 | kwargs_copy = dict(kwargs) |
243 252 | kwargs_copy['avgchannel'] = kwargs.get('avgchannel', str(spw.num_channels)) |
244 253 | |
245 - | leaf_obj = self.leaf_class(context, output_dir, calto, xaxis, yaxis, spw=spw.id, ant=ant, field=field, |
254 + | leaf_obj = self.leaf_class(context, output_dir, calto, xaxis, yaxis, spw=spw.id, ant=ant, field=field_spec, |
246 255 | intent=intent, **kwargs_copy) |
247 256 | children.append(leaf_obj) |
248 257 | |
249 258 | super(SpwComposite, self).__init__(children) |
250 259 | |
251 260 | |
252 261 | class BasebandComposite(common.LeafComposite): |
253 262 | """ |
254 263 | Create a PlotLeaf for each baseband in the applied calibration. |
255 264 | """ |