Ignore:
Timestamp:
Feb 25, 2016 4:30:38 PM (7 years ago)
Author:
srkline
Message:

more changes and additons to display VSANS data

adding functions for IvsQ plotting

coverted much of VCALC to have similar folder structure as HDF to allow re-use of the Q-binning procedures from VCALC with real data in work files.

re-working the beam center finder to get it to work with work file data rather then only VCALC.

new plotting routines for the panels to rescale to the beam center (still in pixels, though)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf

    r979 r982  
    2121         
    2222                //initialize space = folders, parameters, instrument constants, etc. 
    23                 V_Initialize_Space() 
     23                VC_Initialize_Space() 
    2424                 
    2525                //open the panel 
     
    4646//      sva.dval = 0.3 
    4747 
    48         V_BDet_SDD_SetVarProc(sva)               
    49         V_MDet_SDD_SetVarProc(sva) 
    50         V_FDet_SDD_SetVarProc(sva) 
     48        VC_BDet_SDD_SetVarProc(sva)              
     49        VC_MDet_SDD_SetVarProc(sva) 
     50        VC_FDet_SDD_SetVarProc(sva) 
    5151 
    5252        return(0) 
     
    7272        PopupMenu popup_a,mode=1,popvalue="Low Q",value= root:Packages:NIST:VSANS:VCALC:gPresetPopStr 
    7373 
    74         PopupMenu popup_b,pos={690,310},size={142,20},title="Binning type",proc=V_RebinIQ_PopProc 
     74        PopupMenu popup_b,pos={690,310},size={142,20},title="Binning type",proc=VC_RebinIQ_PopProc 
    7575        PopupMenu popup_b,mode=1,popvalue="One",value= root:Packages:NIST:VSANS:VCALC:gBinTypeStr 
    7676         
     
    145145        Slider VCALCCtrl_0a,pos={223,324},size={200,45},limits={0,10,1},value= 1,vert= 0 
    146146        SetVariable VCALCCtrl_0b,pos={25,294},size={120,15},title="wavelength" 
    147         SetVariable VCALCCtrl_0b,limits={4,20,1},value=_NUM:8,proc=V_Lambda_SetVarProc 
     147        SetVariable VCALCCtrl_0b,limits={4,20,1},value=_NUM:8,proc=VC_Lambda_SetVarProc 
    148148        PopupMenu VCALCCtrl_0c,pos={26,257},size={150,20},title="monochromator" 
    149149        PopupMenu VCALCCtrl_0c,mode=1,popvalue="Velocity Selector",value= root:Packages:NIST:VSANS:VCALC:gMonochromatorType 
     
    166166 
    167167// tab(2) - Front detector panels, initially not visible 
    168         SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=V_FDet_LR_SetVarProc 
     168        SetVariable VCALCCtrl_2a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=VC_FDet_LR_SetVarProc 
    169169        SetVariable VCALCCtrl_2a,limits={0,400,1},disable=1,value=_NUM:100 
    170         SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=V_FDet_LR_SetVarProc 
     170        SetVariable VCALCCtrl_2b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=VC_FDet_LR_SetVarProc 
    171171        SetVariable VCALCCtrl_2b,limits={0,400,1},disable=1,value=_NUM:100 
    172172        SetVariable VCALCCtrl_2c,pos={205,290},size={150,15},title="Lateral Offset (mm)" 
    173173        SetVariable VCALCCtrl_2c,limits={0,200,0.1},disable=1,value=_NUM:0 
    174         SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=V_FDet_SDD_SetVarProc 
     174        SetVariable VCALCCtrl_2d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_FDet_SDD_SetVarProc 
    175175        SetVariable VCALCCtrl_2d,limits={1,8,0.1},disable=1     ,value=_NUM:1.5 
    176176         
    177177 
    178178// tab(3) - Middle detector panels, initially not visible 
    179         SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=V_MDet_LR_SetVarProc 
     179        SetVariable VCALCCtrl_3a,pos={30,260},size={150,15},title="L/R Separation (mm)",proc=VC_MDet_LR_SetVarProc 
    180180        SetVariable VCALCCtrl_3a,limits={0,400,1},disable=1,value=_NUM:120 
    181         SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=V_MDet_LR_SetVarProc 
     181        SetVariable VCALCCtrl_3b,pos={30,290},size={150,15},title="T/B Separation (mm)",proc=VC_MDet_LR_SetVarProc 
    182182        SetVariable VCALCCtrl_3b,limits={0,400,1},disable=1,value=_NUM:120 
    183183        SetVariable VCALCCtrl_3c,pos={205,290},size={150,15},title="Lateral Offset (mm)" 
    184184        SetVariable VCALCCtrl_3c,limits={0,200,0.1},disable=1,value=_NUM:0 
    185         SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=V_MDet_SDD_SetVarProc 
     185        SetVariable VCALCCtrl_3d,pos={205,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_MDet_SDD_SetVarProc 
    186186        SetVariable VCALCCtrl_3d,limits={8,20,0.1},disable=1,value=_NUM:10 
    187187         
     
    189189        SetVariable VCALCCtrl_4a,pos={188,290},size={150,15},title="Lateral Offset (mm)" 
    190190        SetVariable VCALCCtrl_4a,limits={0,200,0.1},disable=1,value=_NUM:0 
    191         SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (m)",proc=V_BDet_SDD_SetVarProc 
     191        SetVariable VCALCCtrl_4b,pos={188,260},size={230,15},title="Sample to Detector Distance (m)",proc=VC_BDet_SDD_SetVarProc 
    192192        SetVariable VCALCCtrl_4b,limits={20,25,0.1},disable=1,value=_NUM:22 
    193193        PopupMenu VCALCCtrl_4c,pos={40,260},size={180,20},title="Detector type",disable=1 
     
    196196// tab(5) - Simulation setup 
    197197        SetVariable VCALCCtrl_5a,pos={40,290},size={200,15},title="Neutrons on Sample (imon)" 
    198         SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e10,proc=V_SimImon_SetVarProc 
     198        SetVariable VCALCCtrl_5a,limits={1e7,1e15,1e7},disable=1,value=_NUM:1e10,proc=VC_SimImon_SetVarProc 
    199199        PopupMenu VCALCCtrl_5b,pos={40,260},size={180,20},title="Model Function",disable=1 
    200         PopupMenu VCALCCtrl_5b,mode=1,popvalue="Debye",value= root:Packages:NIST:VSANS:VCALC:gModelFunctionType,proc=V_SimModelFunc_PopProc 
     200        PopupMenu VCALCCtrl_5b,mode=1,popvalue="Debye",value= root:Packages:NIST:VSANS:VCALC:gModelFunctionType,proc=VC_SimModelFunc_PopProc 
    201201         
    202202End 
     
    297297// recalculate the detectors with a preset model function 
    298298// 
    299 Function V_SimModelFunc_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 
     299Function VC_SimModelFunc_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 
    300300        String ctrlName 
    301301        Variable popNum // which item is currently selected (1-based) 
     
    312312// just rebin 
    313313// 
    314 Function V_RebinIQ_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 
     314Function VC_RebinIQ_PopProc(ctrlName,popNum,popStr) : PopupMenuControl 
    315315        String ctrlName 
    316316        Variable popNum // which item is currently selected (1-based) 
     
    339339// setVar for the wavelength 
    340340// 
    341 Function V_Lambda_SetVarProc(sva) : SetVariableControl 
     341Function VC_Lambda_SetVarProc(sva) : SetVariableControl 
    342342        STRUCT WMSetVariableAction &sva 
    343343 
     
    367367// setVar for the simulation monitor count 
    368368// 
    369 Function V_SimImon_SetVarProc(sva) : SetVariableControl 
     369Function VC_SimImon_SetVarProc(sva) : SetVariableControl 
    370370        STRUCT WMSetVariableAction &sva 
    371371 
     
    439439// of the intensity and a redraw of the banks 
    440440// 
    441 Function V_FDet_SDD_SetVarProc(sva) : SetVariableControl 
     441Function VC_FDet_SDD_SetVarProc(sva) : SetVariableControl 
    442442        STRUCT WMSetVariableAction &sva 
    443443 
     
    476476// of the intensity and a redraw of the banks 
    477477// 
    478 Function V_MDet_SDD_SetVarProc(sva) : SetVariableControl 
     478Function VC_MDet_SDD_SetVarProc(sva) : SetVariableControl 
    479479        STRUCT WMSetVariableAction &sva 
    480480 
     
    513513// of the intensity and a redraw of the banks 
    514514// 
    515 Function V_BDet_SDD_SetVarProc(sva) : SetVariableControl 
     515Function VC_BDet_SDD_SetVarProc(sva) : SetVariableControl 
    516516        STRUCT WMSetVariableAction &sva 
    517517 
     
    550550// of the intensity and a redraw of the banks 
    551551// 
    552 Function V_FDet_LR_SetVarProc(sva) : SetVariableControl 
     552Function VC_FDet_LR_SetVarProc(sva) : SetVariableControl 
    553553        STRUCT WMSetVariableAction &sva 
    554554 
     
    588588// of the intensity and a redraw of the banks 
    589589// 
    590 Function V_MDet_LR_SetVarProc(sva) : SetVariableControl 
     590Function VC_MDet_LR_SetVarProc(sva) : SetVariableControl 
    591591        STRUCT WMSetVariableAction &sva 
    592592 
     
    633633// -- parameters and constants need to be defined in their own space 
    634634// 
    635 // 
    636 Proc V_Initialize_Space() 
     635// FEB 2016 -- changed the data folder space to mimic the HDF folder structure 
     636// so that the averaging routines could be re-used (along with everything else) 
     637// -- painful, but better in the long run 
     638// 
     639// -- I have not re-named the detector arrays to all be "data" since that is very difficult to 
     640//   deal with on images. Added a global "gVCALC_Active" as a crude workaround as needed. Turn it 
     641//   on when needed and then immediately off 
     642// 
     643Proc VC_Initialize_Space() 
    637644// 
    638645        NewDataFolder/O root:Packages 
     
    640647        NewDataFolder/O root:Packages:NIST:VSANS 
    641648        NewDataFolder/O root:Packages:NIST:VSANS:VCALC 
    642         NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Front 
    643         NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 
    644         NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 
     649                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry 
     650                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry 
     651                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument 
     652                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 
     653                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB 
     654                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT 
     655                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML 
     656                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR 
     657                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB 
     658                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT 
     659                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL 
     660                NewDataFolder/O root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR 
     661 
     662//      NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Front 
     663//      NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Middle 
     664//      NewDataFolder/O root:Packages:NIST:VSANS:VCALC:Back 
     665 
    645666        NewDataFolder/O root:Packages:NIST:VSANS:RawVSANS 
    646667         
     668        Variable/G root:Packages:NIST:VSANS:VCALC:gVCALC_Active = 1 
    647669         
    648670        SetDataFolder root:Packages:NIST:VSANS:VCALC 
     
    729751// TODO: the detector dimensions need to be properly defined here... 
    730752// FRONT 
    731         SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 
    732  
    733         Make/O/D/N=(::gFront_L_nPix_X,::gFront_L_nPix_Y) det_FL 
    734         Make/O/D/N=(::gFront_R_nPix_X,::gFront_R_nPix_Y) det_FR 
    735         Make/O/D/N=(::gFront_T_nPix_X,::gFront_T_nPix_Y) det_FT 
    736         Make/O/D/N=(::gFront_B_nPix_X,::gFront_B_nPix_Y) det_FB 
     753//      SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 
     754 
     755        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL 
     756        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_L_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_L_nPix_Y) det_FL 
    737757        Duplicate/O det_FL qTot_FL,qx_FL,qy_FL,qz_FL 
     758 
     759        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR 
     760        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_R_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_R_nPix_Y) det_FR 
    738761        Duplicate/O det_FR qTot_FR,qx_FR,qy_FR,qz_FR 
     762 
     763        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT 
     764        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_T_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_T_nPix_Y) det_FT 
    739765        Duplicate/O det_FT qTot_FT,qx_FT,qy_FT,qz_FT 
     766         
     767        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB 
     768        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gFront_B_nPix_X,root:Packages:NIST:VSANS:VCALC:gFront_B_nPix_Y) det_FB 
    740769        Duplicate/O det_FB qTot_FB,qx_FB,qy_FB,qz_FB 
     770 
    741771 
    742772//MIDDLE 
    743773// TODO: the detector dimensions need to be properly defined here... 
    744         SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 
    745  
    746         Make/O/D/N=(::gMiddle_L_nPix_X,::gMiddle_L_nPix_Y) det_ML 
    747         Make/O/D/N=(::gMiddle_R_nPix_X,::gMiddle_R_nPix_Y) det_MR 
    748         Make/O/D/N=(::gMiddle_T_nPix_X,::gMiddle_T_nPix_Y) det_MT 
    749         Make/O/D/N=(::gMiddle_B_nPix_X,::gMiddle_B_nPix_Y) det_MB 
     774//      SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 
     775 
     776        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML 
     777        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_L_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_L_nPix_Y) det_ML 
    750778        Duplicate/O det_ML qTot_ML,qx_ML,qy_ML,qz_ML 
     779         
     780        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR 
     781        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_R_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_R_nPix_Y) det_MR 
    751782        Duplicate/O det_MR qTot_MR,qx_MR,qy_MR,qz_MR 
     783 
     784        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT 
     785        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_T_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_T_nPix_Y) det_MT 
    752786        Duplicate/O det_MT qTot_MT,qx_MT,qy_MT,qz_MT 
     787         
     788        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB 
     789        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gMiddle_B_nPix_X,root:Packages:NIST:VSANS:VCALC:gMiddle_B_nPix_Y) det_MB 
    753790        Duplicate/O det_MB qTot_MB,qx_MB,qy_MB,qz_MB 
    754791 
    755792// BACK 
    756793// TODO: the detector dimensions need to be properly defined here... 
    757         SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 
    758          
    759         Make/O/D/N=(::gBack_nPix_X,::gBack_nPix_Y) det_B 
     794//      SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 
     795 
     796        SetDataFolder root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B 
     797        Make/O/D/N=(root:Packages:NIST:VSANS:VCALC:gBack_nPix_X,root:Packages:NIST:VSANS:VCALC:gBack_nPix_Y) det_B 
    760798        Duplicate/O det_B qTot_B,qx_B,qy_B,qz_B 
    761799 
Note: See TracChangeset for help on using the changeset viewer.