fundamental_coords_cpu¶
API documentation for fundamental_coords_cpu.c
Device methods to calculate interferometric coorindates \(u,v,w\) and \(l,m,n\) on the CPU.
Functions
-
void calc_uvw_cpu(double *X_diff, double *Y_diff, double *Z_diff, user_precision_t *u_metres, user_precision_t *v_metres, user_precision_t *w_metres, user_precision_t *us, user_precision_t *vs, user_precision_t *ws, user_precision_t *wavelengths, double sdec0, double cdec0, double *cha0s, double *sha0s, int num_cross, int num_baselines, int num_times, int num_freqs)¶
Calculate the \(u,v,w\) in metres and in wavelengths for multiple time steps and frequencies.
X_diff,Y_diff,Z_diffcontain baseline lengths in localX,Y,Zcoords, which can change with time (when precessed back to J2000), so should be of lengthnum_baselines*num_times. To keep indexing simple, the wavelengths inwavelengthsand hour angles incha0s, sha0sshould contain values for all baselines, all frequencies, and all time steps. .- Parameters:
X_diff – [in] Baseline lengths in the
Xdirection (metres)Y_diff – [in] Baseline lengths in the
Ydirection (metres)Z_diff – [in] Baseline lengths in the
Zdirection (metres)u_metres – [inout] Output
ucoords (metres)v_metres – [inout] Output
vcoords (metres)w_metres – [inout] Output
wcoords (metres)us – [inout] Output
ucoord (wavelengths)vs – [inout] Output
vcoord (wavelengths)ws – [inout] Output
wcoord (wavelengths)wavelengths – [in] Wavelengths for all baselines, frequencies, and time steps (metres)
sdec0 – [in] Sine of the declination of the phase centre
cdec0 – [in] Cosine of the declination of the phase centre
cha0s – [in] Cosine of the hour angle of the phase centre for all baselines, frequencies, and time steps
sha0s – [in] Sine of the hour angle of the phase centre for all baselines, frequencies, and time steps
num_cross – [in] Total number of
u,v,wcoords to be calculated (number of cross correlations)num_baselines – [in] Number of baselines for a single time step
num_times – [in] Number of time steps
num_freqs – [in] Number of frequency steps
-
void calc_uv_shapelet_cpu(double *X_diff, double *Y_diff, double *Z_diff, user_precision_t *u_shapes, user_precision_t *v_shapes, double *lsts, double *ras, double *decs, const int num_baselines, const int num_times, const int num_shapes)¶
The SHAPELET visibility envelope calculation uses a
u,vcoordinate system where the phase centre is set to the RA/Dec of that particular SHAPELET COMPONENT. This kernel calculates multiple \(u,v\) coodinates with varying phase centres to be used later bysource_components.kern_calc_visi_shapelets.The output arrays
u_shapes,v_shapes, contain coordinates for all baselines (fastest changing), all times, and all SHAPELET components (slowest changing), in units of metres.- Parameters:
X_diff – [in] Baseline lengths in the
Xdirection (metres)Y_diff – [in] Baseline lengths in the
Ydirection (metres)Z_diff – [in] Baseline lengths in the
Zdirection (metres)u_shapes – [inout] Output
ucoords with various phase centres for SHAPELET components (metres)v_shapes – [inout] Output
vcoords with various phase centres for SHAPELET components (metres)lsts – [in] The local sidereal times of all time steps in simulation (radians)
ras – [in] Array of SHAPELET Right Ascensions (radians)
decs – [in] Array of SHAPELET Declinations (radians)
num_baselines – [in] Number of baselines for a single time step
num_times – [in] Number of time steps
num_shapes – [in] Number of SHAPELET COMPONENTs
-
void calc_lmn_cpu(double ra0, double sdec0, double cdec0, double *ras, double *decs, double *ls, double *ms, double *ns, int num_components)¶
Calculate interferometric \(l,m,n\) image coords for a given set of RA,Dec and phase centre.
Here it is assumed the phase centre is not changing with time
- Parameters:
ra0 – [in] Right Ascension of the phase centre (radians)
sdec0 – [in] Sine of Declination of the phase centre
cdec0 – [in] Cosine of Declination of the phase centre
ras – [in] Array ofRight Ascension (radians)
decs – [in] Array of Declination (radians)
ls – [in] Output \(l\) coodinates
ms – [in] Output \(m\) coodinates
ns – [in] Output \(n\) coodinates
num_components – [in] Number of RA,Dec coords
-
void calc_lmn_for_components_cpu(components_t *components, int num_components, woden_settings_t *woden_settings)¶
Calculates the \(l,m,n\) coords for an intialised
componentsstruct. Assumes components->ras, components->decs have been allocated and set on the device.Runs
calc_lmn_cpuusing components->ras, components->decs and woden_settings->ra0, woden_settings->sdec0, woden_settings->cdec0 as inputs. This function allocates device memory forcomponents->ls,components->ms, andcomponents->ns, and puts the results in these arrays.- Parameters:
components – [inout] Initialised
components_tstruct containing the ra and dec arraysnum_components – [in] Number of RA,Dec coords in
componentswoden_settings – [in] Woden settings struct containing the phase centre
-
void set_auto_uvw_to_zero_cpu(int num_cross, int num_autos, user_precision_t *us, user_precision_t *vs, user_precision_t *ws)¶
Internally to WODEN , all cross-correlations are stored first, then the autos after. All autos have zero length, so use this function to set all autos uvw to zero.
num_crossis the number of cross-correlations, so fill any uvw after this by addingnum_autosworth of zeros- Parameters:
num_cross – [in] Number of cross-correlations
num_autos – [in] Number of auto-correlations
us – [inout] u coords
vs – [inout] v coords
ws – [inout] w coords