Changeset 206 for sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/WorkFileUtils.ipf
 Timestamp:
 Nov 18, 2007 4:15:52 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/WorkFileUtils.ipf
r116 r206 367 367 Variable ii,jj,dtdist,dtdis2 368 368 Variable xi,xd,yd,rad,ratio,domega,xy 369 Variable lambda 369 370 370 371 // Print "...doing jacobian and nonlinear corrections" 372 NVAR pixelsX = root:myGlobals:gNPixelsX 373 NVAR pixelsY = root:myGlobals:gNPixelsY 371 374 372 375 //set up values to send to auxiliary trig functions 373 xcenter = 64.5 374 ycenter = 64.5 376 xcenter = pixelsX/2 + 0.5 // == 64.5 for 128x128 Ordela 377 ycenter = pixelsY/2 + 0.5 // == 64.5 for 128x128 Ordela 378 375 379 x0 = realsread[16] 376 380 y0 = realsread[17] … … 383 387 dtdis2 = dtdist^2 384 388 389 lambda = realsRead[26] 390 385 391 xx0 = dc_fx(x0,sx,sx3,xcenter) 386 392 yy0 = dc_fy(y0,sy,sy3,ycenter) 387 393 388 NVAR pixelsX = root:myGlobals:gNPixelsX 389 // NVAR pixelsY = root:myGlobals:gNPixelsY 394 390 395 //waves to contain repeated function calls 391 Make/O/N=(pixelsX) fyy,xx,yy //Assumes square detector 396 Make/O/N=(pixelsX) fyy,xx,yy //Assumes square detector !!! 392 397 ii=0 393 398 do … … 399 404 while(ii<pixelsX) 400 405 401 // Make/O/N=(pixelsX,pixelsX) SolidAngle 406 // Make/O/N=(pixelsX,pixelsX) SolidAngle // testing only 402 407 403 408 ii=0 … … 413 418 domega = rad/dtdist 414 419 ratio = domega^3 415 // solidAngle[ii][jj] = ratio 420 // solidAngle[ii][jj] = ratio //testing only 416 421 xy = xx[ii]*yy[jj] 417 422 data[ii][jj] *= xy*ratio 423 424 // multiplicative correction for detector efficiency JBG memo det_eff_cor2.doc 3/20/07 425 // correction inserted 11/2007 SRK 426 427 data[ii][jj] *= DetEffCorr(lambda,dtdist,xd,yd) 428 429 // solidAngle[ii][jj] = DetEffCorr(lambda,dtdist,xd,yd) //testing only 430 418 431 jj+=1 419 432 while(jj<pixelsX) … … 422 435 423 436 //clean up waves 424 Killwaves/Z fyy,xx,yy437 // Killwaves/Z fyy,xx,yy 425 438 426 439 Return(0) … … 467 480 End 468 481 482 //distances passed in are in mm 483 // dtdist is SDD 484 // xd and yd are distances from the beam center to the current pixel 485 // 486 Function DetEffCorr(lambda,dtdist,xd,yd) 487 Variable lambda,dtdist,xd,yd 488 489 Variable theta,cosT,ff,stAl,stHe 490 491 theta = atan( (sqrt(xd^2 + yd^2))/dtdist ) 492 cosT = cos(theta) 493 494 stAl = 0.00967*lambda*0.8 //dimensionless, constants from JGB memo 495 stHe = 0.146*lambda*2.5 496 497 ff = exp(stAl/cosT)*(1exp(stHe/cosT)) / ( exp(stAl)*(1exp(stHe)) ) 498 499 return(ff) 500 End 469 501 //****************** 470 502 //direct port of the FORTRAN code for calculating the weighted
Note: See TracChangeset
for help on using the changeset viewer.