Commits
Kazuhiko Shimada authored 38f3ad73186 Merge
558 558 | |
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 | |
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. |