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(float *d_X_diff, float *d_Y_diff, float *d_Z_diff, float sdec0, float cdec0, float sha0, float cha0, int iBaseline, int num_baselines, float *u, float *v, float *w)

Use the given baseline lengths in local X,Y,Z coords, and a given phase centre, calculate u,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 by kern_calc_uvw, which calculates u,v,w for multiple time steps. Using the index iBaseline and num_baselines, this function does a modulus to index d_X_diff, d_Y_diff, d_Z_diff correctly, as these latter arrays do not 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

  • u[inout] Output u coord (metres)

  • v[inout] Output v coord (metres)

  • w[inout] Output w coord (metres)

__global__ void kern_calc_uvw(float *d_X_diff, float *d_Y_diff, float *d_Z_diff, float *d_u_metres, float *d_v_metres, float *d_w_metres, float *d_u, float *d_v, float *d_w, float *d_wavelengths, float sdec0, float cdec0, float *d_cha0s, float *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_diff contain baseline lengths in local X,Y,Z coords, which do not change with time, and should be of length num_baselines. To keep indexing simple, the wavelengths in d_wavelengths and hour angles in d_cha0s, d_sha0s should contain values for all baselines, all frequencies, and all time steps. They should be entered in sets of baselines so a modules by num_baselines can index d_X_diff, d_Y_diff, d_Z_diff correctly.

time steps, frequencies, and baselines to be calculated, and should have length num_visis.

When called with dim3 grid, threads, kernel should be called with grid.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_visis[in] Total number of u,v,w coords to be calculated

  • num_baselines[in] Number of baselines for a single time step

__global__ void kern_calc_uvw_shapelet(float *d_X_diff, float *d_Y_diff, float *d_Z_diff, float *d_u_shapes, float *d_v_shapes, float *d_w_shapes, float *d_wavelengths, float *d_lsts, float *d_ras, float *d_decs, const int num_baselines, const int num_visis, const int num_shapes)

The SHAPELET visibility envelope calculation uses a u,v,w coordinate 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 by source_components.kern_calc_visi_shapelets.

The output arrays d_u_s_metres, d_v_s_metres, d_w_s_metres contain coordinates for SHAPELET components, baselines, and time steps. The ordering of time and baseline is set by d_lsts, which should contain the local sidereal time for all times (slowest changing), all frequencies, and all baselines (fastest changing). Similarly, d_wavelengths should contain the wavelengths for all times (slowest changing), all frequencies, and all baselines (fastest changing). Both these arrays contain num_visis values.

The outputs d_u_shapes, d_v_shapes, d_w_shapes contain num_visis*num_shapes values, 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 both grid.x and grid.y set, where:

  • grid.x * threads.x >= num_visis

  • 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 (wavelengths)

  • d_v_shapes[inout] Output v coords with various phase centres for SHAPELET components (wavelengths)

  • d_w_shapes[inout] Output w coords 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(float ra0, float sdec0, float cdec0, float ra, float dec, float *l, float *m, float *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(float ra0, float sdec0, float cdec0, float *d_ras, float *d_decs, float *d_l, float *d_m, float *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 with grid.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