37 static void reconstruct(
char* filename,
int N,
int M,
int weight)
50 FFTW_MEASURE| FFTW_DESTROY_INPUT;
53 my_N[0]=N; my_n[0]=ceil(N*1.2);
54 my_N[1]=N; my_n[1]=ceil(N*1.2);
55 nfft_init_guru(&my_plan, 2, my_N, M, my_n, 6,flags,
56 FFTW_MEASURE| FFTW_DESTROY_INPUT);
58 fin=fopen(filename,
"r");
60 fweight=fopen(
"weights.dat",
"r");
63 fscanf(fweight,
"%le ",&weights);
64 fscanf(fin,
"%le %le %le %le",&my_plan.
x[2*j+0],&my_plan.
x[2*j+1],&real,&imag);
65 my_plan.
f[j] = real + _Complex_I*imag;
67 my_plan.
f[j] = my_plan.
f[j] * weights;
83 fout_real=fopen(
"output_real.dat",
"w");
84 fout_imag=fopen(
"output_imag.dat",
"w");
87 fprintf(fout_real,
"%le ",creal(my_plan.
f_hat[j]));
88 fprintf(fout_imag,
"%le ",cimag(my_plan.
f_hat[j]));
99 int main(
int argc,
char **argv)
102 printf(
"usage: ./reconstruct_data_gridding FILENAME N M ITER WEIGHTS\n");
105 reconstruct(argv[1],atoi(argv[2]),atoi(argv[3]),atoi(argv[5]));
fftw_complex * f_hat
Fourier coefficients.
void nfft_precompute_full_psi(nfft_plan *ths)
void nfft_adjoint(nfft_plan *ths)
void nfft_precompute_psi(nfft_plan *ths)
data structure for an NFFT (nonequispaced fast Fourier transform) plan with double precision ...
NFFT_INT M_total
Total number of samples.
void nfft_finalize(nfft_plan *ths)
static void reconstruct(char *filename, int N, int M, int weight)
reconstruct makes a 2d-adjoint-nfft
Header file for the nfft3 library.
double * x
Nodes in time/spatial domain, size is doubles.
unsigned flags
Flags for precomputation, (de)allocation, and FFTW usage, default setting is PRE_PHI_HUT | PRE_PSI | ...