Changeset 1043


Ignore:
Timestamp:
Jun 6, 2017 2:19:21 PM (5 years ago)
Author:
srkline
Message:

Minor changes to the function of the Beam Center panel so that it made sense, and would untimately allow writing the new center values to a data file on disk

Other cosetic changes to some of the panels

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
7 edited

Legend:

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

    r1041 r1043  
    5454        Button button_1,pos={615,20},size={80,20},proc=V_DetFitButtonProc,title="Do Fit" 
    5555        Button button_2,pos={744,20},size={80,20},proc=V_DetFitHelpButtonProc,title="Help" 
    56         Button button_3,pos={615,400},size={110,20},proc=V_WriteCtrButtonProc,title="Write Centers" 
    57         Button button_4,pos={730,400},size={110,20},proc=V_CtrTableButtonProc,title="Ctr table" 
     56        Button button_3,pos={730,400},size={110,20},proc=V_CopyCtrButtonProc,title="Copy Centers" 
     57        Button button_4,pos={615,400},size={110,20},proc=V_CtrTableButtonProc,title="Ctr table" 
    5858        Button button_5,pos={730,440},size={110,20},proc=V_WriteCtrTableButtonProc,title="Write table" 
    5959 
     
    441441// TODO -- currently hard-wired for coefficients from the only fit function 
    442442// 
     443// only copies the center values to the local folder (then read back in by clicking  "Ctr Table") 
     444// 
    443445// -- will need to recalc mm center AND q-values 
    444 Function V_WriteCtrButtonProc(ba) : ButtonControl 
     446Function V_CopyCtrButtonProc(ba) : ButtonControl 
    445447        STRUCT WMButtonAction &ba 
    446448 
     
    459461                        V_putDet_beam_center_y(fname,detStr,coefW[10]) 
    460462 
    461                         DoAlert 0, "-- will need to recalc mm center AND q-values" 
     463//                      DoAlert 0, "-- will need to recalc mm center AND q-values" 
     464                         
     465                        V_BCtrTable()           //reads the values back in 
    462466                         
    463467                        break 
     
    717721Function V_BeamCtr_WriteTable() 
    718722 
    719         DoAlert 0,"this currently only writes pix values locally, not mm, and not to files on disk" 
     723        Variable runNumber 
     724        Prompt runNumber, "enter the run number:" 
     725        DoPrompt "Pick file to write to",runNumber 
     726        If(V_flag==1) 
     727                return(0) 
     728        endif    
    720729         
    721730        String folder 
     
    728737        Wave/T panelW = root:PanelW 
    729738         
    730         ControlInfo popup_2 
    731         folder = S_Value 
    732          
    733         fname = folder 
     739 
     740        fname = V_FindFileFromRunNumber(runNumber) 
     741 
    734742        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    735743//              detStr = StringFromList(ii, ksDetectorListAll, ";") 
    736744                detStr = panelW[ii] 
    737                 V_putDet_beam_center_x(fname,detStr,xCtr_pix[ii]) 
    738                 V_putDet_beam_center_y(fname,detStr,yCtr_pix[ii]) 
     745                V_writeDet_beam_center_x(fname,detStr,xCtr_pix[ii]) 
     746                V_writeDet_beam_center_y(fname,detStr,yCtr_pix[ii]) 
    739747                 
    740748                // TODO 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_BroadPeak_Pix_2D.ipf

    r1041 r1043  
    226226// base the scaling on the xSize  
    227227 
     228// *** NOTE *** 
     229// "qval" here is NOT q 
     230// qval is a real space distance in the units of PIXELS. Not mm, not q, PIXELS 
     231// Don't put any meaning in the fitted values, it's simply a functional shape 
     232 
    228233        ratio = (xSize/ySize)^2 
    229234        if(ratio > 1) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf

    r1033 r1043  
    33// 
    44// ******** 
    5 // TODO -- this is only a fake DIV file. need to identify how to generate a real DIV file 
    6 //     for the different detectors, and how to fill it into a file. ProDIV for SANS may be a good 
    7 //     starting point, or it may be cumbersome. Not sure how it will be measured in practice 
    8 //     on VSANS. 
     5// TODO -- this is an incomplete DIV file. need to identify how to generate a real DIV file 
     6//     for the different detectors, and how to fill it into a file.  
     7//    Not sure how it will be measured in practice on VSANS. 
    98// 
    109//   JAN 2017 
     
    2625// the high angle issues. 
    2726// 
    28 // 
    29  
     27// -- what about the T/B panels? Since a large chunk of these detectors may be obscured, 
     28//   the normalization will be way off -- and the "active" area will end up much larger  
     29//   than it should be - since the wings of the detector are mostly zero... 
     30// 
     31// 
    3032 
    3133 
     
    4042 
    4143 
    42  
    43  
    44  
    45  
    46 //works on the data in "type" folder (expecting data to be reduced to the COR level) 
    47 //sums all of the data, and normalizes by the number of cells (=pixelX*pixelY) 
    48 // calling procedure must make sure that the folder is on linear scale FIRST 
     44// Basic function: 
     45// -- first, reduce the data (to the COR level?) 
     46// -- next, V_NormalizeDIV() 
     47// -- then Setup_VSANS_DIV_Struct() 
     48// -- next, V_CopyDIVToSave() 
     49// -- last, Save_VSANS_DIV_Nexus()  
     50 
     51 
     52 
     53 
     54// 
     55// Normalizes each panel independently 
     56// Normalizes in-place, replacing whatever was there 
     57// 
     58// type is the work folder where the (? corrected) data is currently 
     59// 
     60// TODO 
     61// -- data should be copied to some alternate work folder before this step 
     62// 
    4963Function V_NormalizeDIV(type) 
    5064        String type 
    51          
    52         WAVE data=$("root:Packages:NIST:"+type+":data") 
    53         WAVE data_lin=$("root:Packages:NIST:"+type+":linear_data") 
    54         WAVE data_err=$("root:Packages:NIST:"+type+":linear_data_error") 
    55          
    56         Variable totCts=sum(data,Inf,-Inf)              //sum all of the data 
    57         NVAR pixelX = root:myGlobals:gNPixelsX 
    58         NVAR pixelY = root:myGlobals:gNPixelsY 
    59  
    60          
    61         data /= totCts 
    62         data *= pixelX*pixelY 
    63          
    64         data_lin /= totCts 
    65         data_lin *= pixelX*pixelY 
    66          
    67         data_err /= totCts 
    68         data_err *= pixelX*pixelY 
    69                  
     65 
     66        Variable ii,totCts,pixelX,pixelY 
     67        String detStr 
     68 
     69        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     70                detStr = StringFromList(ii, ksDetectorListAll, ";") 
     71                Wave w = V_getDetectorDataW(type,detStr) 
     72                Wave w_err = V_getDetectorDataErrW(type,detStr) 
     73                pixelX = V_getDet_pixel_num_x(type,detStr) 
     74                pixelY = V_getDet_pixel_num_y(type,detStr) 
     75 
     76                totCts=sum(w,Inf,-Inf)          //sum all of the data 
     77                 
     78                w /= totCts 
     79                w *= pixelX*pixelY 
     80 
     81                w_err /= totCts 
     82                w_err *= pixelX*pixelY 
     83                 
     84        endfor 
     85         
    7086        return(0) 
    7187End 
    7288 
    7389 
     90 
     91Function V_CopyDIVToSave(type) 
     92        String type 
     93         
     94        Variable ii,totCts,pixelX,pixelY 
     95        String detStr 
     96        String topath = "root:VSANS_DIV_file:entry:instrument:detector_" 
     97        String fromPath = "root:Packages:NIST:VSANS:"+type+":entry:instrument:detector_" 
     98         
     99         
     100        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     101                detStr = StringFromList(ii, ksDetectorListAll, ";") 
     102 
     103                Duplicate/O $(fromPath+detStr+":data") $(toPath+detStr+":data") 
     104                Duplicate/O $(fromPath+detStr+":linear_data_error") $(toPath+detStr+":linear_data_error") 
     105                 
     106        endfor 
     107         
     108        return(0) 
     109End 
    74110 
    75111 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r1025 r1043  
    677677                        SetDataFolder root:VSANS_MASK_file:entry         
    678678                        Wave/T title    = title 
    679                         title = "This is a custom MASK file for VSANS" 
     679                        title = "This is a custom MASK file for VSANS: VSANS_MASK" 
    680680                        SetDataFolder root: 
    681681                         
     
    730730 
    731731        NewDataFolder/O/S root:VSANS_MASK_file:entry     
    732                 Make/O/T/N=1    title   = "This is a fake MASK file for VSANS" 
     732                Make/O/T/N=1    title   = "This is a MASK file for VSANS: VSANS_MASK" 
    733733                Make/O/T/N=1    start_date      = "2015-02-28T08:15:30-5:00" 
    734734                NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument          
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MultipleReduce.ipf

    r1042 r1043  
    8787        Button ReduceOneButton,pos={3,98},size={180,20},proc=V_ReduceTopPopupFile,title="Reduce Top File in Popup" 
    8888        Button ReduceOneButton,help={"This will reduce TOP files in the popup list, not all of the files."} 
    89         Button DoneButton,pos={280,128},size={110,20},proc=V_MRDoneButtonProc,title="Done Reducing" 
     89        Button DoneButton,pos={290,128},size={110,20},proc=V_MRDoneButtonProc,title="Done Reducing" 
    9090        Button DoneButton,help={"When done reducing files, this will close this control panel."} 
    9191        Button cat_short,pos={310,72},size={90,20},proc=V_ShowCatShort_MRED,title="File Catalog" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1042 r1043  
    916916//      endfor 
    917917 
    918         String match="MASK"             // this is part of the title of a VSANS MASK file 
     918//      String match="MASK"             // this is part of the title of a VSANS MASK file 
     919        String match="VSANS_MASK"               // this is part of the title of a VSANS MASK file 
    919920        for(ii=0;ii<num;ii+=1) 
    920921                item=StringFromList(ii, newList , ";") 
     
    10671068        DrawLine 3,350,301,350 
    10681069        DrawLine 3,445,301,445 
    1069         DrawLine 3,513,303,513 
     1070        DrawLine 3,513,301,513 
    10701071        DrawLine 3,396,301,396 
    10711072 
    10721073// 
    1073         Button button_help,pos={260,2},size={25,20},proc=V_ShowProtoHelp,title="?" 
     1074        Button button_help,pos={300,2},size={25,20},proc=V_ShowProtoHelp,title="?" 
    10741075        Button button_help,help={"Show the help file for setting up a reduction protocol"} 
    10751076        Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf

    r1042 r1043  
    172172//      Button button_tagFile,pos={720,412},size={70,20},proc=V_TagFileButtonProc,title="Tag File" 
    173173//      Button button_tagFile,disable=2 
    174         Button button_saveIQ,pos={603,412},size={70,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q)" 
    175         Button button_BeamCtr,pos={603,450},size={70,20},proc=V_BeamCtrButtonProc,title="Beam Ctr" 
     174        Button button_saveIQ,pos={603,412},size={120,20},proc=V_SaveIQ_ButtonProc,title="Save I(Q) as ITX" 
     175        Button button_BeamCtr,pos={603,450},size={110,20},proc=V_BeamCtrButtonProc,title="Beam Center" 
    176176        Button button_SpreadPanels,pos={603,488},size={100,20},proc=V_SpreadPanelButtonProc,title="Spread Panels" 
    177177        Button button_RestorePanels,pos={603,526},size={100,20},proc=V_RestorePanelButtonProc,title="Restore Panels" 
Note: See TracChangeset for help on using the changeset viewer.