Changeset 1015 for sans


Ignore:
Timestamp:
Oct 14, 2016 12:53:52 PM (6 years ago)
Author:
srkline
Message:

moved the waves and variables for the beam center panel and the mask panel to their own folders, rather than root to avoid conflicts of detector panel display.

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_BeamCenter.ipf

    r1005 r1015  
    1111// -- add method to be able to write the values to the local folder / or better, to file on disk 
    1212// -- graphically show the beam center / radius of where it is in relation to the panel 
     13// 
     14// -- move everything into it's own folder, rather than root: 
     15// 
    1316 
    1417 
     
    1619        DoWindow/F PanelFit 
    1720        if(V_flag==0) 
     21         
     22                NewDataFolder/O root:Packages:NIST:VSANS:Globals:BeamCenter 
     23 
    1824                Execute "DetectorPanelFit()" 
    1925        endif 
     
    3945        PopupMenu popup_1,mode=1,popvalue="BroadPeak",value= #"\"BroadPeak;other;\"" 
    4046        PopupMenu popup_2,pos={20,20},size={109,20},title="Data Source"//,proc=SetFldrPopMenuProc 
    41         PopupMenu popup_2,mode=1,popvalue="VCALC",value= #"\"RAW;SAM;VCALC;\"" 
     47        PopupMenu popup_2,mode=1,popvalue="RAW",value= #"\"RAW;SAM;VCALC;\"" 
    4248                 
    4349        Button button_0,pos={486,20},size={80,20},proc=DetFitGuessButtonProc,title="Guess" 
     
    4955 
    5056 
    51  
    52         duplicate/O root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_FL:det_FL curDispPanel 
     57        SetDataFolder root:Packages:NIST:VSANS:Globals:BeamCenter 
     58 
     59        duplicate/O root:Packages:NIST:VSANS:RAW:entry:instrument:detector_FL:data curDispPanel 
    5360        SetScale/P x 0,1, curDispPanel 
    5461        SetScale/P y 0,1, curDispPanel 
    5562 
    56  
     63        SetDataFolder root: 
     64         
    5765        // draw the correct images 
    5866        DrawDetPanel("FL") 
     
    156164        Variable nPix_X,nPix_Y,pixSize_X,pixSize_Y 
    157165 
    158          
    159         Wave dispW=root:curDispPanel 
     166 
     167        Wave dispW=root:Packages:NIST:VSANS:Globals:BeamCenter:curDispPanel 
    160168        Wave cw = root:coef_PeakPix2D 
    161169 
     
    320328        cw[8] = pixSize_Y*10             
    321329 
     330        SetDataFolder root:Packages:NIST:VSANS:Globals:BeamCenter 
    322331        // generate the new panel display 
    323332        duplicate/O newW curDispPanel 
     
    333342        RenameWindow #,DetData 
    334343        SetActiveSubwindow ##    
     344         
     345        SetDataFolder root: 
     346         
    335347         
    336348                 
     
    392404                case 2: // mouse up 
    393405                        // click code here 
    394                         Wave dispW=root:curDispPanel 
     406                        Wave dispW=root:Packages:NIST:VSANS:Globals:BeamCenter:curDispPanel 
    395407                        Wave coefW=root:coef_PeakPix2D 
    396408                         
     
    454466                        // click code here 
    455467                         
    456                         Wave dispW=root:curDispPanel 
     468                        Wave dispW=root:Packages:NIST:VSANS:Globals:BeamCenter:curDispPanel 
    457469                        Wave coefW=root:coef_PeakPix2D 
    458470                         
     
    597609// this works if the proper centers are in the file - otherwise, it's a mess     
    598610// "B" is skipped here, as it should be... 
     611 
     612// TODO --?? is this a problem?? 
    599613        SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 
    600614 
     
    622636Function V_SpreadOutPanels() 
    623637 
     638// TODO ?? is this a problem?? 
    624639        SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 
    625640 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r1014 r1015  
    2121///// LOADING 
    2222 
    23 // TODO - when maks is loaded, need to be sure to clean up the "extra" waves that may be present 
     23// TODO - when mask is loaded, need to be sure to clean up the "extra" waves that may be present 
    2424//  - the overlay and the currentTube waves since these are not overwritten or killed when new mask  
    2525//  data is read in from HDF. need to manually? check for these and delete then, or the data and 
     
    6363// x- draw a mask 
    6464// x- save a mask (all panels) 
     65// -- move everything into it's own folder, rather than root: 
    6566// -- be able to save the mask name to the RAW data file 
    6667// -- be able to read a mask based on what name is in the data file 
     
    8788        DoWindow/F MaskEditPanel 
    8889        if(V_flag==0) 
    89                 Variable/G root:Packages:NIST:VSANS:Globals:gMaskTube = 0 
    90                 Variable/G root:Packages:NIST:VSANS:Globals:gMaskMaxIndex = 47 
     90         
     91                NewDataFolder/O root:Packages:NIST:VSANS:Globals:Mask 
     92 
     93                Variable/G root:Packages:NIST:VSANS:Globals:Mask:gMaskTube = 0 
     94                Variable/G root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex = 47 
     95                 
     96                // check for a mask, if not present, generate a default mask 
     97                String str="FT" 
     98                wave/Z maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data")  
     99                if(!WaveExists(maskW)) 
     100                        V_GenerateDefaultMask() 
     101                endif 
     102                 
    91103                Execute "MaskEditorPanel()" 
    92104        endif 
     
    113125 
    114126        SetVariable setvar0,pos={257.00,20.00},size={150.00,14.00},title="tube number" 
    115         SetVariable setvar0,limits={0,127,1},value=root:Packages:NIST:VSANS:Globals:gMaskTube 
     127        SetVariable setvar0,limits={0,127,1},value=root:Packages:NIST:VSANS:Globals:Mask:gMaskTube 
    116128        Button button_0,pos={257,46.00},size={50.00,20.00},proc=AddToMaskButtonProc,title="Add" 
    117129        Button button_1,pos={319.00,46.00},size={50.00,20.00},proc=RemoveFromMaskButtonProc,title="Del" 
     
    184196                                                 
    185197                        SetVariable setvar0,limits={0,val,1} 
    186                         NVAR gVal = root:Packages:NIST:VSANS:Globals:gMaskTube 
    187                         NVAR gMax = root:Packages:NIST:VSANS:Globals:gMaskMaxIndex 
     198                        NVAR gVal = root:Packages:NIST:VSANS:Globals:Mask:gMaskTube 
     199                        NVAR gMax = root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex 
    188200                        gMax = val 
    189201                        if(gVal > val) 
     
    234246                        STRUCT WMButtonAction ba 
    235247                        ba.eventCode = 2 
    236                         NVAR tubeVal = root:Packages:NIST:VSANS:Globals:gMaskTube 
     248                        NVAR tubeVal = root:Packages:NIST:VSANS:Globals:Mask:gMaskTube 
    237249                        if(s.specialKeyCode == 100) 
    238250                                //left arrow 
     
    253265 
    254266// enforce the limits on the setvar 
    255                         NVAR gMax = root:Packages:NIST:VSANS:Globals:gMaskMaxIndex 
     267                        NVAR gMax = root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex 
    256268                        if(tubeVal > gMax) 
    257269                                tubeVal = gMax 
     
    545557        endswitch 
    546558 
     559        SetDataFolder root:Packages:NIST:VSANS:Globals:Mask 
     560         
    547561        // generate the new panel display 
    548562        duplicate/O newW curDispPanel 
     
    561575        DoUpdate 
    562576         
     577        SetDataFolder root: 
    563578        return(0) 
    564579End 
     
    654669                        // click code here 
    655670                         
     671                        // fills in a "default mask" in a separate folder to then write out 
    656672                        Execute "H_Setup_VSANS_MASK_Structure()" 
    657673                         
    658674                        // fill with current "stuff" 
    659                                 SetDataFolder root:VSANS_MASK_file:entry         
     675                        SetDataFolder root:VSANS_MASK_file:entry         
    660676                        Wave/T title    = title 
    661677                        title = "This is a custom MASK file for VSANS" 
     
    663679                         
    664680                         
    665                 // copy over for all of the detector panels 
     681                // copy over what was actually drawn for all of the detector panels 
    666682 
    667683                        Variable ii 
     
    754770End 
    755771 
     772 
     773// this default mask is only generated on startup of the panel, if a mask 
     774// has not been previously loaded. If any mask is present ("FT" is tested) then 
     775// this function is skipped and the existing mask is not overwritten 
     776Function V_GenerateDefaultMask() 
     777 
     778        NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry     
     779                Make/O/T/N=1    title   = "This is a fake MASK file for VSANS" 
     780                Make/O/T/N=1    start_date      = "2015-02-28T08:15:30-5:00" 
     781                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument          
     782                        Make/O/T/N=1    name    = "NG3_VSANS" 
     783                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_B       
     784                        Make/O/I/N=(150,150)    data    = 0 
     785                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MR              
     786                        Make/O/I/N=(48,128)     data    = 0 
     787                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_ML              
     788                        Make/O/I/N=(48,128)     data    = 0 
     789                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MT              
     790                        Make/O/I/N=(128,48)     data    = 0 
     791                        data[0,49][] = 1 
     792                        data[78,127][] = 1 
     793                        data[50,77][] = 0 
     794                         
     795                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MB              
     796                        Make/O/I/N=(128,48)     data    = 0 
     797                        data[0,49][] = 1 
     798                        data[78,127][] = 1 
     799                        data[50,77][] = 0 
     800                         
     801                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FR              
     802                        Make/O/I/N=(48,128)     data    = 0 
     803                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FL              
     804                        Make/O/I/N=(48,128)     data    = 0 
     805                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FT              
     806                        Make/O/I/N=(128,48)     data    = 0 
     807                        data[0,49][] = 1 
     808                        data[78,127][] = 1 
     809                        data[50,77][] = 0 
     810 
     811                NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FB              
     812                        Make/O/I/N=(128,48)     data    = 0 
     813                        data[0,49][] = 1 
     814                        data[78,127][] = 1 
     815                        data[50,77][] = 0 
     816                         
     817        SetDataFolder root: 
     818 
     819end 
     820 
    756821////////////////////// MASK FILE 
    757822 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf

    r994 r1015  
    2121        Submenu "In Progress Panels" 
    2222                "VSANS Preferences",Show_VSANSPreferences_Panel() 
    23                 "Beam Center Panel",DetectorPanelFit() 
     23                "Beam Center Panel",V_FindBeamCenter() 
    2424        End 
    2525        Submenu "Work Files" 
Note: See TracChangeset for help on using the changeset viewer.