diff --git a/inverse-imaging.c b/inverse-imaging.c index 66c16031c8e7db8d4ddc4d9e0a749b5df906d228..d3e154de957c562a0d21c184eb274943fcca50a0 100644 --- a/inverse-imaging.c +++ b/inverse-imaging.c @@ -84,7 +84,7 @@ int main(int argc, char * argv[]) // Image related files char imagepath[900] = "./"; #ifdef FITSIO - char imagename[FILENAMELENGTH] = "image_name.fits"; + char imagename[FILENAMELENGTH] = "test.fits"; #else char imagename[FILENAMELENGTH] = "image_name.bin"; #endif @@ -113,8 +113,8 @@ int main(int argc, char * argv[]) double resolution; // Mesh related parameters: global size - int grid_size_x = 2048; - int grid_size_y = 2048; + int grid_size_x = 1024; + int grid_size_y = 1024; // Split Mesh size (auto-calculated) int local_grid_size_x; int local_grid_size_y; @@ -215,7 +215,7 @@ if(rank == 0){ // INPUT FILES (only the first ndatasets entries are used) int ndatasets = 1; - strcpy(datapath_multi[0],"/m100_scratch/userexternal/cgheller/gridding/Lofar/L798046_SB244_uv.uncorr_130B27932t_146MHz.pre-cal.binMS/"); + strcpy(datapath_multi[0],"/m100_scratch/userexternal/cgheller/inverse_imaging/L798046_SB244_uv.uncorr_130B27932t_146MHz.pre-cal.binMS/"); strcpy(datapath,datapath_multi[0]); // Read metadata @@ -363,8 +363,10 @@ if(rank == 0){ int naxis; long * naxes; fits_get_img_dim(fptr, &naxis, &status); + printf("number of axis: %d\n",naxis); naxes = (long *)malloc(sizeof(long)*naxis); fits_get_img_size(fptr, naxis, naxes, &status); + printf("image size (from FITS file): %d\n",naxes[0]); if (naxes[0] != xaxis){ printf("Wrong Image Size : %d vs %d\n",naxes[0],xaxis); exit(2); @@ -378,11 +380,11 @@ if(rank == 0){ fpixel[0] = 1; lpixel[0] = xaxis; inc[0] = 1; - fpixel[1] = 1; - lpixel[1] = rank*yaxis+1; + fpixel[1] = rank*yaxis+1; + lpixel[1] = (rank+1)*yaxis+1; inc[1] = 1; - - fits_read_subset(fptr, TFLOAT, fpixel, lpixel, inc, NULL, image_real, &anynul, &status); + fits_read_subset(fptr, TDOUBLE, fpixel, lpixel, inc, NULL, image_real, &anynul, &status); + //fits_read_img(fptr, TDOUBLE, 1, xaxis*yaxis, NULL, image_real, &anynul, &status); fits_close_file(fptr, &status); #else @@ -394,7 +396,12 @@ if(rank == 0){ fclose(pFilereal); #endif // image read - // We read binary images, however we can easily extend to fits files + + #ifdef WRITE_DATA + pFilereal = fopen ("revtest.bin","wb"); + fwrite(image_real, xaxis*yaxis, sizeof(double), pFilereal); + fclose(pFilereal); + #endif if(rank == 0)printf("FFT TRANSFORMING (from Real to Complex Fourier space)\n"); @@ -521,6 +528,7 @@ if(rank == 0){ #endif #endif //WRITE_DATA + exit(3); if(rank == 0)printf("CREATING LINKED LISTS\n");