Commits
573 573 | ['MS_name', 'antenna_name', 'spwid', 'pol string', 'factor'], |
574 574 | ... |
575 575 | ['MS_name', 'antenna_name', 'spwid', 'pol string', 'factor']] |
576 576 | |
577 577 | Arguments: |
578 578 | factors {dict} -- Dictionary containing Jy/K factors with meta data. |
579 579 | |
580 580 | Returns: |
581 581 | list -- Formatted list of Jy/K factors. |
582 582 | """ |
583 - | template = string.Template('$MS $Antenna $Spwid I $factor') |
584 - | factors = [list(map(str, template.safe_substitute(**factor).split())) for factor in factors] |
583 + | factors = [[factor['MS'], factor['Antenna'], factor['Spwid'], 'I', f"{float(factor['factor']):.9f}"] for factor in factors] |
585 584 | return factors |
586 585 | |
587 586 | |
588 587 | def filter_jyperk(vis, factors, spw): |
589 588 | """Filter factors using spw.""" |
590 589 | ms = mstool() |
591 590 | selected = ms.msseltoindex(vis=vis, spw=spw) |
592 591 | science_windows = selected['spw'] |
593 592 | filtered = [ |
594 593 | i for i in factors if (len(i) == 5) |