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, user_precision_t *u, user_precision_t *v, user_precision_t *w)¶
Use the given baseline lengths in local
X,Y,Zcoords, and a given phase centre, calculateu,v,wcoordinates.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,wfor multiple time steps. Using the indexiBaselineandnum_baselines, this function does a modulus to indexd_X_diff,d_Y_diff,d_Z_diffcorrectly, as these latter arrays do not change with time.- Parameters
d_X_diff – [in] Baseline length in the
Xdirection (metres)d_Y_diff – [in] Baseline length in the
Ydirection (metres)d_Z_diff – [in] Baseline length in the
Zdirection (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_uvwnum_baselines – [in] Number of baselines for a single time step
u – [inout] Output
ucoord (metres)v – [inout] Output
vcoord (metres)w – [inout] Output
wcoord (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_visis, int num_baselines)¶
Calculate the \(u,v,w\) in metres and in wavelengths for multiple time steps and frequencies.
d_X_diff,d_Y_diff,d_Z_diffcontain baseline lengths in localX,Y,Zcoords, which do not change with time, and should be of lengthnum_baselines. To keep indexing simple, the wavelengths ind_wavelengthsand hour angles ind_cha0s, d_sha0sshould contain values for all baselines, all frequencies, and all time steps. They should be entered in sets of baselines so a modules bynum_baselinescan indexd_X_diff,d_Y_diff,d_Z_diffcorrectly.time steps, frequencies, and baselines to be calculated, and should have length
num_visis.When called with
dim3 grid, threads, kernel should be called withgrid.xset, where:grid.x * threads.x >=
num_visis
- Parameters
d_X_diff – [in] Baseline lengths in the
Xdirection (metres)d_Y_diff – [in] Baseline lengths in the
Ydirection (metres)d_Z_diff – [in] Baseline lengths in the
Zdirection (metres)d_u_metres – [inout] Output
ucoords (metres)d_v_metres – [inout] Output
vcoords (metres)d_w_metres – [inout] Output
wcoords (metres)d_u – [inout] Output
ucoord (wavelengths)d_v – [inout] Output
vcoord (wavelengths)d_w – [inout] Output
wcoord (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_visis – [in] Total number of
u,v,wcoords to be calculatednum_baselines – [in] Number of baselines for a single time step
-
__global__ void kern_calc_uvw_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, user_precision_t *d_w_shapes, user_precision_t *d_wavelengths, double *d_lsts, double *d_ras, double *d_decs, const int num_baselines, const int num_visis, const int num_shapes)¶
The SHAPELET visibility envelope calculation uses a
u,v,wcoordinate system where the phase centre is set to the RA/Dec of that particular SHAPELET COMPONENT. This kernel calculates multiple \(u,v,w\) coodinates with varying phase centres to be used later bysource_components.kern_calc_visi_shapelets.The output arrays
d_u_s_metres,d_v_s_metres,d_w_s_metrescontain coordinates for SHAPELET components, baselines, and time steps. The ordering of time and baseline is set byd_lsts, which should contain the local sidereal time for all times (slowest changing), all frequencies, and all baselines (fastest changing). Similarly,d_wavelengthsshould contain the wavelengths for all times (slowest changing), all frequencies, and all baselines (fastest changing). Both these arrays containnum_visisvalues.The outputs
d_u_shapes,d_v_shapes,d_w_shapescontainnum_visis*num_shapesvalues, and are ordered by COMPONENT (slowest changing), all times, all frequencies, and all baselines (fastest changing).When called with
dim3 grid, threads, kernel should be called with bothgrid.xandgrid.yset, where:grid.x * threads.x >=
num_visisgrid.y * threads.y >=
num_shapes
- Parameters
d_X_diff – [in] Baseline lengths in the
Xdirection (metres)d_Y_diff – [in] Baseline lengths in the
Ydirection (metres)d_Z_diff – [in] Baseline lengths in the
Zdirection (metres)d_u_shapes – [inout] Output
ucoords with various phase centres for SHAPELET components (wavelengths)d_v_shapes – [inout] Output
vcoords with various phase centres for SHAPELET components (wavelengths)d_w_shapes – [inout] Output
wcoords with various phase centres for SHAPELET components (wavelengths)d_wavelengths – [in] Wavelengths for all baselines, frequencies, and time steps (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_visis – [in] Total number of visibilities in the simulation (
number_baselines*num_freqs*num_times)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.xset, 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