diff --git a/src/astrohack/_utils/_extract_holog.py b/src/astrohack/_utils/_extract_holog.py index db4731d8..65769c33 100644 --- a/src/astrohack/_utils/_extract_holog.py +++ b/src/astrohack/_utils/_extract_holog.py @@ -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") @@ -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)) @@ -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"] ) @@ -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 diff --git a/src/astrohack/_utils/_holog.py b/src/astrohack/_utils/_holog.py index a79f0b7e..4aabb2fc 100644 --- a/src/astrohack/_utils/_holog.py +++ b/src/astrohack/_utils/_holog.py @@ -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 @@ -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)))