Commits

Ville Suoranta authored f1203977978 Merge
Merge pull request #469 in CASA/casa6 from CAS-13622 to master

* commit '1cc9672b4c7fb302a297ca9df0418ca6543b13e4': CAS-13622: Fix TIME_RANGE in OBSERVATION table created by importfitsidi

casatasks/src/private/task_importfitsidi.py

Modified
90 90 # check if all observations are from the same telescope; if not warn and leave as is
91 91 tels = mytb.getcol('TELESCOPE_NAME')
92 92 for i in range(1,nobs):
93 93 if tels[i]!=tels[0]:
94 94 cando = False
95 95
96 96 if cando:
97 97 # get min and max time and write them into the first row;
98 98 casalog.post('Adjusting OBSERVATION table', 'INFO')
99 99 timeranges = mytb.getcol('TIME_RANGE')
100 - ttr = timeranges.transpose()
101 - newmin = min(ttr[0])
102 - newmax = max(ttr[1])
100 + newmin = min(timeranges[0])
101 + newmax = max(timeranges[1])
103 102 mytb.putcell('TIME_RANGE', 0, [newmin,newmax])
104 103 # delete the other rows
105 104 mytb.removerows(list(range(1,nobs)))
106 105 else:
107 106 casalog.post('The input files stem from different telescopes. Need to give different obs id.', 'WARN')
108 107 mytb.close()
109 108
110 109 if cando:
111 110 # give the same obs id == 0 to the entire output MS
112 111 casalog.post('Setting observation ID of all integrations to 0', 'INFO')

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

Add shortcut