RadioImagerGPU 1.0
Loading...
Searching...
No Matches
compute.hpp File Reference
#include <cufft.h>
#include <thrust/complex.h>
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include <cmath>
#include <algorithm>
#include <vector>

Go to the source code of this file.

Functions

void uniformImage (const std::vector< std::vector< std::complex< double > > > &visibilities_batch, const std::vector< std::vector< double > > &u_batch, const std::vector< std::vector< double > > &v_batch, int image_size, std::vector< std::vector< double > > &images, bool use_predefined_params)
 Generate a uniform image from visibilities using FFT.
 
__global__ void mapVisibilitiesMultiDir (cufftDoubleComplex *grid, const cufftDoubleComplex *visibilities, const double *u, const double *v, double uv_max, double grid_res, int image_size, int num_visibilities, int num_directions)
 Map visibilities to a grid for multiple directions (batches).
 
void fftshift (thrust::device_vector< cufftDoubleComplex > &data, int width, int height)
 Perform a 2D FFT shift on a thrust::device_vector.
 
void computeUVW (const std::vector< double > &x_m, const std::vector< double > &y_m, const std::vector< double > &z_m, const std::vector< double > &HAs, const std::vector< double > &Decs, std::vector< std::vector< double > > &u, std::vector< std::vector< double > > &v, std::vector< std::vector< double > > &w)
 Compute UVW coordinates from XYZ coordinates for multiple directions.
 

Function Documentation

◆ computeUVW()

void computeUVW ( const std::vector< double > & x_m,
const std::vector< double > & y_m,
const std::vector< double > & z_m,
const std::vector< double > & HAs,
const std::vector< double > & Decs,
std::vector< std::vector< double > > & u,
std::vector< std::vector< double > > & v,
std::vector< std::vector< double > > & w )

Compute UVW coordinates from XYZ coordinates for multiple directions.

Parameters
x_mX coordinates of the antennas.
y_mY coordinates of the antennas.
z_mZ coordinates of the antennas.
HAsHour angles for multiple directions.
DecsDeclinations for multiple directions.
uOutput U coordinates for multiple directions.
vOutput V coordinates for multiple directions.
wOutput W coordinates for multiple directions.
use_predefined_paramsFlag to determine if predefined parameters should be used.

◆ fftshift()

void fftshift ( thrust::device_vector< cufftDoubleComplex > & data,
int width,
int height )

Perform a 2D FFT shift on a thrust::device_vector.

Parameters
dataData to be shifted.
widthWidth of the data array.
heightHeight of the data array.

◆ mapVisibilitiesMultiDir()

__global__ void mapVisibilitiesMultiDir ( cufftDoubleComplex * grid,
const cufftDoubleComplex * visibilities,
const double * u,
const double * v,
double uv_max,
double grid_res,
int image_size,
int num_visibilities,
int num_directions )

Map visibilities to a grid for multiple directions (batches).

Parameters
gridOutput grid to store the mapped visibilities.
visibilitiesInput visibilities to map.
uU coordinates of visibilities.
vV coordinates of visibilities.
uv_maxMaximum UV coordinate value.
grid_resResolution of the grid.
image_sizeSize of the output image.
num_visibilitiesNumber of visibilities.
num_directionsNumber of directions.

◆ uniformImage()

void uniformImage ( const std::vector< std::vector< std::complex< double > > > & visibilities_batch,
const std::vector< std::vector< double > > & u_batch,
const std::vector< std::vector< double > > & v_batch,
int image_size,
std::vector< std::vector< double > > & images,
bool use_predefined_params )

Generate a uniform image from visibilities using FFT.

Parameters
visibilities_batchBatch of visibilities for multiple directions.
u_batchU coordinates for multiple directions.
v_batchV coordinates for multiple directions.
image_sizeSize of the output image.
imagesOutput images.
use_predefined_paramsFlag to determine if predefined parameters should be used.