37 static void reconstruct(
char* filename,
int N,
int M,
int weight)
52 my_N[0]=N; my_n[0]=ceil(N*1.2);
53 my_N[1]=N; my_n[1]=ceil(N*1.2);
54 nfft_init_guru(&my_plan, 2, my_N, M, my_n, 6,flags,
55 FFTW_MEASURE| FFTW_DESTROY_INPUT);
57 fin=fopen(filename,
"r");
59 fweight=fopen(
"weights.dat",
"r");
60 for(j=0;j<my_plan.M_total;j++)
62 fscanf(fweight,
"%le ",&weights);
63 fscanf(fin,
"%le %le %le %le",&my_plan.x[2*j+0],&my_plan.x[2*j+1],&real,&imag);
64 my_plan.f[j] = real + _Complex_I*imag;
66 my_plan.f[j] = my_plan.f[j] * weights;
72 nfft_precompute_psi(&my_plan);
76 nfft_precompute_full_psi(&my_plan);
80 nfft_adjoint(&my_plan);
82 fout_real=fopen(
"output_real.dat",
"w");
83 fout_imag=fopen(
"output_imag.dat",
"w");
86 fprintf(fout_real,
"%le ",creal(my_plan.f_hat[j]));
87 fprintf(fout_imag,
"%le ",cimag(my_plan.f_hat[j]));
94 nfft_finalize(&my_plan);
98 int main(
int argc,
char **argv)
101 printf(
"usage: ./reconstruct_data_gridding FILENAME N M ITER WEIGHTS\n");
104 reconstruct(argv[1],atoi(argv[2]),atoi(argv[3]),atoi(argv[5]));
static void reconstruct(char *filename, int N, int M, int weight)
reconstruct makes a 2d-adjoint-nfft
Header file for the nfft3 library.