Skip to content

Commit 8847dd0

Browse files
committed
Save antenna positions with VIS files
1 parent 9685432 commit 8847dd0

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

software/python_modules/tart/tart/imaging/visibility.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ def Visibility_Save_JSON(vis, filename):
150150
Load and save lists of visibilities. Use filename extensions to deal with the deprecated .pkl files (or .vis files)
151151
'''
152152

153-
def list_save(vis_list, cal_gain, cal_ph, filename):
153+
def list_save(vis_list, ant_pos, cal_gain, cal_ph, filename):
154154
_, file_extension = os.path.splitext(filename)
155155

156156
if ('.pkl' == file_extension):
157157
to_pkl(vis_list, filename)
158158
elif ('.vis' == file_extension):
159159
to_pkl(vis_list, filename)
160160
elif ('.hdf' == file_extension):
161-
to_hdf5(vis_list, cal_gain, cal_ph, filename)
161+
to_hdf5(vis_list, ant_pos, cal_gain, cal_ph, filename)
162162
else:
163163
raise RuntimeError("Unknown visibility file extension {}".format(file_extension))
164164

@@ -207,7 +207,7 @@ def from_pkl(filename):
207207
Deal with HDF5 Files
208208
'''
209209

210-
def to_hdf5(vis_list, cal_gain, cal_ph, filename):
210+
def to_hdf5(vis_list, ant_pos, cal_gain, cal_ph, filename):
211211
''' Save the Observation object,
212212
to a portable HDF5 format
213213
'''
@@ -232,6 +232,9 @@ def to_hdf5(vis_list, cal_gain, cal_ph, filename):
232232
h5f.create_dataset('vis', data=np.array(vis_data))
233233
h5f.create_dataset('gains', data=np.array(cal_gain))
234234
h5f.create_dataset('phases', data=np.array(cal_ph))
235+
236+
h5f.create_dataset('antenna_positions', data=np.array(ant_pos))
237+
235238
h5f.create_dataset("timestamp", data=np.array(vis_ts, dtype=object), dtype=dt)
236239

237240
#ts_dset = h5f.create_dataset('timestamp', (len(vis_ts),), dtype=dt)

software/python_modules/tart_hardware_interface/tart_hardware_interface/stream_vis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def capture_loop(tart, process_queue, cmd_queue, runtime_config, logger=None,):
7777
d, d_json = get_status_json(tart)
7878
runtime_config['status'] = d
7979
process_queue.put(data)
80-
print(('Capture Loop: Acquired', data[0]))
80+
logger.info(('Capture Loop: Acquired', data[0]))
8181
except Exception as e:
8282
logger.error("Capture Loop Error %s" % str(e))
8383
logger.error(traceback.format_exc())

software/python_modules/tart_web_api/tart_web_api/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ def vis_stream_acquire(self):
306306
cal_gain = [rows_dict[i][2] for i in range(24)]
307307
cal_ph = [rows_dict[i][3] for i in range(24)]
308308

309-
visibility.list_save(self.vislist, cal_gain, cal_ph, fname)
309+
ant_pos = self.config['antenna_positions']
310+
311+
visibility.list_save(self.vislist, ant_pos, cal_gain, cal_ph, fname)
310312

311313
logging.info("saved to {}".format(vis, fname))
312314
ret['filename'] = fname

0 commit comments

Comments
 (0)