Skip to content
Snippets Groups Projects
Commit 6e356d39 authored by Claudio Gheller's avatar Claudio Gheller
Browse files

bug on the UVW normalization fixed

parent 7461a3fc
No related branches found
No related tags found
No related merge requests found
...@@ -104,8 +104,8 @@ int main(int argc, char * argv[]) ...@@ -104,8 +104,8 @@ int main(int argc, char * argv[])
double resolution; double resolution;
// Mesh related parameters: global size // Mesh related parameters: global size
int grid_size_x = 2048; int grid_size_x = 4096;
int grid_size_y = 2048; int grid_size_y = 4096;
// Split Mesh size (auto-calculated) // Split Mesh size (auto-calculated)
int local_grid_size_x; int local_grid_size_x;
int local_grid_size_y; int local_grid_size_y;
...@@ -219,7 +219,7 @@ if(rank == 0){ ...@@ -219,7 +219,7 @@ if(rank == 0){
// INPUT FILES (only the first ndatasets entries are used) // INPUT FILES (only the first ndatasets entries are used)
int ndatasets = 1; int ndatasets = 1;
strcpy(datapath_multi[0],"/homes/gheller/lofar2/gheller/binMS/ZW2_IFRQ_0-1-5.binMS/"); strcpy(datapath_multi[0],"/m100_scratch/userexternal/cgheller/SKA3/ZW2_IFRQ_0-1-5.binMS/");
strcpy(datapath,datapath_multi[0]); strcpy(datapath,datapath_multi[0]);
// Read metadata // Read metadata
...@@ -244,7 +244,7 @@ if(rank == 0){ ...@@ -244,7 +244,7 @@ if(rank == 0){
// WATCH THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // WATCH THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
int nsub = 1000; int nsub = 1000;
//int nsub = 10; //int nsub = 10;
printf("Subtracting last %d measurements\n",nsub); if(rank == 0)printf("Subtracting last %d measurements\n",nsub);
Nmeasures = Nmeasures-nsub; Nmeasures = Nmeasures-nsub;
Nvis = Nmeasures*freq_per_chan*polarisations; Nvis = Nmeasures*freq_per_chan*polarisations;
...@@ -340,12 +340,12 @@ if(rank == 0){ ...@@ -340,12 +340,12 @@ if(rank == 0){
double maxv_all; double maxv_all;
double maxw_all; double maxw_all;
#ifdef USE_MPI #ifdef USE_MPI
MPI_Allreduce(&minu,&minu_all,1, MPI_FLOAT, MPI_MIN, MPI_COMM_WORLD); MPI_Allreduce(&minu,&minu_all,1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
MPI_Allreduce(&minv,&minv_all,1, MPI_FLOAT, MPI_MIN, MPI_COMM_WORLD); MPI_Allreduce(&minv,&minv_all,1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
MPI_Allreduce(&minw,&minw_all,1, MPI_FLOAT, MPI_MIN, MPI_COMM_WORLD); MPI_Allreduce(&minw,&minw_all,1, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD);
MPI_Allreduce(&maxu,&maxu_all,1, MPI_FLOAT, MPI_MAX, MPI_COMM_WORLD); MPI_Allreduce(&maxu,&maxu_all,1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
MPI_Allreduce(&maxv,&maxv_all,1, MPI_FLOAT, MPI_MAX, MPI_COMM_WORLD); MPI_Allreduce(&maxv,&maxv_all,1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
MPI_Allreduce(&maxw,&maxw_all,1, MPI_FLOAT, MPI_MAX, MPI_COMM_WORLD); MPI_Allreduce(&maxw,&maxw_all,1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
#else #else
minu_all = minu; minu_all = minu;
minv_all = minv; minv_all = minv;
...@@ -361,7 +361,6 @@ if(rank == 0){ ...@@ -361,7 +361,6 @@ if(rank == 0){
maxw = maxw_all; maxw = maxw_all;
ming = ming-offset*ming; ming = ming-offset*ming;
maxg = maxg+offset*maxg; maxg = maxg+offset*maxg;
for (long inorm=0; inorm<Nmeasures; inorm++) for (long inorm=0; inorm<Nmeasures; inorm++)
{ {
uu[inorm] = (uu[inorm]+maxg)/(2.0*maxg); uu[inorm] = (uu[inorm]+maxg)/(2.0*maxg);
...@@ -483,7 +482,7 @@ if(rank == 0){ ...@@ -483,7 +482,7 @@ if(rank == 0){
for (int ifiles=0; ifiles<ndatasets; ifiles++) for (int ifiles=0; ifiles<ndatasets; ifiles++)
{ {
strcpy(filename,datapath_multi[ifiles]); strcpy(filename,datapath_multi[ifiles]);
printf("Processing %s, %d of %d\n",filename,ifiles+1,ndatasets); if(rank == 0)printf("Processing %s, %d of %d\n",filename,ifiles+1,ndatasets);
// Read metadata // Read metadata
strcpy(filename,datapath); strcpy(filename,datapath);
...@@ -507,7 +506,7 @@ if(rank == 0){ ...@@ -507,7 +506,7 @@ if(rank == 0){
resolution = 1.0/MAX(abs(uvmin),abs(uvmax)); resolution = 1.0/MAX(abs(uvmin),abs(uvmax));
// calculate the resolution in arcsec // calculate the resolution in arcsec
double resolution_asec = (3600.0*180.0)/MAX(abs(uvmin),abs(uvmax))/PI; double resolution_asec = (3600.0*180.0)/MAX(abs(uvmin),abs(uvmax))/PI;
printf("RESOLUTION = %f rad, %f arcsec\n", resolution, resolution_asec); if(rank == 0)printf("RESOLUTION = %f rad, %f arcsec\n", resolution, resolution_asec);
strcpy(filename,datapath); strcpy(filename,datapath);
strcat(filename,weightsfile); strcat(filename,weightsfile);
...@@ -567,7 +566,6 @@ if(rank == 0){ ...@@ -567,7 +566,6 @@ if(rank == 0){
long icount = 0; long icount = 0;
long ip = 0; long ip = 0;
long inu = 0; long inu = 0;
//CLAAAA
struct sectorlist * current; struct sectorlist * current;
current = sectorhead[isector]; current = sectorhead[isector];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment