- Timestamp:
- Feb 5, 2016 12:46:18 PM (7 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r970 r978 660 660 661 661 // detector resolution (xy for each bank!) 662 Variable/G gFront_L_pixelX = 0.8 // (cm) these tubes are vertical662 Variable/G gFront_L_pixelX = 0.84 // (cm) these tubes are vertical 8.4 mm spacing (JGB 2/2106) 663 663 Variable/G gFront_L_pixelY = 0.8 // (cm) //!! now 8 mm, since nPix=128, rather than 256 664 Variable/G gFront_R_pixelX = 0.8 // (cm)664 Variable/G gFront_R_pixelX = 0.84 // (cm) 665 665 Variable/G gFront_R_pixelY = 0.8 // (cm) 666 666 667 667 Variable/G gFront_T_pixelX = 0.4 // (cm) these tubes are horizontal 668 Variable/G gFront_T_pixelY = 0.8 // (cm)668 Variable/G gFront_T_pixelY = 0.84 // (cm) 669 669 Variable/G gFront_B_pixelX = 0.4 // (cm) 670 Variable/G gFront_B_pixelY = 0.8 // (cm)670 Variable/G gFront_B_pixelY = 0.84 // (cm) 671 671 672 672 // number of pixels in each bank (this can be modified at acquisition time, so it must be adjustable here) … … 692 692 693 693 // detector resolution (xy for each bank!) 694 Variable/G gMiddle_L_pixelX = 0.8 // (cm) these tubes are vertical694 Variable/G gMiddle_L_pixelX = 0.8 4 // (cm) these tubes are vertical 695 695 Variable/G gMiddle_L_pixelY = 0.8 // (cm) 696 Variable/G gMiddle_R_pixelX = 0.8 // (cm)696 Variable/G gMiddle_R_pixelX = 0.8 4 // (cm) 697 697 Variable/G gMiddle_R_pixelY = 0.8 // (cm) 698 698 699 699 Variable/G gMiddle_T_pixelX = 0.4 // (cm) these tubes are horizontal 700 Variable/G gMiddle_T_pixelY = 0.8 // (cm)700 Variable/G gMiddle_T_pixelY = 0.84 // (cm) 701 701 Variable/G gMiddle_B_pixelX = 0.4 // (cm) 702 Variable/G gMiddle_B_pixelY = 0.8 // (cm)702 Variable/G gMiddle_B_pixelY = 0.8 4 // (cm) 703 703 704 704 // number of pixels in each bank (this can be modified at acquisition time, so it must be adjustable here) … … 773 773 // to fill in: 774 774 // values for always-visible items 775 String/G gPresetPopStr = "Low Q;High Q;Converging Pinholes;Narrow Slit Aperture; Converging Slits;White Beam;Polarizer;"775 String/G gPresetPopStr = "Low Q;High Q;Converging Pinholes;Narrow Slit Aperture;White Beam;Polarizer;" 776 776 String/G gBinTypeStr = "One;Two;Four;Slit Mode;" 777 777 … … 782 782 // tab 0 - collimation 783 783 String/G gMonochromatorType = "Velocity Selector;Graphite;White Beam;" 784 String/G gSourceShape = "circular;rectangular;converging pinholes; converging slits;"784 String/G gSourceShape = "circular;rectangular;converging pinholes;" 785 785 String/G gSourceDiam = "1.0 cm;2.0 cm;5.0 cm;" 786 786 String/G gDeltaLambda = "0.10;0.20;0.30;" … … 788 788 // tab 1 - sample conditions 789 789 String/G gTableLocation = "Changer;Stage;" 790 String/G gSampleApertureShape = "circular;rectangular;converging pinholes; converging slits;"790 String/G gSampleApertureShape = "circular;rectangular;converging pinholes;" 791 791 String/G gSampleApertureDiam = "0.5;1.0;1.5;2.0;" 792 792 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r977 r978 93 93 SetScale/I y ctr,ctr+48,"",det_MT 94 94 // det_mt[][20] = 50 95 det_MT *= 10 95 96 96 97 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB … … 99 100 SetScale/I x -npix/2,npix/2,"",det_MB 100 101 SetScale/I y -ctr,-ctr-48,"",det_MB 102 det_MB *= 5 101 103 102 104 ctr=30 … … 106 108 SetScale/I x -ctr-48,-ctr,"",det_ML 107 109 SetScale/I y -npix/2,npix/2,"",det_ML 110 det_ML *= 2 108 111 109 112 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR … … 213 216 // -- if not, read the file in, then return the value 214 217 // 218 // TODO: 219 // currently, the work folders have the following path - so passing in "RAW" as fname 220 // will take some re-configuring. 221 // root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL:distance 222 // -- be sure this read from work folders is not broken in the future, and is passed to ALL of the 223 // top-level R/W routines. (Write is necessary ONLY for SIM data files. Patch is direct to disk.) 215 224 Function V_getRealValueFromHDF5(fname,path) 216 225 String fname,path … … 220 229 221 230 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 231 232 // check for a work folder first (note that "entry" is doubled) 233 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path)) 234 Wave/Z w = $("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path) 235 return(w[0]) 236 endif 222 237 223 238 if(Exists(ksBaseDFPath+folderStr+":"+path)) … … 257 272 258 273 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 259 274 275 // check for a work folder first (note that "entry" is doubled) 276 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path)) 277 Wave wOut = $("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path) 278 return wOut 279 endif 280 260 281 if(Exists(ksBaseDFPath+folderStr+":"+path)) 261 282 valExists=1 … … 291 312 292 313 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 314 315 // check for a work folder first (note that "entry" is doubled) 316 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path)) 317 Wave/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path) 318 return wOut 319 endif 293 320 294 321 if(Exists(ksBaseDFPath+folderStr+":"+path)) … … 351 378 352 379 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 380 381 // check for a work folder first (note that "entry" is doubled) 382 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path)) 383 Wave/Z/T tw = $("root:Packages:NIST:VSANS:"+folderStr+":entry:"+path) 384 return(tw[0]) 385 endif 353 386 354 387 if(Exists(ksBaseDFPath+folderStr+":"+path)) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r977 r978 47 47 // TODO: update the information here - in either case 48 48 // what isn't automatically picked up? What is "stale" on the display? 49 49 String/G root:Packages:NIST:VSANS:Globals:gCurDispType = type 50 DoWindow/T VSANS_Data,type + " VSANS_Data" 50 51 end 51 52 … … 65 66 String/G gCurDispFile = "default string" 66 67 String/G gCurTitle = "" 68 String/G gCurDispType = "" 67 69 68 70 SetDataFolder root: … … 79 81 ShowTools/A 80 82 81 DoWindow/T VSANS_Data,"VSANS_Data"//+cur_folder 83 String curFolder = root:Packages:NIST:VSANS:Globals:gCurDispType 84 DoWindow/T VSANS_Data,curFolder + " VSANS_Data" 82 85 SetWindow VSANS_Data,hook(dataHook)=VSANSDataHook,hookevents=2 83 86 … … 113 116 114 117 TitleBox title_file,pos={606,178},size={76,20},variable= file_name 115 TitleBox title_status,pos={606,210},size={76,20},variable= file_name118 TitleBox title_status,pos={606,210},size={76,20},variable= root:Packages:NIST:VSANS:Globals:gCurDispFile 116 119 117 120 Button button_tagFile,pos={603,412},size={70,20},proc=TagFileButtonProc,title="Tag File" … … 121 124 TitleBox title_xy,pos={24,71},size={76,20},variable= file_name 122 125 Slider slider_hi,pos={558,224},size={16,80},proc=HiMapSliderProc 123 Slider slider_hi,limits={0, 2,0},value= 2,ticks= 0126 Slider slider_hi,limits={0,1,0},value= 1,ticks= 0 124 127 Slider slider_lo,pos={558,315},size={16,80},proc=LowMapSliderProc 125 Slider slider_lo,limits={0, 2,0},value= 0,ticks= 0128 Slider slider_lo,limits={0,1,0},value= 0,ticks= 0 126 129 127 130 SetVariable xpos,pos={22,97},size={50,17},title="X " … … 182 185 // 183 186 // event code 4 = mouse moved 187 // 188 // mouse moved is the only event that I really care about for the data display. 184 189 // 185 190 // TODO … … 209 214 NVAR xloc = root:Packages:NIST:VSANS:Globals:gXPos 210 215 NVAR yloc = root:Packages:NIST:VSANS:Globals:gYPos 211 Variable xaxval,yaxval 216 NVAR gQX = root:Packages:NIST:VSANS:Globals:gQX 217 NVAR gQY = root:Packages:NIST:VSANS:Globals:gQY 218 NVAR gQQ = root:Packages:NIST:VSANS:Globals:gQQ 219 NVAR gNCounts = root:Packages:NIST:VSANS:Globals:gNCounts 220 SVAR gCurDispFile = root:Packages:NIST:VSANS:Globals:gCurDispFile 221 SVAR gCurDispType = root:Packages:NIST:VSANS:Globals:gCurDispType //the current folder 222 Variable xaxval,yaxval,tab 212 223 213 224 // is the mouse location within the "main" display window? … … 215 226 // right now, the "main" display is at (50,185,545,620). its name depends on the active tab 216 227 228 // xloc = s.mouseLoc.h 229 // yloc = s.mouseLoc.v 230 217 231 // if out of bounds, exit now 218 // TODO - currently the values are hard-wired. eliminate this 232 // TODO - currently the values are hard-wired. eliminate this later if the size of the graph changes 219 233 if(s.mouseLoc.h < 50 || s.mouseLoc.h > 545 || s.mouseLoc.v < 185 || s.mouseLoc.v > 620) 220 234 break … … 223 237 // if(in bounds) 224 238 // get the point location 225 // update the globals 226 // if detectors are drawn to scale on the graph, then qxqy can be calculated 239 // update the globals -- 227 240 // but which data instance am I pointing to? 241 // deduce the carriage and panel, and calculate Q 228 242 // endif 229 243 230 244 GetWindow $s.winName activeSW 231 String activeSubwindow = S_value 232 if (CmpStr(activeSubwindow,"VSANS_Data#det_panelsF") == 0) 233 // front active, do something 234 // xloc = s.mouseLoc.h 235 // yloc = s.mouseLoc.v 245 String activeSubwindow = S_value // returns something like: "VSANS_Data#det_panelsF" 236 246 237 xaxval= AxisValFromPixel("","bottom",s.mouseLoc.h) 238 yaxval= AxisValFromPixel("","left",s.mouseLoc.v) 239 xloc = round(xaxval) 240 yloc = round(yaxval) 241 endif 242 243 break 247 xaxval= AxisValFromPixel("","bottom",s.mouseLoc.h) 248 yaxval= AxisValFromPixel("","left",s.mouseLoc.v) 249 xloc = round(xaxval) 250 yloc = round(yaxval) 251 252 // which tab is selected? -this is the main graph panel (subwindow may not be the active one!) 253 ControlInfo/W=VSANS_Data tab0 254 tab = V_Value 255 if(tab == 0) 256 activeSubwindow = "VSANS_Data#det_panelsF" 257 elseif (tab == 1) 258 activeSubwindow = "VSANS_Data#det_panelsM" 259 else 260 activeSubwindow = "VSANS_Data#det_panelsB" 261 endif 262 263 // which images are here? 264 String detStr="",imStr,carriageStr 265 String currentImageRef 266 String imageList = ImageNameList(activeSubwindow,";") 267 Variable ii,nIm,testX,testY,xctr,yctr,sdd,lam,pixSizeX,pixSizeY 268 nIm = ItemsInList(imageList,";") 269 gCurDispFile = imageList 270 if(nIm==0) 271 break //problem, get out 272 endif 273 274 // images were added in the order TBLR, so look back through in the order RLBT, checking each to see if 275 // the xy value is found on that (scaled) array 276 277 // loop backwards through the list of panels (may only be one if on the back) 278 for(ii=nIm-1;ii>=0;ii-=1) 279 Wave w = ImageNameToWaveRef(activeSubwindow,StringFromList(ii, imageList,";")) 280 281 // which, if any image is the mouse xy location on? 282 // use a multidemensional equivalent to x2pnt: (ScaledDimPos - DimOffset(waveName, dim))/DimDelta(waveName,dim) 283 testX = trunc( (xloc - DimOffset(w,0))/DimDelta(w,0) ) 284 testY = trunc( (yloc - DimOffset(w,1))/DimDelta(w,1) ) 285 286 if( (testX > 0 && testX < DimSize(w,0)) && (testY > 0 && testY < DimSize(w,1)) ) 287 // we're in-bounds on this wave 288 289 // count value to the global 290 gNCounts = w[testX][testY] 291 292 // deduce the detector panel 293 currentImageRef = StringFromList(ii, imageList,";") //the image instance ## 294 // string is "data", or "data#2" etc. - so this returns "", "1", "2", or "3" 295 imStr = StringFromList(1, currentImageRef,"#") 296 carriageStr = activeSubWindow[strlen(activeSubWindow)-1] 297 298 if(cmpstr(carriageStr,"B")==0) 299 detStr = carriageStr 300 else 301 if(strlen(imStr)==0) 302 imStr = "9" // a dummy value so I can replace it later 303 endif 304 detStr = carriageStr+imStr // "F2" or something similar 305 detStr = ReplaceString("9", detStr, "T") // ASSUMPTION :::: instances 0123 correspond to TBLR 306 detStr = ReplaceString("1", detStr, "B") // ASSUMPTION :::: this is the order that the panels 307 detStr = ReplaceString("2", detStr, "L") // ASSUMPTION :::: are ALWAYS added to the graph 308 detStr = ReplaceString("3", detStr, "R") // ASSUMPTION :::: 309 endif 310 gCurDispFile = detStr 311 312 // now figure out q 313 // calculate the q-values, will be different depending on which panel is up (pixel size, geometry, etc.) 314 // TODO: !!!! get rid of the hard-wired values 315 // TODO: be sure that the units from HDF are what I expect 316 // TODO: beam center XY are pixels in the file, expected in the function, but are better suited for mm or cm 317 // TODO: units of xy pixel size are likely wrong 318 xctr = V_getDet_beam_center_x(gCurDispType,detStr) //written in pixels 319 yctr = V_getDet_beam_center_y(gCurDispType,detStr) 320 sdd = V_getDet_distance(gCurDispType,detStr) / 100 //written in cm, pass in meters 321 lam = V_getVSWavelength(gCurDispType) //A 322 pixSizeX = V_getDet_x_pixel_size(gCurDispType,detStr)/10 // written mm? need cm 323 pixSizeY = V_getDet_y_pixel_size(gCurDispType,detStr)/10 // written mm? need cm 324 325 gQQ = V_CalcQval(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 326 gQX = V_CalcQX(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 327 gQY = V_CalcQY(xaxval+1,yaxval+1,xctr,yctr,sdd,lam,pixSizeX,pixSizeY) 328 329 ii = -1 //look no further, set ii to bad value to exit the for loop 330 endif //end if(mouse is over a detector panel) 331 endfor // end loop over list of displayed images 332 333 break 334 244 335 // And so on . . . 245 336 endswitch … … 341 432 CheckDisplayed /W=VSANS_Data#det_panelsF det_FL 342 433 if(V_flag == 0) 434 AppendImage/W=VSANS_Data#det_panelsF det_FT 343 435 AppendImage/W=VSANS_Data#det_panelsF det_FB 344 AppendImage/W=VSANS_Data#det_panelsF det_FT345 436 AppendImage/W=VSANS_Data#det_panelsF det_FL 346 437 AppendImage/W=VSANS_Data#det_panelsF det_FR 438 // ModifyImage/W=VSANS_Data#det_panelsF det_FT ctab= {*,*,ColdWarm,0} 347 439 // ModifyImage/W=VSANS_Data#det_panelsF det_FB ctab= {*,*,ColdWarm,0} 348 // ModifyImage/W=VSANS_Data#det_panelsF det_FT ctab= {*,*,ColdWarm,0}349 440 // ModifyImage/W=VSANS_Data#det_panelsF det_FL ctab= {*,*,ColdWarm,0} 350 441 // ModifyImage/W=VSANS_Data#det_panelsF det_FR ctab= {*,*,ColdWarm,0} … … 605 696 // link this slider to the "high" end of the color mapping for whatever is currently displayed 606 697 // 698 // -- see Buttons.ipf for the old SANS implementation 699 // 607 700 Function HiMapSliderProc(sa) : SliderControl 608 701 STRUCT WMSliderAction &sa … … 625 718 // link this slider to the "low" end of the color mapping for whatever is currently displayed 626 719 // 720 // -- see Buttons.ipf for the old SANS implementation 721 // 627 722 Function LowMapSliderProc(sa) : SliderControl 628 723 STRUCT WMSliderAction &sa … … 642 737 643 738 644
Note: See TracChangeset
for help on using the changeset viewer.