 Timestamp:
 Aug 29, 2017 12:55:04 PM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1055 r1062 36 36 // need SDD 37 37 // need pixel dimensions 38 // nominal sdd in meters, offset in mm, want result in cm !39 sdd = VCALC_getSDD(type) *100 + VCALC_getTopBottomSDDOffset(type) / 10// result is sdd in [cm]38 // nominal sdd in cm, offset in cm, want result in cm ! 39 sdd = VCALC_getSDD(type) + VCALC_getTopBottomSDDSetback(type) // result is sdd in [cm] 40 40 41 41 pixSizeX = VCALC_getPixSizeX(type) // cm … … 193 193 // 194 194 // 195 //  sdd in meters195 //  sdd in cm 196 196 //  lambda in Angstroms 197 197 Function VC_Detector_2Q(data,qTot,qx,qy,qz,xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY) … … 215 215 // reverts to the "regular" linear detector if waves not found or a flag is set 216 216 // 217 // need to convert the beam center to mm218 217 // need to call the VSANS V_CalcQval routines (these use the realspace distance, not pixel dims) 218 // 219 // ***** everything passed in is [cm], except for wavelength [A] 220 // 221 // **** TODO :: calibration constants are still in [mm] 222 // 219 223 // 220 224 // TODO: … … 267 271 268 272 // Wave w_calib = V_getDetTube_spatialCalib("VCALC",detStr) 269 Variable tube_width = 8.4 // TODO: Hardwired value!!273 Variable tube_width = 8.4 // TODO: UNITS!!! Hardwired value in [mm] 270 274 if(cmpstr(detStr,"B") == 0) 271 275 V_NonLinearCorrection_B("VCALC",data,tmpCalib,tmpCalib,detStr,destPath) … … 280 284 if(kBCTR_CM) 281 285 if(gUseNonLinearDet && WaveExists(data_realDistX) && WaveExists(data_realDistY)) 282 // no need to convert the beam centers to real space, just to mm 283 xCtr *= 10 // convert from cm to mm 284 yCtr *= 10 286 // beam ctr is in cm already 287 285 288 // calculate all of the qvalues 286 289 qTot = V_CalcQval(p,q,xCtr,yCtr,sdd,lam,data_realDistX,data_realDistY) … … 365 368 //and are in detector coordinates (1,128) rather than axis values 366 369 //the pixel locations need not be integers, reals are ok inputs 367 //sdd is in meters370 //sdd is in [cm] 368 371 //wavelength is in Angstroms 369 372 // … … 376 379 Variable dx,dy,qval,two_theta,dist 377 380 378 sdd *=100 //convert to cm 381 379 382 dx = (xaxval  xctr)*pixSizeX //delta x in cm 380 383 dy = (yaxval  yctr)*pixSizeY //delta y in cm … … 392 395 //ALL inputs are in detector coordinates 393 396 // 394 //sdd is in meters397 //sdd is in [cm] 395 398 //wavelength is in Angstroms 396 399 // … … 405 408 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 406 409 407 sdd *=100 //convert to cm410 // sdd *=100 //convert to cm 408 411 dx = (xaxval  xctr)*pixSizeX //delta x in cm 409 412 dy = (yaxval  yctr)*pixSizeY //delta y in cm … … 422 425 //input/output is the same as CalcQval() 423 426 //ALL inputs are in detector coordinates 424 //sdd is in meters427 //sdd is in [cm] 425 428 //wavelength is in Angstroms 426 429 // … … 435 438 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 436 439 437 sdd *=100 //convert to cm440 // sdd *=100 //convert to cm 438 441 dx = (xaxval  xctr)*pixSizeX //delta x in cm 439 442 dy = (yaxval  yctr)*pixSizeY //delta y in cm … … 452 455 //input/output is the same as CalcQval() 453 456 //ALL inputs are in detector coordinates 454 //sdd is in meters457 //sdd is in [cm] 455 458 //wavelength is in Angstroms 456 459 // … … 464 467 qval = VC_CalcQval(xaxval,yaxval,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 465 468 466 sdd *=100 //convert to cm469 // sdd *=100 //convert to cm 467 470 468 471 //get scattering angle to project onto flat detector => Qr = qval*cos(theta)
Note: See TracChangeset
for help on using the changeset viewer.