Commits

Kazuhiko Shimada authored 38f3ad73186 Merge
Pull request #1387: PIPE-2287 hsd imaging refactor the logic of plotting channel map

Merge in PIPE/pipeline from PIPE-2287-hsd_imaging-refactor-the-logic-of-plotting-channel-map to main * commit '1142e4207ba8f22f73638ed67a456967029acd9f': (34 commits) PIPE-2287: fixed the comment PIPE-2287: modified the condition of the slice width generation PIPE-2287: fixed the condition of slice width calculation PIPE-2287: modified _calc_plot_values() PIPE-2287: modified the docstring of __prot_channel_map() PIPE-2287: modified initializing of LSB flag PIPE-2287: fixed the logic _calc_slice_width PIPE-2287: fixed the logic calculating idx_1st_vertline PIPE-2287: modified the docstring of valid_lines PIPE-2287: modified initializing is_lsb PIPE-2287: modified the docstring in _calc_plot_values PIPE-2287: modified the docstring at _calc_plot_values PIPE-2287: modified the docstring at _calc_plot_values PIPE-2287: modified comments/typo/bug PIPE-2287: fixed a bug and modified the calculation of red line positions PIPE-2287: modified comments and an expression PIPE-2287: modified comments PIPE-2287: modified comments PIPE-2287: modified comments PIPE-2287: fixed a bug at extrapolation ...

pipeline/hsd/tasks/common/display.py

Modified
558 558 @property
559 559 def source(self) -> str:
560 560 """Return name of the target source."""
561 561 return self.result.outcome['image'].sourcename
562 562
563 563 @property
564 564 def contamination_plot(self) -> str:
565 565 """Return file name of the contamination plot."""
566 566 return self.imagename.rstrip('/') + '.contamination.png'
567 567
568 - def valid_lines(self, is_freq_chan_reversed_image: bool=False) -> List[List[int]]:
569 - """Return list of chnnel ranges of valid spectral lines."""
568 + def valid_lines(self) -> List[List[Union[float, int, bool]]]:
569 + """
570 + Return list of channel ranges of valid spectral lines.
571 +
572 + Returns:
573 + the list of valid spectral lines
574 + """
570 575 group_desc = self.reduction_group
571 576 ant_index = self.antennaid_list
572 577 spwid_list = self.spwid_list
573 578 msid_list = self.msid_list
574 579 fieldid_list = self.fieldid_list
575 580
576 581 line_list = []
577 582
578 583 msobj_list = self.context.observing_run.measurement_sets
579 584 msname_list = [absolute_path(msobj.name) for msobj in msobj_list]
582 587 for (msid, ant, fid, spw) in zip(msid_list, ant_index, fieldid_list, spwid_list):
583 588 group_msid = msname_list.index(absolute_path(g.ms.name))
584 589 if group_msid == msid and g.antenna_id == ant and \
585 590 g.field_id == fid and g.spw_id == spw:
586 591 found = True
587 592 break
588 593 if found:
589 594 for ll in copy.deepcopy(g.channelmap_range):
590 595 if ll not in line_list and ll[2] is True:
591 596 line_list.append(ll)
592 - if is_freq_chan_reversed_image:
593 - _right_edge = float(self.image.nchan - 1)
594 - for ll in line_list:
595 - ll[0] = _right_edge - ll[0]
596 597 return line_list
597 598
598 599 def create_channel_mask(self, channel_selection: ChannelSelection) -> str:
599 600 """Generate channel mask for immoments according to channel selection enum.
600 601
601 602 Args:
602 603 channel_selection: Channel selection enum.
603 604
604 605 Returns:
605 606 Channel selection string.

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

Add shortcut