Skip to content

Commit

Permalink
stripping debugging: Removed debugging prints.
Browse files Browse the repository at this point in the history
The MS used for OTF 47 is corrupted or has problems in the observations
  • Loading branch information
vsmagalhaes committed Nov 17, 2023
1 parent ec47900 commit 2eaa644
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/astrohack/_utils/_extract_holog.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ def _extract_holog_chunk(extract_holog_params):
)

vis_data = ctb.getcol(data_column)
print(vis_data.shape)
weight = ctb.getcol("WEIGHT")
ant1 = ctb.getcol("ANTENNA1")
ant2 = ctb.getcol("ANTENNA2")
time_vis_row = ctb.getcol("TIME")
print(time_vis_row.shape)
time_vis_row_centroid = ctb.getcol("TIME_CENTROID")
flag = ctb.getcol("FLAG")
flag_row = ctb.getcol("FLAG_ROW")
Expand All @@ -103,7 +101,6 @@ def _extract_holog_chunk(extract_holog_params):
ref_ant_per_map_ant_tuple,
map_ant_tuple,
)
print(vis_map_dict[1].shape)
del vis_data, weight, ant1, ant2, time_vis_row, flag, flag_row

map_ant_name_list = list(map(str, map_ant_name_tuple))
Expand Down Expand Up @@ -341,7 +338,6 @@ def _create_holog_file(

xds = xr.Dataset()
xds = xds.assign_coords(coords)
print(vis_map_dict[map_ant_index].shape)
xds["VIS"] = xr.DataArray(
vis_map_dict[map_ant_index], dims=["time", "chan", "pol"]
)
Expand Down Expand Up @@ -511,10 +507,15 @@ def _extract_pointing_chunk(map_ant_ids, time_vis, pnt_ant_dict):

for antenna in map_ant_ids:
pnt_map_dict[antenna] = np.zeros((n_time_vis, 2))

atime = time_vis[12000]
indices = np.abs(pnt_ant_dict[antenna].time.values - atime) < 0.3

pnt_map_dict[antenna] = (
pnt_ant_dict[antenna]
.interp(time=time_vis, method="nearest")
)
indices = pnt_map_dict[antenna].time.values == atime

return pnt_map_dict

Expand Down
2 changes: 0 additions & 2 deletions src/astrohack/_utils/_holog.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def _holog_chunk(holog_chunk_params):

# Grid the data
vis = ant_xds.VIS.values
print('vis shape in holog:', vis.shape)
vis[vis == np.nan] = 0.0
lm = ant_xds.DIRECTIONAL_COSINES.values
weight = ant_xds.WEIGHT.values
Expand All @@ -108,7 +107,6 @@ def _holog_chunk(holog_chunk_params):

# Unavoidable for loop because lm change over frequency.
for chan_index in range(n_chan):

# Average scaled beams.
beam_grid[holog_map_index, 0, :, :, :] = (beam_grid[holog_map_index, 0, :, :, :] + np.moveaxis(griddata(lm_freq_scaled[:, :, chan_index], vis_avg[:, chan_index, :], (grid_l, grid_m), method=holog_chunk_params["grid_interpolation_mode"],fill_value=0.0),(2),(0)))

Expand Down

0 comments on commit 2eaa644

Please sign in to comment.