calculate_visibilities_cpu¶
API documentation for calculate_visibilities_cpu.c.
Functions
-
calc_visi_inouts_t *create_calc_visi_inouts_cpu(visibility_set_t *visibility_set, user_precision_t *sbf, woden_settings_t *woden_settings, int num_shapelets, int use_twobeams)¶
Creates and initialises the calc_visi_inouts_t structure for CPU calculations. This function gathers all inputs into one struct, and allocates memory for intermediate outputs.
Specifically, we make the following pointers:
calc_visi_inouts->allsteps_sha0s = visibility_set->allsteps_sha0s;
calc_visi_inouts->allsteps_cha0s = visibility_set->allsteps_cha0s;
calc_visi_inouts->allsteps_wavelengths = visibility_set->allsteps_wavelengths;
calc_visi_inouts->freqs = visibility_set->channel_frequencies;
and depending on the number of shapelets and whether we using a unique beam for each station, we allocate memory for:
calc_visi_inouts->u_metres
calc_visi_inouts->v_metres
calc_visi_inouts->w_metres
calc_visi_inouts->us
calc_visi_inouts->vs
calc_visi_inouts->ws
calc_visi_inouts->u_shapes
calc_visi_inouts->v_shapes
calc_visi_inouts->ant1_to_baseline_map
calc_visi_inouts->ant2_to_baseline_map
- Parameters:
visibility_set – Pointer to the visibility set structure.
sbf – Pointer to the user precision structure.
woden_settings – Pointer to the WODEN settings structure.
num_shapelets – Number of shapelets to be used in the calculation.
use_twobeams – Flag indicating whether to use two beams per baseline (1) or not (0) (assumes all primary beams are unique)
- Returns:
Pointer to the initialised calc_visi_inouts_t structure.
-
void set_visi_set_to_zero_cpu(visibility_set_t *visibility_set, int num_visis)¶
Sets the visibility set to zero.
This function sets the real and imaginary parts of all visibilities in the visibility set to zero. Call before looping over sources to accumulate visibilities.
- Parameters:
visibility_set – Pointer to the visibility set structure.
num_visis – Number of visibilities to be set to zero.
-
void free_calc_visi_inouts_cpu(calc_visi_inouts_t *calc_visi_inouts, int num_shapelets, int use_twobeams)¶
Frees the memory allocated for the calc_visi_inouts_t structure.
Frees everything that was allocated in
create_calc_visi_inouts_cpu.- Parameters:
calc_visi_inouts – Pointer to the calc_visi_inouts_t structure.
num_shapelets – Number of shapelets in the original source_catalogue.
use_twobeams – Flag indicating whether to use two beams per baseline (1) or not (0) (assumes all primary beams are unique)
-
void free_components_cpu(components_t *components)¶
Frees any arrays that were allocated when calculating
lmncoords and extrapolating Stokes fluxes; doesn’t free the wholecomponents_tstruct as that should have been created and freed elsewhere (Python via ctypes inrun_woden.py)- Parameters:
components – Pointer to the components structure.
-
void free_beam_gains_cpu(beam_gains_t *beam_gains, e_beamtype beamtype)¶
Frees the memory allocated for the beam gains structure.
Depending on the beamtype, either frees beams gains or beamg gains and leakages.
- Parameters:
beam_gains – Pointer to the beam gains structure.
beamtype – The type of beam to be freed (see e_beamtype in woden_struct_defs.h).