Changeset 673 for sans/XOP_Dev/MonteCarlo/MonteCarlo.c
- Timestamp:
- Apr 9, 2010 1:46:29 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/XOP_Dev/MonteCarlo/MonteCarlo.c
r623 r673 13 13 #include "DebyeSpheres.h" 14 14 15 static int gCallSpinProcess = 1; // Set to 1 to all user abort (cmd dot) and background processing.15 //static int gCallSpinProcess = 1; // Set to 1 to all user abort (cmd dot) and background processing. 16 16 17 17 ////////// … … 60 60 long n1,n2,n3; 61 61 double dth,zz,xx,yy,phi; 62 double theta,ran,ll,rr ,ttot;62 double theta,ran,ll,rr; 63 63 long done,find_theta,err; //used as logicals 64 64 long xPixel,yPixel; … … 73 73 // for accessing the 2D wave data, direct method (see the WaveAccess example XOP) 74 74 waveHndl wavH; 75 int waveType,hState;75 // int waveType,hState; 76 76 long numDimensions; 77 77 long dimensionSizes[MAX_DIMENSIONS+1]; 78 char* dataStartPtr; 79 long dataOffset; 80 long numRows, numColumns,numRows_ran_dev; 81 double *dp0, *dp, value[2]; // Pointers used for double data. 78 // char* dataStartPtr; 79 // long dataOffset; 80 // long numRows, numColumns; 81 long numRows_ran_dev; 82 // double *dp0, *dp; 83 double value[2]; // Pointers used for double data. 82 84 long seed; 83 85 long indices[MAX_DIMENSIONS]; 84 86 85 char buf[256];87 // char buf[256]; 86 88 87 89 /* check that wave handles are all valid */ … … 154 156 sig_incoh = inputWave[9]; 155 157 sig_sas = inputWave[10]; 156 xCtr_long = round(xCtr);157 yCtr_long = round(yCtr);158 xCtr_long = (long)(xCtr+0.5); 159 yCtr_long = (long)(yCtr+0.5); 158 160 159 161 dummy = MDGetWaveScaling(p->ran_devH, 0, &delta, &left); //0 is the rows … … 368 370 //Choose index for scattering angle array. 369 371 //IND = NINT(THETA_z/DTH + 0.4999999) 370 ind = round(theta_z/dth + 0.4999999); //round is eqivalent to nint()372 ind = (long)(theta_z/dth + 0.4999999); //round is eqivalent to nint() 371 373 nt[ind] += 1; //Increment bin for angle. 372 374 //Increment angle array for single scattering events. … … 408 410 //indices[0] = xCtr_long; //don't put everything in one pixel 409 411 //indices[1] = yCtr_long; 410 indices[0] = (long) round(xCtr+xx/pixSize);411 indices[1] = (long) round(yCtr+yy/pixSize);412 indices[0] = (long)(xCtr+xx/pixSize+0.5); 413 indices[1] = (long)(yCtr+yy/pixSize+0.5); 412 414 // check for valid indices - got an XOP error, probably from here 413 415 if(indices[0] > 127) indices[0] = 127; … … 483 485 theta = 2.0*asin(qy*lam/4.0/pi); 484 486 dy = sdd*tan(theta); 485 *yPixel = round(yCtr + dy/pixSize);487 *yPixel = (long)(yCtr + dy/pixSize+0.5); 486 488 487 489 theta = 2.0*asin(qx*lam/4.0/pi); 488 490 dx = sdd*tan(theta); 489 *xPixel = round(xCtr + dx/pixSize);491 *xPixel = (long)(xCtr + dx/pixSize+0.5); 490 492 491 493 //if on detector, return xPix and yPix values, otherwise -1
Note: See TracChangeset
for help on using the changeset viewer.