RadioImagerGPU 1.0
Loading...
Searching...
No Matches
compute.hpp
Go to the documentation of this file.
1// include/compute.hpp
2#ifndef COMPUTE_HPP
3#define COMPUTE_HPP
4
5#include <cufft.h>
6#include <thrust/complex.h>
7#include <thrust/device_vector.h>
8#include <thrust/host_vector.h>
9#include <cmath>
10#include <algorithm>
11#include <vector>
12
13// Function declarations
14void uniformImage(const std::vector<std::vector<std::complex<double>>>& visibilities_batch,
15 const std::vector<std::vector<double>>& u_batch, const std::vector<std::vector<double>>& v_batch,
16 int image_size, std::vector<std::vector<double>>& images, bool use_predefined_params);
17
18__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);
19
20void fftshift(thrust::device_vector<cufftDoubleComplex>& data, int width, int height);
21
22void computeUVW(const std::vector<double>& x_m, const std::vector<double>& y_m, const std::vector<double>& z_m,
23 const std::vector<double>& HAs, const std::vector<double>& Decs,
24 std::vector<std::vector<double>>& u, std::vector<std::vector<double>>& v, std::vector<std::vector<double>>& w);
25
26#endif
void fftshift(thrust::device_vector< cufftDoubleComplex > &data, int width, int height)
Perform a 2D FFT shift on a thrust::device_vector.
Definition compute.cu:123
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.
Definition compute.cu:206
__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).
Definition compute.cu:160
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.
Definition compute.cu:374