Changeset 1062
- Timestamp:
- Aug 29, 2017 12:55:04 PM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Q.ipf
r1055 r1062 125 125 126 126 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 127 Variable F_LR_sep,F_TB_sep,F_offset,F_sdd_ offset127 Variable F_LR_sep,F_TB_sep,F_offset,F_sdd_setback 128 128 129 129 String folderPath = "root:Packages:NIST:VSANS:VCALC" … … 136 136 F_offset = VCALC_getLateralOffset("FL") 137 137 138 SDD = VCALC_getSDD("FL") //nominal SDD - need offset for TB138 SDD = VCALC_getSDD("FL") //nominal SDD [cm] - need offset for TB 139 139 lam = VCALC_getWavelength() 140 140 141 //separations are in mm -- need to watch the units, convert to cm142 F_LR_sep /= 10143 F_TB_sep /= 10141 //separations are in cm -- 142 // F_LR_sep /= 10 143 // F_TB_sep /= 10 144 144 // TODO - I'm treating the separation as the TOTAL width - so the difference 145 145 // from the "center" to the edge is 1/2 of the separation … … 147 147 // TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 148 148 149 F_sdd_ offset = VCALC_getTopBottomSDDOffset("FT") //T/B are 300 mm farther back //TODO: make all detector parameters global, not hard-wired149 F_sdd_setback = VCALC_getTopBottomSDDSetback("FT") //T/B are 41 cm farther back //TODO: make all detector parameters global, not hard-wired 150 150 151 151 // detector data to bin … … 274 274 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 275 275 // VC_Detector_2Q(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 276 VC_Detector_2Q_NonLin(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_ offset/1000,lam,pixSizeX,pixSizeY,"FT")276 VC_Detector_2Q_NonLin(det_FT,qTot_FT,qx_FT,qy_FT,qz_FT,xCtr,yCtr,sdd+F_sdd_setback,lam,pixSizeX,pixSizeY,"FT") 277 277 278 278 // Print "xy for FT = ",xCtr,yCtr … … 315 315 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 316 316 // VC_Detector_2Q(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_offset/1000,lam,pixSizeX,pixSizeY) 317 VC_Detector_2Q_NonLin(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_ offset/1000,lam,pixSizeX,pixSizeY,"FB")317 VC_Detector_2Q_NonLin(det_FB,qTot_FB,qx_FB,qy_FB,qz_FB,xCtr,yCtr,sdd+F_sdd_setback,lam,pixSizeX,pixSizeY,"FB") 318 318 319 319 // Print "xy for FB = ",xCtr,yCtr … … 347 347 LR_sep = V_Value 348 348 endif 349 //separations on panel are in mm -- need to watch the units, convert to cm350 LR_sep /= 10349 //separations on panel are in cm -- need to watch the units, convert to cm 350 // LR_sep /= 10 351 351 352 352 //detector data … … 570 570 571 571 Variable xCtr,yCtr,sdd,lam,pixSizeX,pixSizeY,nPix_X,nPix_Y 572 Variable M_LR_sep,M_TB_sep,M_offset, M_sdd_ offset572 Variable M_LR_sep,M_TB_sep,M_offset, M_sdd_setback 573 573 574 574 … … 581 581 M_offset = VCALC_getLateralOffset("ML") 582 582 583 SDD = VCALC_getSDD("ML") //nominal SDD - need offset for TB583 SDD = VCALC_getSDD("ML") //nominal SDD [cm] - need offset for TB 584 584 lam = VCALC_getWavelength() 585 585 586 //separations are in mm -- need to watch the units, convert to cm587 M_LR_sep /= 10588 M_TB_sep /= 10586 //separations are in cm -- need to watch the units, convert to cm 587 // M_LR_sep /= 10 588 // M_TB_sep /= 10 589 589 // TODO - I'm treating the separation as the TOTAL width - so the difference 590 590 // from the "center" to the edge is 1/2 of the separation 591 591 592 592 // TODO (make the N along the tube length a variable, since this can be reset @ acquisition) 593 M_sdd_ offset = VCALC_getTopBottomSDDOffset("MT") //T/B are 30cm farther back //TODO: make all detector parameters global, not hard-wired593 M_sdd_setback = VCALC_getTopBottomSDDSetback("MT") //T/B are 41 cm farther back //TODO: make all detector parameters global, not hard-wired 594 594 595 595 … … 723 723 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 724 724 // VC_Detector_2Q(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 725 VC_Detector_2Q_NonLin(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_ offset/1000,lam,pixSizeX,pixSizeY,"MT")725 VC_Detector_2Q_NonLin(det_MT,qTot_MT,qx_MT,qy_MT,qz_MT,xCtr,yCtr,sdd+M_sdd_setback,lam,pixSizeX,pixSizeY,"MT") 726 726 727 727 // Print "xy for MT = ",xCtr,yCtr … … 764 764 // global sdd_offset is in (mm), convert to meters here for the Q-calculation 765 765 // VC_Detector_2Q(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_offset/1000,lam,pixSizeX,pixSizeY) 766 VC_Detector_2Q_NonLin(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_ offset/1000,lam,pixSizeX,pixSizeY,"MB")766 VC_Detector_2Q_NonLin(det_MB,qTot_MB,qx_MB,qy_MB,qz_MB,xCtr,yCtr,sdd+M_sdd_setback,lam,pixSizeX,pixSizeY,"MB") 767 767 768 768 // Print "xy for MB = ",xCtr,yCtr -
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 real-space 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: Hard-wired value!!273 Variable tube_width = 8.4 // TODO: UNITS!!! Hard-wired 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 q-values 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) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_FrontView_Deg.ipf
r955 r1062 41 41 Variable axisRange 42 42 43 // these offset values are in mm !!44 //in mm !! distance T/B are behind L/R - not to be confused with lateral offset45 NVAR front_SDD Offset = root:Packages:NIST:VSANS:VCALC:gFront_SDDOffset46 NVAR middle_SDD Offset = root:Packages:NIST:VSANS:VCALC:gMiddle_SDDOffset43 // these offset values are in cm !! 44 //in cm !! distance T/B are behind L/R - not to be confused with lateral offset 45 NVAR front_SDDsetback = root:Packages:NIST:VSANS:VCALC:gFront_SDDsetback 46 NVAR middle_SDDsetback = root:Packages:NIST:VSANS:VCALC:gMiddle_SDDsetback 47 47 48 48 … … 95 95 96 96 //start drawing from the back, and work to the front as would be visible 97 // ********* all of the dimensions are converted to mm97 // ********* all of the dimensions are in cm 98 98 Variable tmp_x1,tmp_x2,tmp_y1,tmp_y2 99 99 100 100 // back detector +/- degrees 101 tmp_x1 = -atan(B_w/2/(B_SDD *1000)) *(180/pi)101 tmp_x1 = -atan(B_w/2/(B_SDD)) *(180/pi) 102 102 tmp_x2 = -tmp_x1 103 tmp_y1 = -atan(B_h/2/(B_SDD *1000)) *(180/pi)103 tmp_y1 = -atan(B_h/2/(B_SDD)) *(180/pi) 104 104 tmp_y2 = -tmp_y1 105 105 … … 113 113 // TO DO -- add in the additional offset (backwards) to the SDD of the T/B panels 114 114 // TOP 115 tmp_x1 = -atan(M_TB_w/2/(M_SDD *1000+middle_SDDOffset))*(180/pi) // x symmetric y is not115 tmp_x1 = -atan(M_TB_w/2/(M_SDD+middle_SDDsetback))*(180/pi) // x symmetric y is not 116 116 tmp_x2 = -tmp_x1 117 tmp_y1 = atan(M_TB_sep/2/(M_SDD *1000+middle_SDDOffset))*(180/pi)118 tmp_y2 = atan((M_TB_sep/2+M_TB_h)/(M_SDD *1000+middle_SDDOffset))*(180/pi)117 tmp_y1 = atan(M_TB_sep/2/(M_SDD+middle_SDDsetback))*(180/pi) 118 tmp_y2 = atan((M_TB_sep/2+M_TB_h)/(M_SDD+middle_SDDsetback))*(180/pi) 119 119 120 120 // Print tmp_x1,tmp_x2,tmp_y1,tmp_y2 … … 124 124 125 125 // BOTTOM (x unchanged, negate and swap y1,y2) 126 tmp_y1 = -atan((M_TB_sep/2+M_TB_h)/(M_SDD *1000+middle_SDDOffset))*(180/pi)127 tmp_y2 = -atan(M_TB_sep/2/(M_SDD *1000+middle_SDDOffset))*(180/pi)126 tmp_y1 = -atan((M_TB_sep/2+M_TB_h)/(M_SDD+middle_SDDsetback))*(180/pi) 127 tmp_y2 = -atan(M_TB_sep/2/(M_SDD+middle_SDDsetback))*(180/pi) 128 128 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (1,16019,65535) 129 129 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 130 130 131 131 // LEFT 132 tmp_x1 = -atan((M_LR_w+M_LR_sep/2)/(M_SDD *1000))*(180/pi) // y symmetric x is not133 tmp_x2 = -atan((M_LR_sep/2)/(M_SDD *1000))*(180/pi)134 tmp_y1 = atan(M_LR_h/2/(M_SDD *1000))*(180/pi)132 tmp_x1 = -atan((M_LR_w+M_LR_sep/2)/(M_SDD))*(180/pi) // y symmetric x is not 133 tmp_x2 = -atan((M_LR_sep/2)/(M_SDD))*(180/pi) 134 tmp_y1 = atan(M_LR_h/2/(M_SDD))*(180/pi) 135 135 tmp_y2 = -tmp_y1 136 136 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (65535,0,0) 137 137 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 138 138 // RIGHT (x changes, y the same) 139 tmp_x1 = atan((M_LR_sep/2)/(M_SDD *1000))*(180/pi) // y symmetric x is not140 tmp_x2 = atan((M_LR_w+M_LR_sep/2)/(M_SDD *1000))*(180/pi)139 tmp_x1 = atan((M_LR_sep/2)/(M_SDD))*(180/pi) // y symmetric x is not 140 tmp_x2 = atan((M_LR_w+M_LR_sep/2)/(M_SDD))*(180/pi) 141 141 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (65535,0,0) 142 142 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 … … 148 148 // TO DO -- add in the additional offset (backwards) to the SDD of the T/B panels 149 149 // TOP 150 tmp_x1 = -atan(F_TB_w/2/(F_SDD *1000+front_SDDOffset))*(180/pi) // x symmetric y is not150 tmp_x1 = -atan(F_TB_w/2/(F_SDD+front_SDDsetback))*(180/pi) // x symmetric y is not 151 151 tmp_x2 = -tmp_x1 152 tmp_y1 = atan(F_TB_sep/2/(F_SDD *1000+front_SDDOffset))*(180/pi)153 tmp_y2 = atan((F_TB_sep/2+F_TB_h)/(F_SDD *1000+front_SDDOffset))*(180/pi)152 tmp_y1 = atan(F_TB_sep/2/(F_SDD+front_SDDsetback))*(180/pi) 153 tmp_y2 = atan((F_TB_sep/2+F_TB_h)/(F_SDD+front_SDDsetback))*(180/pi) 154 154 155 155 // Print tmp_x1,tmp_x2,tmp_y1,tmp_y2 … … 159 159 160 160 // BOTTOM (x unchanged, negate and swap y1,y2) 161 tmp_y1 = -atan((F_TB_sep/2+F_TB_h)/(F_SDD *1000+front_SDDOffset))*(180/pi)162 tmp_y2 = -atan(F_TB_sep/2/(F_SDD *1000+front_SDDOffset))*(180/pi)161 tmp_y1 = -atan((F_TB_sep/2+F_TB_h)/(F_SDD+front_SDDsetback))*(180/pi) 162 tmp_y2 = -atan(F_TB_sep/2/(F_SDD+front_SDDsetback))*(180/pi) 163 163 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (1,52428,26586) 164 164 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 165 165 166 166 // LEFT 167 tmp_x1 = -atan((F_LR_w+F_LR_sep/2)/(F_SDD *1000))*(180/pi) // y symmetric x is not168 tmp_x2 = -atan((F_LR_sep/2)/(F_SDD *1000))*(180/pi)169 tmp_y1 = atan(F_LR_h/2/(F_SDD *1000))*(180/pi)167 tmp_x1 = -atan((F_LR_w+F_LR_sep/2)/(F_SDD))*(180/pi) // y symmetric x is not 168 tmp_x2 = -atan((F_LR_sep/2)/(F_SDD))*(180/pi) 169 tmp_y1 = atan(F_LR_h/2/(F_SDD))*(180/pi) 170 170 tmp_y2 = -tmp_y1 171 171 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (39321,26208,1) 172 172 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 173 173 // RIGHT (x changes, y the same) 174 tmp_x1 = atan((F_LR_sep/2)/(F_SDD *1000))*(180/pi) // y symmetric x is not175 tmp_x2 = atan((F_LR_w+F_LR_sep/2)/(F_SDD *1000))*(180/pi)174 tmp_x1 = atan((F_LR_sep/2)/(F_SDD))*(180/pi) // y symmetric x is not 175 tmp_x2 = atan((F_LR_w+F_LR_sep/2)/(F_SDD))*(180/pi) 176 176 SetDrawEnv/W=VCALC#FrontView xcoord= bottom,ycoord= left,fillfgc= (39321,26208,1) 177 177 DrawRect/W=VCALC#FrontView tmp_x1,tmp_y2,tmp_x2,tmp_y1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_SideView.ipf
r954 r1062 81 81 Variable B_SDD, B_offset 82 82 83 NVAR TB_SDD_ offset = gFront_SDDOffset //in mm !!distance T/B are behind L/R - not to be confused with lateral offset83 NVAR TB_SDD_setback = gFront_SDDsetback //in [cm] distance T/B are behind L/R - not to be confused with lateral offset 84 84 85 85 //front … … 115 115 116 116 // FRONT 117 FT_profileX = F_SDD+TB_SDD_offset/1000 //SDD in meters, set back from L/R ---- convert to meters for the plot117 FT_profileX = (F_SDD+TB_SDD_setback) //SDD in [cm], set back from L/R ---- convert to meters for the plot? 118 118 FB_profileX = FT_profileX 119 119 120 FT_profileY[0] = F_TB_sep // separation in mm121 FT_profileY[1] = FT_profileY[0] + F_TB_h // add in height of T/B panel in mm120 FT_profileY[0] = F_TB_sep // separation in cm 121 FT_profileY[1] = FT_profileY[0] + F_TB_h // add in height of T/B panel in cm 122 122 123 123 FB_profileY = -FT_profileY … … 125 125 //angles (not calculating anything, just connect the dots) 126 126 FT_rayX[0] = 0 127 FT_rayX[1] = F_SDD+TB_SDD_ offset/1000128 FT_rayX[2] = F_SDD+TB_SDD_ offset/1000127 FT_rayX[1] = F_SDD+TB_SDD_setback 128 FT_rayX[2] = F_SDD+TB_SDD_setback 129 129 FT_rayX[3] = 0 130 130 … … 136 136 137 137 FB_rayX[0] = 0 138 FB_rayX[1] = F_SDD+TB_SDD_ offset/1000139 FB_rayX[2] = F_SDD+TB_SDD_ offset/1000138 FB_rayX[1] = F_SDD+TB_SDD_setback 139 FB_rayX[2] = F_SDD+TB_SDD_setback 140 140 FB_rayX[3] = 0 141 141 … … 147 147 148 148 // MIDDLE 149 MT_profileX = M_SDD+TB_SDD_ offset/1000 //SDD in meters149 MT_profileX = M_SDD+TB_SDD_setback //SDD in [cm] 150 150 MB_profileX = MT_profileX 151 151 152 MT_profileY[0] = M_TB_sep // separation in mm153 MT_profileY[1] = MT_profileY[0] + M_TB_h // add in height of T/B panel in mm152 MT_profileY[0] = M_TB_sep // separation in cm 153 MT_profileY[1] = MT_profileY[0] + M_TB_h // add in height of T/B panel in cm 154 154 155 155 MB_profileY = -MT_profileY … … 157 157 //angles (not calculating anything, just connect the dots) 158 158 MT_rayX[0] = 0 159 MT_rayX[1] = M_SDD+TB_SDD_ offset/1000160 MT_rayX[2] = M_SDD+TB_SDD_ offset/1000159 MT_rayX[1] = M_SDD+TB_SDD_setback 160 MT_rayX[2] = M_SDD+TB_SDD_setback 161 161 MT_rayX[3] = 0 162 162 … … 168 168 169 169 MB_rayX[0] = 0 170 MB_rayX[1] = M_SDD+TB_SDD_ offset/1000171 MB_rayX[2] = M_SDD+TB_SDD_ offset/1000170 MB_rayX[1] = M_SDD+TB_SDD_setback 171 MB_rayX[2] = M_SDD+TB_SDD_setback 172 172 MB_rayX[3] = 0 173 173 … … 178 178 179 179 // BACK 180 B_S_profileX = B_SDD //SDDb in meters180 B_S_profileX = B_SDD //SDDb in [cm] 181 181 182 182 B_S_profileY[0] = B_h/2 // half-height … … 230 230 ModifyGraph/W=VCALC#SideView mirror=2 231 231 ModifyGraph/W=VCALC#SideView nticks(left)=8 232 Label/W=VCALC#SideView left "\\Z10Vertical position ( mm)"233 Label/W=VCALC#SideView bottom "\\Z10SDD ( meters)"234 SetAxis/W=VCALC#SideView left -80 0,800235 SetAxis/W=VCALC#SideView bottom 0,25 232 Label/W=VCALC#SideView left "\\Z10Vertical position (cm)" 233 Label/W=VCALC#SideView bottom "\\Z10SDD (cm)" 234 SetAxis/W=VCALC#SideView left -80.0,80.0 235 SetAxis/W=VCALC#SideView bottom 0,2500 236 236 // TextBox/W=VCALC#SideView/C/N=text0/A=MC/X=22.54/Y=42.04 "\\JCSIDE VIEW\rOnly the Top/Bottom panels are shown" 237 237 TextBox/W=VCALC#SideView/C/N=text0/A=MC/X=40.15/Y=43.62 "\\JCSIDE VIEW\r= Top/Bottom panels" … … 337 337 338 338 // FRONT 339 FL_profileX = F_SDD //SDD in meters339 FL_profileX = F_SDD //SDD in [cm] 340 340 FR_profileX = FL_profileX 341 341 342 FL_profileY[0] = F_LR_sep // separation in mm343 FL_profileY[1] = FL_profileY[0] + F_LR_w // add in width of L/R panel in mm342 FL_profileY[0] = F_LR_sep // separation in cm 343 FL_profileY[1] = FL_profileY[0] + F_LR_w // add in width of L/R panel in cm 344 344 345 345 FR_profileY = -FL_profileY … … 369 369 370 370 // MIDDLE 371 ML_profileX = M_SDD //SDD in meters371 ML_profileX = M_SDD //SDD in [cm] 372 372 MR_profileX = ML_profileX 373 373 374 ML_profileY[0] = M_LR_sep // separation in mm375 ML_profileY[1] = ML_profileY[0] + M_LR_w // add in width of L/R panel in mm374 ML_profileY[0] = M_LR_sep // separation in cm 375 ML_profileY[1] = ML_profileY[0] + M_LR_w // add in width of L/R panel in cm 376 376 377 377 MR_profileY = -ML_profileY … … 400 400 401 401 // BACK 402 B_T_profileX = B_SDD //SDDb in meters402 B_T_profileX = B_SDD //SDDb in [cm] 403 403 404 404 B_T_profileY[0] = B_h/2 // half-height … … 452 452 ModifyGraph/W=VCALC#TopView mirror=2 453 453 ModifyGraph/W=VCALC#TopView nticks(left)=8 454 Label/W=VCALC#TopView left "\\Z10Horizontal position ( mm)"455 Label/W=VCALC#TopView bottom "\\Z10SDD ( meters)"456 SetAxis/W=VCALC#TopView left -80 0,800457 SetAxis/W=VCALC#TopView bottom 0,25 454 Label/W=VCALC#TopView left "\\Z10Horizontal position (cm)" 455 Label/W=VCALC#TopView bottom "\\Z10SDD (cm)" 456 SetAxis/W=VCALC#TopView left -80.0,80.0 457 SetAxis/W=VCALC#TopView bottom 0,2500 458 458 TextBox/W=VCALC#TopView/C/N=text0/A=MC/X=41.61/Y=43.62 "\\JCTOP VIEW\r= Left/Right panels" 459 459 endif -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_UtilityProcedures.ipf
r994 r1062 19 19 20 20 21 // returns the nominal SDD from the panel -- value is METERS22 // Does NOT include the set back (offset)of the T/B panels. This is a separate value21 // returns the nominal SDD from the panel -- value is [cm] 22 // Does NOT include the setback of the T/B panels. This is a separate value 23 23 Function VCALC_getSDD(type) 24 24 String type … … 62 62 end 63 63 64 // returns the panel separation [ mm]64 // returns the panel separation [cm] 65 65 Function VCALC_getPanelSeparation(type) 66 66 String type … … 107 107 end 108 108 109 // returns the lateral panel offset [ mm]109 // returns the lateral panel offset [cm] 110 110 Function VCALC_getLateralOffset(type) 111 111 String type … … 381 381 382 382 // SDD offset of the top/bottom panels 383 // value returned is in mm (so beware)384 // 385 Function VCALC_getTopBottomSDD Offset(type)383 // value returned is in [cm] 384 // 385 Function VCALC_getTopBottomSDDSetback(type) 386 386 String type 387 387 … … 396 396 case "FT": 397 397 case "FB": 398 NVAR sdd_ offset = gFront_SDDOffset //T/B are 300 mm farther back398 NVAR sdd_setback = gFront_SDDsetback //T/B are 41 cm farther back 399 399 break 400 400 … … 406 406 case "MT": 407 407 case "MB": 408 NVAR sdd_ offset = gMiddle_SDDOffset //T/B are 300 mm farther back408 NVAR sdd_setback = gMiddle_SDDsetback //T/B are 41 cm farther back 409 409 break 410 410 … … 415 415 416 416 default: 417 Print "Error -- type not found in VCALC_getTopBottomSDD Offset(type)"418 sdd_ offset= 0 //no match for type417 Print "Error -- type not found in VCALC_getTopBottomSDDSetback(type)" 418 sdd_setback = 0 //no match for type 419 419 endswitch 420 420 421 421 SetDataFolder root: 422 422 423 return(sdd_ offset)423 return(sdd_setback) 424 424 End 425 425 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r1055 r1062 166 166 167 167 // tab(2) - Front detector panels, initially not visible 168 SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation ( mm)",proc=VC_FDet_LR_SetVarProc169 SetVariable VCALCCtrl_2a,limits={0,40 0,1},disable=1,value=_NUM:100170 SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation ( mm)",proc=VC_FDet_LR_SetVarProc171 SetVariable VCALCCtrl_2b,limits={0,40 0,1},disable=1,value=_NUM:100172 SetVariable VCALCCtrl_2c,pos={205,290},size={150,15},title="Lateral Offset (mm)"173 SetVariable VCALCCtrl_2c,limits={0,200,0.1},disable=1,value=_NUM:0174 SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance ( m)",proc=VC_FDet_SDD_SetVarProc175 SetVariable VCALCCtrl_2d,limits={1 ,8,0.1},disable=1 ,value=_NUM:1.5168 SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation (cm)",proc=VC_FDet_LR_SetVarProc 169 SetVariable VCALCCtrl_2a,limits={0,40,1},disable=1,value=_NUM:20 170 SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation (cm)",proc=VC_FDet_LR_SetVarProc 171 SetVariable VCALCCtrl_2b,limits={0,40,1},disable=1,value=_NUM:20 172 // SetVariable VCALCCtrl_2c,pos={205,290},size={150,15},title="Lateral Offset (cm)" 173 // SetVariable VCALCCtrl_2c,limits={0,20,0.1},disable=1,value=_NUM:0 174 SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance (cm)",proc=VC_FDet_SDD_SetVarProc 175 SetVariable VCALCCtrl_2d,limits={100,800,1},disable=1 ,value=_NUM:150 176 176 177 177 178 178 // tab(3) - Middle detector panels, initially not visible 179 SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation ( mm)",proc=VC_MDet_LR_SetVarProc180 SetVariable VCALCCtrl_3a,limits={0,40 0,1},disable=1,value=_NUM:100181 SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation ( mm)",proc=VC_MDet_LR_SetVarProc182 SetVariable VCALCCtrl_3b,limits={0,40 0,1},disable=1,value=_NUM:100183 SetVariable VCALCCtrl_3c,pos={205,290},size={150,15},title="Lateral Offset (mm)"184 SetVariable VCALCCtrl_3c,limits={0,200,0.1},disable=1,value=_NUM:0185 SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance ( m)",proc=VC_MDet_SDD_SetVarProc186 SetVariable VCALCCtrl_3d,limits={8 ,20,0.1},disable=1,value=_NUM:15179 SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation (cm)",proc=VC_MDet_LR_SetVarProc 180 SetVariable VCALCCtrl_3a,limits={0,40.0,1},disable=1,value=_NUM:20 181 SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation (cm)",proc=VC_MDet_LR_SetVarProc 182 SetVariable VCALCCtrl_3b,limits={0,40.0,1},disable=1,value=_NUM:20 183 // SetVariable VCALCCtrl_3c,pos={205,290},size={150,15},title="Lateral Offset (cm)" 184 // SetVariable VCALCCtrl_3c,limits={0,20,0.1},disable=1,value=_NUM:0 185 SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (cm)",proc=VC_MDet_SDD_SetVarProc 186 SetVariable VCALCCtrl_3d,limits={800,2000,1},disable=1,value=_NUM:1500 187 187 188 188 // tab(4) - Back detector panel 189 SetVariable VCALCCtrl_4a,pos={188,290},size={150,15},title="Lateral Offset ( mm)"190 SetVariable VCALCCtrl_4a,limits={0,20 0,0.1},disable=1,value=_NUM:0191 SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance ( m)",proc=VC_BDet_SDD_SetVarProc192 SetVariable VCALCCtrl_4b,limits={20 ,25,0.1},disable=1,value=_NUM:20193 PopupMenu VCALCCtrl_4c,pos={40,260},size={180,20},title="Detector type",disable=1194 PopupMenu VCALCCtrl_4c,mode=1,popvalue="2D",value= root:Packages:NIST:VSANS:VCALC:gBackDetType189 SetVariable VCALCCtrl_4a,pos={188,290},size={150,15},title="Lateral Offset (cm)" 190 SetVariable VCALCCtrl_4a,limits={0,20,0.1},disable=1,value=_NUM:0 191 SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (cm)",proc=VC_BDet_SDD_SetVarProc 192 SetVariable VCALCCtrl_4b,limits={2000,2500,1},disable=1,value=_NUM:2000 193 // PopupMenu VCALCCtrl_4c,pos={40,260},size={180,20},title="Detector type",disable=1 194 // PopupMenu VCALCCtrl_4c,mode=1,popvalue="2D",value= root:Packages:NIST:VSANS:VCALC:gBackDetType 195 195 196 196 // tab(5) - Simulation setup … … 675 675 // Width and height are not part of the Nexus file definition, but are needed for VCALC drawing 676 676 // so keep them as variables 677 Variable/G gFront_LR_w = 38 4 //front bank, nominal LR panel width (mm)678 Variable/G gFront_LR_h = 100 0679 Variable/G gFront_TB_w = 50 0680 Variable/G gFront_TB_h = 38 4681 682 // SDD offsetof T/B (decide on units??)677 Variable/G gFront_LR_w = 38.4 //front bank, nominal LR panel width [cm] 678 Variable/G gFront_LR_h = 100.0 679 Variable/G gFront_TB_w = 50.0 680 Variable/G gFront_TB_h = 38.4 681 682 // SDD setback of T/B (decide on units??) 683 683 // for the Nexus file, the detector distance should already be corrected for the "setback" 684 684 // of the T/B panels. keep as VCALC variable 685 Variable/G gFront_SDD Offset = 300 // (mm)685 Variable/G gFront_SDDsetback = 41.0 // [cm] 686 686 687 687 … … 741 741 // Width and height are not part of the Nexus file definition, but are needed for VCALC drawing 742 742 // so keep them as variables 743 Variable/G gMiddle_LR_w = 38 4 //middle bank, nominal LR panel width (mm)744 Variable/G gMiddle_LR_h = 100 0745 Variable/G gMiddle_TB_w = 50 0746 Variable/G gMiddle_TB_h = 38 4743 Variable/G gMiddle_LR_w = 38.4 //middle bank, nominal LR panel width (cm) 744 Variable/G gMiddle_LR_h = 100.0 745 Variable/G gMiddle_TB_w = 50.0 746 Variable/G gMiddle_TB_h = 38.4 747 747 // SDD offset of T/B (decide on units??) 748 748 // for the Nexus file, the detector distance should already be corrected for the "setback" 749 749 // of the T/B panels. keep as VCALC variable 750 Variable/G gMiddle_SDD Offset = 300 // (mm)750 Variable/G gMiddle_SDDsetback = 41.0 // [cm] 751 751 752 752 // detector resolution (xy for each bank!) … … 804 804 805 805 //// BACK DETECTOR 806 Variable/G gBack_w = 15 0 //w and h for the back detector, (mm) 150 pix * 1mm/pix807 Variable/G gBack_h = 15 0806 Variable/G gBack_w = 15.0 //w and h for the back detector, (cm) 150 pix * 1mm/pix 807 Variable/G gBack_h = 15.0 808 808 809 809 Make/O/D/N=1 :entry:instrument:detector_B:x_pixel_size = 0.1 // 1 mm resolution (units of cm here) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1061 r1062 155 155 156 156 // kPanelTouchingGap is in mm 157 gap = kPanelTouchingGap /10 //cm157 gap = kPanelTouchingGap 158 158 159 159 if(cmpstr(orientation,"vertical")==0) … … 165 165 if(cmpstr(fname,"VCALC")== 0 ) 166 166 offset = VCALC_getPanelSeparation(detStr) 167 offset /= 2 // units of mm 167 offset *= 10 // convert to units of mm 168 offset /= 2 // 1/2 the total separation 169 if(cmpstr("L",detStr[1]) == 0) 170 offset *= -1 //negative value for L 171 endif 168 172 else 169 173 //normal case 170 offset = V_getDet_LateralOffset(fname,detStr)171 offset *= 10 //convert cm to mm174 offset = V_getDet_LateralOffset(fname,detStr) 175 offset *= 10 //convert cm to mm 172 176 endif 173 177 174 178 // calculation is in mm, not cm 179 // offset will be a negative value for the L panel, and positive for the R panel 175 180 if(kBCTR_CM) 176 181 if(cmpstr("L",detStr[1]) == 0) 177 data_realDistX[][] = -offset - (dimX - p)*tube_width // TODO should this be dimX-1-p = 47-p? 182 data_realDistX[][] = offset - (dimX - p)*tube_width // TODO should this be dimX-1-p = 47-p? 183 // data_realDistX[][] = -offset - (dimX - p)*tube_width // TODO should this be dimX-1-p = 47-p? 178 184 else 179 185 data_realDistX[][] += offset + gap + tube_width //add to the Right det, not recalculate … … 189 195 if(cmpstr(fname,"VCALC")== 0 ) 190 196 offset = VCALC_getPanelSeparation(detStr) 191 offset /= 2 // units of mm 197 offset *= 10 // convert to units of mm 198 offset /= 2 // 1/2 the total separation 199 if(cmpstr("B",detStr[1]) == 0) 200 offset *= -1 // negative value for Bottom det 201 endif 192 202 else 193 203 //normal case … … 200 210 data_realDistY[][] += offset + gap + tube_width 201 211 else 202 data_realDistY[][] = -offset - (dimY - q)*tube_width // TODO should this be dimY-1-q = 47-q?212 data_realDistY[][] = offset - (dimY - q)*tube_width // TODO should this be dimY-1-q = 47-q? 203 213 endif 204 214 endif -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_RAW_Data_Panel.ipf
r1061 r1062 62 62 V_FakeStatusButtonClick() 63 63 64 // NOTE: This is where the beam center is picked up so that the panel array scaling is reset 65 // so that the images will automatically display in relation to the beam center 64 66 V_FakeRestorePanelsButtonClick() //so the panels display correctly 65 67 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf
r1055 r1062 51 51 V_writeDetectorData(fileName,detStr,tmpData) 52 52 53 val = VCALC_getSDD(detStr) *100// make sure value is in cm53 val = VCALC_getSDD(detStr) // make sure value is in cm 54 54 print val 55 55 V_writeDet_distance(fileName,detStr,val) 56 56 57 val = VCALC_getTopBottomSDD Offset(detStr)//val is in mm, as for data file57 val = VCALC_getTopBottomSDDSetback(detStr)*10 //val is in mm, as for data file 58 58 if(val != 0) 59 59 V_writeDet_TBSetback(fileName,detStr,val) 60 60 endif 61 61 62 // returns the total separation (assumed symmetric) in mm62 // returns the total separation (assumed symmetric) in cm 63 63 val = VCALC_getPanelSeparation(detStr) 64 val /= 2 *10 // to get half of the separation, and convert tocm for the data file64 val /= 2 // to get half of the separation, and cm for the data file 65 65 // it's OK to call both of these. these functions check detStr for the correct value 66 if(cmpstr("L",detStr[1]) == 0 || cmpstr("B",detStr[1]) == 0) 67 val *= -1 // negative separation position for L and Bottom 68 endif 66 69 V_writeDet_LateralOffset(fileName,detStr,val) 67 70 V_writeDet_VerticalOffset(fileName,detStr,val) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/Vx_NexusFromIgor.ipf
r1023 r1062 2168 2168 data = root:Packages:NIST:VSANS:VCALC:Middle:det_MT 2169 2169 nx_distance = VCALC_getSDD("MT") 2170 sdd_offset = VCALC_getTopBottomSDD Offset("MT")2170 sdd_offset = VCALC_getTopBottomSDDSetback("MT") 2171 2171 separation = VCALC_getPanelSeparation("MT") 2172 2172 spatial_calibration[0][] = 1.072 … … 2176 2176 data = root:Packages:NIST:VSANS:VCALC:Middle:det_MB 2177 2177 nx_distance = VCALC_getSDD("MB") 2178 sdd_offset = VCALC_getTopBottomSDD Offset("MB")2178 sdd_offset = VCALC_getTopBottomSDDSetback("MB") 2179 2179 separation = VCALC_getPanelSeparation("MB") 2180 2180 spatial_calibration[0][] = 1.072 … … 2198 2198 data = root:Packages:NIST:VSANS:VCALC:Front:det_FT 2199 2199 nx_distance = VCALC_getSDD("FT") 2200 sdd_offset = VCALC_getTopBottomSDD Offset("FT")2200 sdd_offset = VCALC_getTopBottomSDDSetback("FT") 2201 2201 separation = VCALC_getPanelSeparation("FT") 2202 2202 spatial_calibration[0][] = 1.072 … … 2206 2206 data = root:Packages:NIST:VSANS:VCALC:Front:det_FB 2207 2207 nx_distance = VCALC_getSDD("FB") 2208 sdd_offset = VCALC_getTopBottomSDD Offset("FB")2208 sdd_offset = VCALC_getTopBottomSDDSetback("FB") 2209 2209 separation = VCALC_getPanelSeparation("FB") 2210 2210 spatial_calibration[0][] = 1.072 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/Vx_Nexus_VSANS_Write.ipf
r1023 r1062 97 97 // data = root:Packages:NIST:VSANS:VCALC:Middle:det_MT 98 98 // nx_distance = VCALC_getSDD("MT") 99 // sdd_offset = VCALC_getTopBottomSDD Offset("MT")99 // sdd_offset = VCALC_getTopBottomSDDSetback("MT") 100 100 // separation = VCALC_getPanelSeparation("MT") 101 101 // spatial_calibration[0][] = 1.072 … … 105 105 // data = root:Packages:NIST:VSANS:VCALC:Middle:det_MB 106 106 // nx_distance = VCALC_getSDD("MB") 107 // sdd_offset = VCALC_getTopBottomSDD Offset("MB")107 // sdd_offset = VCALC_getTopBottomSDDSetback("MB") 108 108 // separation = VCALC_getPanelSeparation("MB") 109 109 // spatial_calibration[0][] = 1.072 … … 127 127 // data = root:Packages:NIST:VSANS:VCALC:Front:det_FT 128 128 // nx_distance = VCALC_getSDD("FT") 129 // sdd_offset = VCALC_getTopBottomSDD Offset("FT")129 // sdd_offset = VCALC_getTopBottomSDDSetback("FT") 130 130 // separation = VCALC_getPanelSeparation("FT") 131 131 // spatial_calibration[0][] = 1.072 … … 135 135 // data = root:Packages:NIST:VSANS:VCALC:Front:det_FB 136 136 // nx_distance = VCALC_getSDD("FB") 137 // sdd_offset = VCALC_getTopBottomSDD Offset("FB")137 // sdd_offset = VCALC_getTopBottomSDDSetback("FB") 138 138 // separation = VCALC_getPanelSeparation("FB") 139 139 // spatial_calibration[0][] = 1.072
Note: See TracChangeset
for help on using the changeset viewer.