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_diff contain baseline lengths in local X,Y,Z coords, which can change with time (when precessed back to J2000), so should be of length num_baselines*num_times. To keep indexing simple, the wavelengths in wavelengths and hour angles in cha0s, sha0s should contain values for all baselines, all frequencies, and all time steps. .

Parameters:
  • X_diff[in] Baseline lengths in the X direction (metres)

  • Y_diff[in] Baseline lengths in the Y direction (metres)

  • Z_diff[in] Baseline lengths in the Z direction (metres)

  • u_metres[inout] Output u coords (metres)

  • v_metres[inout] Output v coords (metres)

  • w_metres[inout] Output w coords (metres)

  • us[inout] Output u coord (wavelengths)

  • vs[inout] Output v coord (wavelengths)

  • ws[inout] Output w coord (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,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

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,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 by source_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 X direction (metres)

  • Y_diff[in] Baseline lengths in the Y direction (metres)

  • Z_diff[in] Baseline lengths in the Z direction (metres)

  • u_shapes[inout] Output u coords with various phase centres for SHAPELET components (metres)

  • v_shapes[inout] Output v coords 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 components struct. Assumes components->ras, components->decs have been allocated and set on the device.

Runs calc_lmn_cpu using components->ras, components->decs and woden_settings->ra0, woden_settings->sdec0, woden_settings->cdec0 as inputs. This function allocates device memory for components->ls, components->ms, and components->ns, and puts the results in these arrays.

Parameters:
  • components[inout] Initialised components_t struct containing the ra and dec arrays

  • num_components[in] Number of RA,Dec coords in components

  • woden_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_cross is the number of cross-correlations, so fill any uvw after this by adding num_autos worth 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