fundamental_coords
¶
API documentation for fundamental_coords.cu
Device methods to calculate interferometric coorindates \(u,v,w\) and \(l,m,n\).
Functions
-
__device__ void calc_uvw(double *d_X_diff, double *d_Y_diff, double *d_Z_diff, double sdec0, double cdec0, double sha0, double cha0, int iBaseline, int num_baselines, int num_times, int num_freqs, user_precision_t *u, user_precision_t *v, user_precision_t *w)¶
Use the given baseline lengths in local
X,Y,Z
coords, and a given phase centre, calculateu,v,w
coordinates.Performs Equation 4.1 from TMS https://link.springer.com/book/10.1007/978-3-319-44431-4. This
__device__
function is called bykern_calc_uvw
, which calculatesu,v,w
for multiple time steps. Using the indexiBaseline
,num_baselines
,num_times
,num_freqs
, this function does a modulus to indexd_X_diff
,d_Y_diff
,d_Z_diff
correctly, as the diff arrays do not change with frequency (but change with time).- Parameters:
d_X_diff – [in] Baseline length in the
X
direction (metres)d_Y_diff – [in] Baseline length in the
Y
direction (metres)d_Z_diff – [in] Baseline length in the
Z
direction (metres)sdec0 – [in] Sine of the declination of the phase centre
cdec0 – [in] Cosine of the declination of the phase centre
sha0 – [in] Sine of the hour angle of the phase centre
cha0 – [in] Cosine of the hour angle of the phase centre
iBaseline – [in] Index passed from
kern_calc_uvw
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
u – [inout] Output
u
coord (metres)v – [inout] Output
v
coord (metres)w – [inout] Output
w
coord (metres)
-
__global__ void kern_calc_uvw(double *d_X_diff, double *d_Y_diff, double *d_Z_diff, user_precision_t *d_u_metres, user_precision_t *d_v_metres, user_precision_t *d_w_metres, user_precision_t *d_u, user_precision_t *d_v, user_precision_t *d_w, user_precision_t *d_wavelengths, double sdec0, double cdec0, double *d_cha0s, double *d_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.
d_X_diff
,d_Y_diff
,d_Z_diff
contain baseline lengths in localX,Y,Z
coords, which can change with time (when precessed back to J2000), so should be of lengthnum_baselines
*num_times
. To keep indexing simple, the wavelengths ind_wavelengths
and hour angles ind_cha0s, d_sha0s
should contain values for all baselines, all frequencies, and all time steps. .When called with
dim3 grid, threads
, kernel should be called withgrid.x
set, where:grid.x * threads.x >=
num_visis
- Parameters:
d_X_diff – [in] Baseline lengths in the
X
direction (metres)d_Y_diff – [in] Baseline lengths in the
Y
direction (metres)d_Z_diff – [in] Baseline lengths in the
Z
direction (metres)d_u_metres – [inout] Output
u
coords (metres)d_v_metres – [inout] Output
v
coords (metres)d_w_metres – [inout] Output
w
coords (metres)d_u – [inout] Output
u
coord (wavelengths)d_v – [inout] Output
v
coord (wavelengths)d_w – [inout] Output
w
coord (wavelengths)d_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
d_cha0s – [in] Cosine of the hour angle of the phase centre for all baselines, frequencies, and time steps
d_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,w
coords 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
-
__global__ void kern_calc_uv_shapelet(double *d_X_diff, double *d_Y_diff, double *d_Z_diff, user_precision_t *d_u_shapes, user_precision_t *d_v_shapes, double *d_lsts, double *d_ras, double *d_decs, const int num_baselines, const int num_times, const int num_shapes)¶
The SHAPELET visibility envelope calculation uses a
u,v
coordinate 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
d_u_shapes
,d_v_shapes
, contain coordinates for all baselines (fastest changing), all times, and all SHAPELET components (slowest changing), in units of metres.When called with
dim3 grid, threads
, kernel should be called with bothgrid.x
andgrid.y
set, where:grid.x * threads.x >=
num_baselines*num_times
grid.y * threads.y >=
num_shapes
- Parameters:
d_X_diff – [in] Baseline lengths in the
X
direction (metres)d_Y_diff – [in] Baseline lengths in the
Y
direction (metres)d_Z_diff – [in] Baseline lengths in the
Z
direction (metres)d_u_shapes – [inout] Output
u
coords with various phase centres for SHAPELET components (metres)d_v_shapes – [inout] Output
v
coords with various phase centres for SHAPELET components (metres)d_lsts – [in] The local sidereal times of all time steps in simulation (radians)
d_ras – [in] Array of SHAPELET Right Ascensions (radians)
d_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
-
__device__ void calc_lmn(double ra0, double sdec0, double cdec0, double ra, double dec, double *l, double *m, double *n)¶
Calculate interferometric \(l,m,n\) image coords for a given 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
ra – [in] Right Ascension (radians)
dec – [in] Declination (radians)
l – [in] Output \(l\) coodinate
m – [in] Output \(m\) coodinate
n – [in] Output \(n\) coodinate
-
__global__ void kern_calc_lmn(double ra0, double sdec0, double cdec0, double *d_ras, double *d_decs, double *d_l, double *d_m, double *d_n, int num_components)¶
Calculate interferometric \(l,m,n\) image coords for a set of RA,Dec coodinates, with a single RA/Dec phase centre.
When called with
dim3 grid, threads
, kernel should be called withgrid.x
set, where:grid.x * threads.x >=
num_components
- 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
d_ras – [in] Array of Right Ascensions (radians)
d_decs – [in] Array of Declinations (radians)
d_l – [inout] Output \(l\) coodinates
d_m – [inout] Output \(m\) coodinates
d_n – [inout] Output \(n\) coodinates
num_components – [in] Number of RA,Dec coords