Skip to content

Commit 41ef018

Browse files
committed
added formating of aperture information
1 parent 5e9270a commit 41ef018

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/astrohack/utils/text.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,19 @@ def format_beam_information(beam_dict, tab, ident, key_size):
746746
return outstr
747747

748748

749+
def format_aperture_information(aperture_dict, tab, ident, key_size, resolution_unit='cm'):
750+
outstr = f'{ident}Aperture:\n'
751+
tab += ident
752+
for key, item in aperture_dict.items():
753+
outstr += f'{tab}{key.capitalize().replace('_', ' '):{key_size}s} => '
754+
if key == 'grid size':
755+
outstr += f'{item[0]} by {item[1]} pixels'
756+
else:
757+
outstr += f'{format_wavelength(item[0])} by {format_wavelength(item[1])}'
758+
outstr += '\n'
759+
return outstr
760+
761+
749762
def format_observation_summary(obs_sum, tab_size=3, tab_count=0, az_el_key='mean', phase_center_unit='radec',
750763
az_el_unit='deg', time_format="%d %h %Y, %H:%M:%S", precision='.1f', key_size=18):
751764
spc = ' '
@@ -763,4 +776,7 @@ def format_observation_summary(obs_sum, tab_size=3, tab_count=0, az_el_key='mean
763776
outstr += '\n'
764777
outstr += format_beam_information(obs_sum["beam"], one_tab, ident, key_size)
765778

779+
if obs_sum["aperture"] is not None:
780+
outstr += '\n'
781+
outstr += format_aperture_information(obs_sum["aperture"], one_tab, ident, key_size)
766782
return outstr

0 commit comments

Comments
 (0)