Changeset 1023


Ignore:
Timestamp:
Feb 17, 2017 1:55:05 PM (6 years ago)
Author:
srkline
Message:

many additions.

Moved unused igor/nexus testing files to Vx_ prefix since they're garbage. Pulled out the useful bits for mask and div R/W and moved those to theire appropriate procedures.

Testing the simple correction of data, only tested basic subtraction. All of it still needs to be verified since I don't have any real header numbers and units yet.

Adjusted the columns on the file catalog to be more appropriate, and added a hook to allow loading of raw data files directly from the table and a popup contextual menu. May add more functionality to it later.

Corrected how the 1D data is plotted so that it correctly uses the binning type. I(q) save now also uses the binning as specified.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction
Files:
4 added
4 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Initialize.ipf

    r871 r1023  
    115115         
    116116        if(cmpstr("Macintosh",IgorInfo(2)) == 0) 
    117                 String/G root:Packages:NIST:gAngstStr = num2char(-127) 
     117//              String/G root:Packages:NIST:gAngstStr = num2char(-127) 
     118                String/G root:Packages:NIST:gAngstStr = num2char(197) 
    118119                Variable/G root:myGlobals:gIsMac = 1 
    119120        else 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf

    r1022 r1023  
    7070                        break 
    7171                case "AgBeh": 
    72                         tmpInten = VC_BroadPeak(1e-9,3,20,100.0,0.1,3,0.1,qTot[p][q]) 
     72                        tmpInten = VC_BroadPeak(1e-11,3,20,100.0,0.1,3,0.1,qTot[p][q]) 
    7373                        break 
    7474                case "Vycor": 
     
    7676                        break    
    7777                case "Empty Cell": 
    78                         tmpInten = VC_EC_Empirical(2.2e-8,3.346,0.0065,9.0,0.016,qTot[p][q]) 
     78                        tmpInten = VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 
    7979                        break 
    8080                case "Blocked Beam": 
    81                         tmpInten = VC_BlockedBeam(1,qTot[p][q]) 
     81                        tmpInten = VC_BlockedBeam(0.01,qTot[p][q]) 
    8282                        break 
    8383                case "Debye +": 
     
    8686                        break 
    8787                case "AgBeh +": 
    88                         tmpInten = VC_BroadPeak(1e-9,3,20,100.0,0.1,3,0.1,qTot[p][q]) 
     88                        tmpInten = VC_BroadPeak(1e-11,3,20,100.0,0.1,3,0.1,qTot[p][q]) 
    8989                        addEmpBgd = 1 
    9090                        break 
    9191                case "Empty Cell +": 
    92                         tmpInten = VC_EC_Empirical(2.2e-8,3.346,0.0065,9.0,0.016,qTot[p][q]) 
    93                         tmpInten += VC_BlockedBeam(1,qTot[p][q]) 
     92                        tmpInten = VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 
     93                        tmpInten += VC_BlockedBeam(0.01,qTot[p][q]) 
    9494                        break 
    9595                default: 
     
    9999 
    100100        if(addEmpBgd == 1) 
    101                 tmpInten += VC_EC_Empirical(2.2e-8,3.346,0.0065,9.0,0.016,qTot[p][q]) 
    102                 tmpInten += VC_BlockedBeam(1,qTot[p][q]) 
     101                tmpInten += VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 
     102                tmpInten += VC_BlockedBeam(0.01,qTot[p][q]) 
    103103        endif 
    104104 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_HDF5_VSANS_Utils.ipf

    r1019 r1023  
    2323//    since I need a "template" of the Nexus folder structure to start from and fill in 
    2424// 
    25 // It doesn't reproduce the NICE logs, but will leave a spece for them if 
     25// It doesn't reproduce the NICE logs, but will leave a space for them if 
    2626// it is read in and is part of the xref. 
    2727// 
     
    5050// 
    5151 
    52  
    53 // Next... think of all of R/W access needed 
    54 // 
    55 // the simple read/write works... 
    56 // linear_data does not seem to need to be transposed at all 
    57 // 
    58 //  -- this seems too easy. what am I doing wrong? Is something getting garbled when I  
    59 // write back any single values back to the file 
    60 // 
    61 // -- try a string value next 
    62 // -- then start to write the generic get/write functions 
    63 // 
    64  
    65 // 
    66 // do I ditch the RealsRead/IntegersRead/TextRead? It makes little sense now. 
    67 // maybe copy a "dataInfo" folder/subfolders. can't keep them all (bloat) 
    68 // but then what about multiple files added together? 
    69 // 
    70  
     52// 
     53 
     54// 
     55// FEB 2017: All that is functional right now is the Setup/save of DIV and MASK files, and the attribute routines. 
     56// 
     57// The DIV and MASK routines are in their respective procedure files, and call save functions for the simplified 
     58// Nexus structure (in V_HDF5_RW_Utils.ipf). 
     59// 
     60// The R/W with attributes is part of the HDF5 Gateway procedure from Pete Jemain, and needs to be kept and functional 
     61// to be able to work with attributes - if needed. 
     62// 
    7163Menu "VSANS" 
    72         SubMenu "Nexus File Testing" 
    73                 "Fill_Nexus_V_Template" 
    74                 "Save_Nexus_V_Template" 
    75                 "Load_Nexus_V_Template" 
    76                 "-" 
    77                 "IgorOnly_Setup_VSANS_Struct" 
    78                 "IgorOnly_Save_VSANS_Nexus" 
    79                 "IgorOnly_Setup_SANS_Struct" 
    80                 "IgorOnly_Save_SANS_Struct" 
     64        SubMenu "Nexus File RW" 
     65//              "Fill_Nexus_V_Template" 
     66//              "Save_Nexus_V_Template" 
     67//              "Load_Nexus_V_Template" 
     68//              "-" 
     69//              "IgorOnly_Setup_VSANS_Struct" 
     70//              "IgorOnly_Save_VSANS_Nexus" 
     71//              "IgorOnly_Setup_SANS_Struct" 
     72//              "IgorOnly_Save_SANS_Struct" 
    8173                "Setup_VSANS_DIV_Struct" 
    8274                "Save_VSANS_DIV_Nexus" 
     
    9385 
    9486 
     87 
     88 
     89 
     90 
     91 
     92 
     93 
     94 
     95 
     96 
     97 
     98 
     99///////////////////////////// 
     100 
     101 
     102 
    95103Proc Load_Nexus_V_Template() 
    96104        H_HDF5Gate_Read_Raw("") 
     
    114122 
    115123 
    116  
    117  
    118  
    119  
    120  
    121  
    122  
    123  
    124  
    125  
    126 ///////////////////////////// 
    127  
    128124/////////////below is largely depricated, ugly dance to be able to "fake" a file from Igor 
    129125// which was not complete anyways. 
     126 
    130127 
    131128 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf

    r1022 r1023  
    3636 
    3737#include "HDF5gateway_NCNR" 
    38 #include "Nexus_SANS_Write" 
    39 #include "Nexus_VSANS_Write" 
     38#include "Vx_Nexus_SANS_Write" 
     39#include "Vx_Nexus_VSANS_Write" 
    4040//#include "V_ReadWrite_HDF5"           //AUG2015 beginning of read/write, renamed Nov2015 
    41 #include "V_NexusFromIgor"                      //AUG2015 - depricated, but keep for now 
     41#include "Vx_NexusFromIgor"                     //AUG2015 - depricated, but keep for now 
    4242 
    4343// for possible peak fitting 
    4444#include "V_BroadPeak_Pix_2D" 
    45 #include "VC_BeamCenter" 
     45#include "V_BeamCenter" 
    4646 
    4747// for fitting data to generate tube corrections 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Correct.ipf

    r1021 r1023  
    267267//                                      was freshly loaded. added final copy of cor result to cor:data and cor:linear_data 
    268268// 
     269// TODO -- verify the operation 
     270//  -- check that all "get" reads are returning proper values (+units) 
     271// 
    269272Function V_CorrectMode_1() 
    270273 
     
    383386                cor1 *= noadd_bgd*noadd_emp             //zero out the array mismatch values 
    384387         
     388                cor_data = cor1         //the final result 
     389                 
    385390                // do the error propagation piecewise    
    386391                Duplicate/O sam_err, tmp_a, tmp_b, tmp_c, tmp_d,c_val,d_val 
     
    498503                cor1 *= noadd_bgd               //zeros out regions where arrays do not overlap, one otherwise 
    499504         
     505                cor_data = cor1         //the final result 
     506 
    500507        // do the error propagation piecewise    
    501508                Duplicate/O sam_err, tmp_a, tmp_b 
     
    610617                cor1 = fsam*sam_data/sam_AttenFactor - femp*(tsam/temp)*emp_temp/emp_AttenFactor 
    611618                cor1 *= noadd_emp               //zeros out regions where arrays do not overlap, one otherwise 
     619 
     620                cor_data = cor1         //the final result 
    612621         
    613622        // do the error propagation piecewise    
     
    808817                cor1 -= drk_temp/sam_attenFactor 
    809818                cor1 *= noadd_bgd*noadd_emp             //zero out the array mismatch values 
     819 
     820                cor_data = cor1         //the final result 
    810821                 
    811822        // do the error propagation piecewise    
     
    941952                cor1 += -1*(fbgd*bgd_temp/bgd_attenFactor - drk_temp) - drk_temp/sam_attenFactor 
    942953                cor1 *= noadd_bgd               //zeros out regions where arrays do not overlap, one otherwise 
     954 
     955                cor_data = cor1         //the final result 
    943956         
    944957        // do the error propagation piecewise    
     
    10721085                cor1 += drk_temp - drk_temp/sam_attenFactor 
    10731086                cor1 *= noadd_emp               //zeros out regions where arrays do not overlap, one otherwise 
     1087 
     1088                cor_data = cor1         //the final result 
    10741089         
    10751090        // do the error propagation piecewise    
     
    11631178                //correct sam for attenuators, and do the same to drk, since it was scaled to sam count time 
    11641179                cor1 = fsam*sam_data/sam_AttenFactor  - drk_temp/sam_attenFactor 
     1180 
     1181                cor_data = cor1         //the final result 
    11651182         
    11661183        // do the error propagation piecewise    
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf

    r1022 r1023  
    2121// -- VERIFY accuracy 
    2222// -- decide what to add to the control bar 
     23// -- at the very least, add a log/lin toggle for the axes 
     24// 
     25// -- document, document, document 
    2326// 
    2427// -- see Middle_IQ_Graph() and similar for how VCALC does this plot 
     
    3033 
    3134 
    32         DoWindow V_1D_Data 
     35        DoWindow/F V_1D_Data 
    3336        if(V_flag==0) 
    3437         
     
    8689        String ctrlName 
    8790         
    88 //      DoWindow/F V_1D_Data 
    8991        SetAxis/A 
    9092End 
     
    194196         
    195197        if(binType==2) 
     198// clear EVERYTHING 
    196199                ClearAllIQIfDisplayed("MLRTB") 
     200                ClearAllIQIfDisplayed("MLR") 
     201                ClearAllIQIfDisplayed("MTB")            //this returns to root: 
    197202                ClearAllIQIfDisplayed("MT")      
    198203                ClearAllIQIfDisplayed("ML")      
    199204                ClearAllIQIfDisplayed("MR")      
    200                 ClearAllIQIfDisplayed("MB") 
     205                ClearAllIQIfDisplayed("MB")              
     206         
     207//              ClearAllIQIfDisplayed("MLRTB") 
     208//              ClearAllIQIfDisplayed("MT")      
     209//              ClearAllIQIfDisplayed("ML")      
     210//              ClearAllIQIfDisplayed("MR")      
     211//              ClearAllIQIfDisplayed("MB") 
    201212         
    202213 
     
    222233         
    223234        if(binType==3) 
     235// clear EVERYTHING 
     236                ClearAllIQIfDisplayed("MLRTB") 
    224237                ClearAllIQIfDisplayed("MLR") 
    225                 ClearAllIQIfDisplayed("MTB")     
     238                ClearAllIQIfDisplayed("MTB")            //this returns to root: 
    226239                ClearAllIQIfDisplayed("MT")      
    227240                ClearAllIQIfDisplayed("ML")      
    228241                ClearAllIQIfDisplayed("MR")      
    229                 ClearAllIQIfDisplayed("MB")      
     242                ClearAllIQIfDisplayed("MB")              
     243         
     244//              ClearAllIQIfDisplayed("MLR") 
     245//              ClearAllIQIfDisplayed("MTB")     
     246//              ClearAllIQIfDisplayed("MT")      
     247//              ClearAllIQIfDisplayed("ML")      
     248//              ClearAllIQIfDisplayed("MR")      
     249//              ClearAllIQIfDisplayed("MB")      
    230250         
    231251                SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
     
    248268 
    249269        if(binType==4)          // slit aperture binning - MT, ML, MR, MB are averaged 
     270// clear EVERYTHING 
    250271                ClearAllIQIfDisplayed("MLRTB") 
    251272                ClearAllIQIfDisplayed("MLR") 
    252                 ClearAllIQIfDisplayed("MTB") 
     273                ClearAllIQIfDisplayed("MTB")            //this returns to root: 
     274                ClearAllIQIfDisplayed("MT")      
     275                ClearAllIQIfDisplayed("ML")      
     276                ClearAllIQIfDisplayed("MR")      
     277                ClearAllIQIfDisplayed("MB")              
     278         
     279         
     280//              ClearAllIQIfDisplayed("MLRTB") 
     281//              ClearAllIQIfDisplayed("MLR") 
     282//              ClearAllIQIfDisplayed("MTB") 
    253283                 
    254284                SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
     
    337367         
    338368        if(binType==2) 
     369        // clear EVERYTHING 
    339370                ClearAllIQIfDisplayed("FLRTB") 
     371                 
     372                ClearAllIQIfDisplayed("FLR") 
     373                ClearAllIQIfDisplayed("FTB") 
     374 
     375                ClearAllIQIfDisplayed("FT")      
     376                ClearAllIQIfDisplayed("FL")      
     377                ClearAllIQIfDisplayed("FR")      
     378                ClearAllIQIfDisplayed("FB") 
     379//              ClearAllIQIfDisplayed("FLRTB") 
     380//              ClearAllIQIfDisplayed("FT")      
     381//              ClearAllIQIfDisplayed("FL")      
     382//              ClearAllIQIfDisplayed("FR")      
     383//              ClearAllIQIfDisplayed("FB")      
     384 
     385                SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
     386                CheckDisplayed/W=V_1D_Data iBin_qxqy_FLR 
     387                 
     388                if(V_flag==0) 
     389                        AppendtoGraph/W=V_1D_Data iBin_qxqy_FLR vs qBin_qxqy_FLR 
     390                        AppendToGraph/W=V_1D_Data iBin_qxqy_FTB vs qBin_qxqy_FTB 
     391                        ModifyGraph/W=V_1D_Data mode=4 
     392                        ModifyGraph/W=V_1D_Data marker=19 
     393                        ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLR)=(39321,26208,1),rgb(iBin_qxqy_FTB)=(2,39321,1) 
     394                        ModifyGraph/W=V_1D_Data msize=2 
     395                        ModifyGraph/W=V_1D_Data muloffset(iBin_qxqy_FLR)={0,2} 
     396                        ModifyGraph/W=V_1D_Data grid=1 
     397                        ModifyGraph/W=V_1D_Data log=1 
     398                        ModifyGraph/W=V_1D_Data mirror=2 
     399                        Label/W=V_1D_Data left "Intensity (1/cm)" 
     400                        Label/W=V_1D_Data bottom "Q (1/A)" 
     401                endif    
     402                         
     403        endif 
     404         
     405        if(binType==3) 
     406// clear EVERYTHING 
     407                ClearAllIQIfDisplayed("FLRTB") 
     408                 
     409                ClearAllIQIfDisplayed("FLR") 
     410                ClearAllIQIfDisplayed("FTB") 
     411 
    340412                ClearAllIQIfDisplayed("FT")      
    341413                ClearAllIQIfDisplayed("FL")      
    342414                ClearAllIQIfDisplayed("FR")      
    343415                ClearAllIQIfDisplayed("FB")      
    344  
    345                 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
    346                 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLR 
    347                  
    348                 if(V_flag==0) 
    349                         AppendtoGraph/W=V_1D_Data iBin_qxqy_FLR vs qBin_qxqy_FLR 
    350                         AppendToGraph/W=V_1D_Data iBin_qxqy_FTB vs qBin_qxqy_FTB 
    351                         ModifyGraph/W=V_1D_Data mode=4 
    352                         ModifyGraph/W=V_1D_Data marker=19 
    353                         ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLR)=(39321,26208,1),rgb(iBin_qxqy_FTB)=(2,39321,1) 
    354                         ModifyGraph/W=V_1D_Data msize=2 
    355                         ModifyGraph/W=V_1D_Data muloffset(iBin_qxqy_FLR)={0,2} 
     416         
     417//              ClearAllIQIfDisplayed("FLR") 
     418//              ClearAllIQIfDisplayed("FTB")     
     419//              ClearAllIQIfDisplayed("FT")      
     420//              ClearAllIQIfDisplayed("FL")      
     421//              ClearAllIQIfDisplayed("FR")      
     422//              ClearAllIQIfDisplayed("FB")      
     423         
     424                SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
     425                CheckDisplayed/W=V_1D_Data iBin_qxqy_FLRTB 
     426                 
     427                if(V_flag==0) 
     428                        AppendtoGraph/W=V_1D_Data iBin_qxqy_FLRTB vs qBin_qxqy_FLRTB 
     429                        ModifyGraph/W=V_1D_Data mode=4 
     430                        ModifyGraph/W=V_1D_Data marker=19 
     431                        ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLRTB)=(39321,26208,1) 
     432                        ModifyGraph/W=V_1D_Data msize=2 
    356433                        ModifyGraph/W=V_1D_Data grid=1 
    357434                        ModifyGraph/W=V_1D_Data log=1 
     
    362439                         
    363440        endif 
    364          
    365         if(binType==3) 
     441 
     442        if(binType==4)          // slit aperture binning - MT, ML, MR, MB are averaged 
     443// clear EVERYTHING 
     444                ClearAllIQIfDisplayed("FLRTB") 
     445                 
    366446                ClearAllIQIfDisplayed("FLR") 
    367                 ClearAllIQIfDisplayed("FTB")     
     447                ClearAllIQIfDisplayed("FTB") 
     448 
    368449                ClearAllIQIfDisplayed("FT")      
    369450                ClearAllIQIfDisplayed("FL")      
     
    371452                ClearAllIQIfDisplayed("FB")      
    372453         
    373                 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
    374                 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLRTB 
    375                  
    376                 if(V_flag==0) 
    377                         AppendtoGraph/W=V_1D_Data iBin_qxqy_FLRTB vs qBin_qxqy_FLRTB 
    378                         ModifyGraph/W=V_1D_Data mode=4 
    379                         ModifyGraph/W=V_1D_Data marker=19 
    380                         ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLRTB)=(39321,26208,1) 
    381                         ModifyGraph/W=V_1D_Data msize=2 
    382                         ModifyGraph/W=V_1D_Data grid=1 
    383                         ModifyGraph/W=V_1D_Data log=1 
    384                         ModifyGraph/W=V_1D_Data mirror=2 
    385                         Label/W=V_1D_Data left "Intensity (1/cm)" 
    386                         Label/W=V_1D_Data bottom "Q (1/A)" 
    387                 endif    
    388                          
    389         endif 
    390  
    391         if(binType==4)          // slit aperture binning - MT, ML, MR, MB are averaged 
    392                 ClearAllIQIfDisplayed("FLRTB") 
    393                 ClearAllIQIfDisplayed("FLR") 
    394                 ClearAllIQIfDisplayed("FTB") 
     454         
     455//              ClearAllIQIfDisplayed("FLRTB") 
     456//              ClearAllIQIfDisplayed("FLR") 
     457//              ClearAllIQIfDisplayed("FTB") 
    395458                 
    396459                SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Detector_Isolate.ipf

    r1022 r1023  
    2626// x- link the function to the Isolate button on the main panel 
    2727// 
    28 // x- when selecting the detector, set the x/y pixel sizes 
    2928// -- figure out how to (better?) re-plot the images when swapping between LR and TB panels 
    3029// -- graphically show the beam center / radius of where it is in relation to the panel 
     30// 
     31// -- when selecting the detector, set the x/y pixel sizes -- un-do this? 
     32// -- The xPixels, yPixels axis labels are not correct. The axes are scaled to the beam center, through 
     33//    a call to V_RestorePanels() when the raw data is loaded. The BeamCenter panel removes this wave scaling 
     34//    so that the data can be presented (and fit) purely as pixels. On the isolate panel, the scaling has not 
     35//    been removed and is confusing, especially on T/B panels. 
     36// -- add a checkbox or button to remove/replace the wave scaling to the beam center. this is in a sense,  
     37//    a correction to toggle. 
    3138// 
    3239// 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf

    r1018 r1023  
    1414// -- clean up and remove all of the references to other facilities, since they will not have VSANS modules 
    1515// -- add in more appropriate and some missing fields more useful to VSANS (intent, multiple beam centers, etc.) 
     16// -- can I make the choice of columns customizable? There are "sets" of columns that are not used for  
     17//    some experiments (magnetic, rotation, temperature scans, etc.) but are necessary for others. 
    1618// 
    1719// TODO PRIORITY: 
     
    1921//    files that are NOT RAW VSANS data (MASK and DIV, but these are HDF) 
    2022// x- WHY -- because if I PATCH anything, then re-run the catalog, the changes are NOT shown, since the  
    21 //    reader will g to the LOCAL copy first! So maybe I need to clear the folder out before I start the  
     23//    reader will go to the LOCAL copy first! So maybe I need to clear the folder out before I start the  
    2224//    file catalog 
    23 // -- maybe it's a good thing to wipe out the RawVSANS folder before an Experiment SAVE (to save a LOT of  
     25// x- maybe it's a good thing to wipe out the RawVSANS folder before an Experiment SAVE (to save a LOT of  
    2426//    space on disk and a potentially VERY long save 
    2527// x- see V_CleanOutRawVSANS() in V_Utilities_General for the start of this (this is now called in  
     
    3335//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
    3436//     But typically, I'd like to see that the disk version really did get updated... 
    35 // 
     37// -- make a background task to periodically "kill" a few of the files? maybe too dangerous. 
     38 
     39 
     40 
    3641 
    3742// 
     
    6974         
    7075        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
    71         Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
     76//      Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
    7277        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    7378        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    74         Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     79//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    7580        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    7681        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    7984        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    8085        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    81         Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    82         Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     86//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     87//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    8388        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
    8489        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 
    85         Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
    86         Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
     90//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
     91//      Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
    8792        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 
    8893        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" 
     
    9095        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"            //added Mar 2008 
    9196        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos"            //added Mar 2010 
     97        Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     98        Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
    9299 
    93100 
    94101        WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
    95         WAVE/T Suffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
     102//      WAVE/T Suffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
    96103        WAVE/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    97104        WAVE/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    98         WAVE SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     105//      WAVE SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    99106        WAVE Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    100107        WAVE CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    103110        WAVE Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    104111        WAVE Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    105         WAVE XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    106         WAVE YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     112//      WAVE XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     113//      WAVE YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    107114 
    108115        WAVE/T nGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
    109116        WAVE NumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 
    110         WAVE RunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
    111         WAVE IsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
     117//      WAVE RunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
     118//      WAVE IsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
    112119        WAVE RotAngle = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 
    113120        WAVE Temperature = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" 
     
    115122        WAVE MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"              //added Mar 2008 
    116123        WAVE Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 
     124        WAVE/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     125        WAVE Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
    117126 
    118127         
    119128        If(V_Flag==0) 
    120129                V_BuildTableWindow() 
    121                 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=40 
     130//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=40 
    122131                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=40 
    123132                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime)=50 
     
    126135                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission)=40 
    127136                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness)=40 
    128                 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter)=40 
    129                 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter)=40 
     137//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter)=40 
     138//              ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter)=40 
    130139                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens)=30 
    131140                ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle)=50 
     
    137146                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos)=3                   //to make the display look nice, given the floating point values from ICE 
    138147                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=3                //may not work in all situations, but an improvement 
    139                 ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=5 
     148//              ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=5 
    140149                ModifyTable trailingZeros(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=1 
    141150                ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=4 
    142151 
    143152                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
     153 
     154// TODO: 
     155//  -- experimental hook with contextual menu 
     156//               
     157                SetWindow kwTopWin hook=V_CatTableHook, hookevents=1    // mouse down events 
     158 
    144159        Endif 
    145160 
     
    147162// NEW for VSANS 
    148163// clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk 
    149 // will not be read in, the "bad" local copy will be read in. 
     164// will not be read in, the "bad" local copy will be read in for any subsequent operations. 
    150165// TODO: 
    151 //  -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If 
     166//  -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 
    152167//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
    153168//     But typically, I'd like to see that the disk version really did get updated... 
     
    155170        //      V_CleanOutRawVSANS() 
    156171// This will display a progress bar 
    157         V_CleanupData_w_Progress(0,1) 
    158  
     172        Variable numToClean 
     173        numToClean = V_CleanupData_w_Progress(0,1) 
     174 
     175        Print "Cleaned # files = ",numToClean 
     176        Print "Cleanup time (s) = ",(ticks - t1)/60.15 
     177        Variable cleanupTime = (ticks - t1)/60.15 
    159178 
    160179        //get a list of all files in the folder, some will be junk version numbers that don't exist      
     
    212231        KillWaves/Z notRAWlist 
    213232// 
    214 //      Print "Total time (s) = ",(ticks - t1)/60.15 
    215 //      Print "Time per raw data file (s) = ",(ticks - t1)/60.15/(numItems-numpnts(notRawList)) 
     233        Print "Total time (s) = ",(ticks - t1)/60.15 
     234        Print "Time per raw data file (without cleanup time) (s) = ",( (ticks - t1)/60.15 - cleanupTime)/(numItems-numpnts(notRawList)) 
    216235        // 
    217236        // clean out again, so that the file SAVE is not slow due to the large experiment size 
     
    223242        return(0) 
    224243End 
     244 
     245// 
     246// TODO: 
     247// -- this is experimental... 
     248// -- what else to add to the menu? 
     249// -- add directly to WORK files? 
     250// -- "set" as some special file type, intent, use? 
     251// -- "check" the reduction protocol for completeness? 
     252// 
     253// x- seems to not "let go" of a selection (missing the mouse up?) 
     254//    (possibly) less annoying if I only handle mouseup and present a menu then. 
     255// 
     256Function V_CatTableHook(infoStr) 
     257        String infoStr 
     258        String event= StringByKey("EVENT",infoStr) 
     259//      print infoStr 
     260//      Print "EVENT= ",event 
     261        strswitch(event) 
     262//              case "mousedown": 
     263                case "mouseup": 
     264//                      Variable xpix= NumberByKey("MOUSEX",infoStr) 
     265//                      Variable ypix= NumberByKey("MOUSEY",infoStr) 
     266//                      PopupContextualMenu/C=(xpix, ypix) "yes;no;maybe;" 
     267                        PopupContextualMenu "Load RAW;no;maybe;" 
     268                        strswitch(S_selection) 
     269                                case "Load RAW": 
     270                                        // do something because "yes" was chosen 
     271                                        //print "yes" 
     272                                        WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
     273                                        GetSelection table,CatVSANSTable,1 
     274//                                      Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol 
     275                                        Print "Loading " + FileNames[V_StartRow] 
     276                                        Variable err = V_LoadHDF5Data(FileNames[V_StartRow],"RAW") 
     277                                        if(!err)                //directly from, and the same steps as DisplayMainButtonProc(ctrlName) 
     278                                                SVAR hdfDF = root:file_name                     // last file loaded, may not be the safest way to pass 
     279                                                String folder = StringFromList(0,hdfDF,".") 
     280                                                 
     281                                                // this (in SANS) just passes directly to fRawWindowHook() 
     282                                                Execute "UpdateDisplayInformation(\"RAW\")"             // plot the data in whatever folder type 
     283                                                 
     284                                                FakeRestorePanelsButtonClick()          //so the panels display correctly 
     285                                                 
     286                                                // set the global to display ONLY if the load was called from here, not from the  
     287                                                // other routines that load data (to read in values) 
     288                                                SVAR gLast = root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
     289                                                gLast = hdfDF 
     290                                                 
     291                                        endif 
     292                                        break; 
     293                                case "no": 
     294                                        print "no" 
     295                                        break; 
     296                                case "maybe": 
     297                                        // do something because "maybe" was chosen 
     298                                        break; 
     299                        endswitch 
     300        endswitch 
     301        return 0 
     302End 
     303 
     304 
    225305 
    226306//appends the list of files that are not RAW SANS data to the filename wave (1st column) 
     
    242322Function V_SortWaves() 
    243323        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
    244         Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
     324//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
    245325        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    246326        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    247         Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     327//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    248328        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    249329        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    252332        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    253333        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    254         Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    255         Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     334//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     335//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    256336 
    257337        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
    258338        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 
    259         Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
    260         Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
     339//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
     340//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
    261341        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 
    262342        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" 
     
    264344        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"             //added Mar 2008 
    265345        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 
    266  
    267  
    268 // TODO -- the default sort is by SUFFIX, which does not exist for VSANS. So decide on a better key 
    269         Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides 
     346        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     347        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
     348 
     349 
     350// DONE 
     351// x- the default sort is by SUFFIX, which does not exist for VSANS. So decide on a better key 
     352//     now, the sort is by FileName by default 
     353//      Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides 
     354        Sort GFilenames, GFilenames, GLabels, GDateTime,  GIntent, G_ID, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,GRot,GTemp,GField,GMCR,GPos,gNumGuides 
    270355 
    271356        return(0) 
     
    278363        Wave/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    279364        Wave/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    280         Wave SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     365//      Wave SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    281366        Wave Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    282367        Wave CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    285370        Wave Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    286371        Wave Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    287         Wave XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    288         Wave YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     372//      Wave XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     373//      Wave YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    289374 
    290375        Wave/T NumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
     
    295380        Wave MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR"              //added Mar 2008 
    296381        Wave Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 
    297  
     382        Wave/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     383        Wave Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
    298384 
    299385// original order, magnetic at the end 
    300386//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 
    301387// with numGuides 
    302         Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 
    303 // alternate ordering, put the magnetic information first 
    304 //      Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 
     388//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 
     389        Edit Filenames, Labels, DateAndTime,  Intent, Group_ID, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 
    305390 
    306391 
     
    321406 
    322407        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
    323         Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
     408//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
    324409        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    325410        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    326411 
    327         Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     412//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    328413        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    329414        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    332417        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    333418        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    334         Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    335         Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     419//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     420//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    336421        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
    337422        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 
    338         Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
    339         Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
     423//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
     424//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
    340425        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 
    341426        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" 
     
    343428        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" 
    344429        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 
     430        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     431        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
    345432 
    346433        lastPoint = numpnts(GLambda) 
     
    350437        GFilenames[lastPoint]=sname 
    351438         
    352         //read the file alphanumeric suffix 
    353         // TODO -- this does not exist for VSANS - so is there an equivalent, or delete? 
    354         InsertPoints lastPoint,1,GSuffix 
    355         GSuffix[lastPoint]="unknown" 
     439//      //read the file alphanumeric suffix 
     440//      // TODO -- this does not exist for VSANS - so is there an equivalent, or delete? 
     441//      InsertPoints lastPoint,1,GSuffix 
     442//      GSuffix[lastPoint]="unknown" 
    356443 
    357444        //read the counting time (integer) 
     
    392479        GThickness[lastPoint]=V_getSampleThickness(fname) 
    393480 
    394         // TODO --  the x and y center have different meaning, since there are multiple panels 
    395         // TODO -- remove the hard-wiring 
    396         String detStr = "FL" 
    397         //XCenter of beam on detector 
    398         InsertPoints lastPoint,1,GXCenter 
    399         GXCenter[lastPoint]=V_getDet_beam_center_x(fname,detStr) 
    400          
    401         // TODO --  the x and y center have different meaning, since there are multiple panels 
    402         //YCenter 
    403         InsertPoints lastPoint,1,GYCenter 
    404         GYCenter[lastPoint]=V_getDet_beam_center_y(fname,detStr) 
    405  
    406         // TODO -- SDD has no real meaning - since there are multiple distances to report 
    407         //SDD 
    408         InsertPoints lastPoint,1,GSDD 
    409         GSDD[lastPoint]=V_getDet_ActualDistance(fname,detStr) 
     481//      // TODO --  the x and y center have different meaning, since there are multiple panels 
     482//      // TODO -- remove the hard-wiring 
     483//      String detStr = "FL" 
     484//      //XCenter of beam on detector 
     485//      InsertPoints lastPoint,1,GXCenter 
     486//      GXCenter[lastPoint]=V_getDet_beam_center_x(fname,detStr) 
     487//       
     488//      // TODO --  the x and y center have different meaning, since there are multiple panels 
     489//      //YCenter 
     490//      InsertPoints lastPoint,1,GYCenter 
     491//      GYCenter[lastPoint]=V_getDet_beam_center_y(fname,detStr) 
     492 
     493//      // TODO -- SDD has no real meaning - since there are multiple distances to report 
     494//      //SDD 
     495//      InsertPoints lastPoint,1,GSDD 
     496//      GSDD[lastPoint]=V_getDet_ActualDistance(fname,detStr) 
    410497         
    411498        //wavelength 
     
    427514        GField[lastPoint]=1000 
    428515         
    429         //Beamstop position (not reported) 
    430         //strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 
    431  
    432         //the run number (not displayed in the table, but carried along) 
    433         InsertPoints lastPoint,1,GRunNumber 
    434         GRunNumber[lastPoint] = V_GetRunNumFromFile(sname) 
    435  
    436         // TODO -- the isTransFile utility has not yet been written 
    437         // 0 if the file is a scattering  file, 1 (truth) if the file is a transmission file 
    438         InsertPoints lastPoint,1,GIsTrans 
    439         GIsTrans[lastPoint]  = V_isTransFile(fname)             //returns one if beamstop is "out" 
     516 
     517//      //the run number (not displayed in the table, but carried along) 
     518//      InsertPoints lastPoint,1,GRunNumber 
     519//      GRunNumber[lastPoint] = V_GetRunNumFromFile(sname) 
     520// 
     521//      // TODO -- the isTransFile utility has not yet been written 
     522//      // 0 if the file is a scattering  file, 1 (truth) if the file is a transmission file 
     523//      InsertPoints lastPoint,1,GIsTrans 
     524//      GIsTrans[lastPoint]  = V_isTransFile(fname)             //returns one if beamstop is "out" 
    440525         
    441526        // Monitor Count Rate 
     
    452537        InsertPoints lastPoint,1,GPos 
    453538        GPos[lastPoint] = str2num(V_getSamplePosition(fname)) 
     539 
     540// Intent (text) 
     541        InsertPoints lastPoint,1,GIntent 
     542        GIntent[lastPoint] = V_getReduction_intent(fname) 
     543         
     544// group_id (sample) 
     545        InsertPoints lastPoint,1,G_ID 
     546        G_ID[lastPoint] = V_getSample_group_ID(fname) 
    454547 
    455548        return(0) 
     
    489582        Button SortLabelsButton,                        pos={25,38},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Labels" 
    490583        Button SortDateAndTimeButton,   pos={25,68},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Date and Time" 
    491         Button SortSSDButton,                   pos={25,98},            size={140,24},proc=V_CatVSANSTable_SortProc,title="SSD" 
    492         Button SortSDDButton,                   pos={25,128},   size={140,24},proc=V_CatVSANSTable_SortProc,title="SDD" 
     584        Button SortIntentButton,                        pos={25,98},            size={140,24},proc=V_CatVSANSTable_SortProc,title="Intent" 
     585        Button SortIDButton,                    pos={25,128},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Group ID" 
    493586        Button SortLambdaButton,                        pos={25,158},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Lambda" 
    494587        Button SortCountTimButton,              pos={25,188},   size={140,24},proc=V_CatVSANSTable_SortProc,title="Count Time" 
     
    520613 
    521614        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
    522         Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
     615//      Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 
    523616        Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 
    524617        Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 
    525         Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
     618//      Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 
    526619        Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 
    527620        Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" 
     
    530623        Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 
    531624        Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 
    532         Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
    533         Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
     625//      Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 
     626//      Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 
    534627        Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 
    535628        Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 
    536         Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
    537         Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
     629//      Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 
     630//      Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 
    538631        Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 
    539632        Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" 
     
    541634        Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" 
    542635        Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 
     636        Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 
     637        Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 
    543638 
    544639         
     
    557652         
    558653                case "SortFilenamesButton": 
    559                         Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
     654//                      Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
     655                        Sort GFilenames,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
    560656                        break 
    561657                         
    562658                case "SortLabelsButton": 
    563                         Sort GLabels, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
     659//                      Sort GLabels, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
     660                        Sort GLabels,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
    564661                        break 
    565662                         
    566663                case "SortDateAndTimeButton": 
    567                         Sort GDateTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
    568                         break 
    569                          
    570                 case "SortSSDButton": 
    571                         break 
    572                          
    573                 case "SortSDDButton": 
    574                         Sort GSDD, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     664//                      Sort GDateTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 
     665                        Sort GDateTime,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     666 
     667                        break 
     668                         
     669                case "SortIntentButton": 
     670                        Sort GIntent,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     671                        break 
     672                         
     673                case "SortIDButton": 
     674                        Sort G_ID,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
    575675                        break 
    576676                         
    577677                case "SortLambdaButton": 
    578                         Sort GLambda, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     678//                      Sort GLambda, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     679                        Sort GLambda,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     680 
    579681                        break 
    580682                         
    581683                case "SortCountTimButton": 
    582                         Sort GCntTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     684//                      Sort GCntTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     685                        Sort GCntTime,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     686 
    583687                        break 
    584688                         
    585689                case "SortTotalCountsButton": 
    586                         Sort GTotCnts, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     690//                      Sort GTotCnts, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     691                        Sort GTotCnts,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     692 
    587693                        break 
    588694                         
    589695                case "SortCountRateButton": 
    590                         Sort GCntRate, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     696//                      Sort GCntRate, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     697                        Sort GCntRate,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     698 
    591699                        break 
    592700                         
     
    595703                         
    596704                case "SortTransmissionButton": 
    597                         Sort GTransmission, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     705//                      Sort GTransmission, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     706                        Sort GTransmission,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     707 
    598708                        break 
    599709                         
    600710                case "SortThicknessButton": 
    601                         Sort GThickness, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     711//                      Sort GThickness, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR  
     712                        Sort GThickness,  GFilenames, GLabels, GDateTime,  GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness,   GNumAttens,   GRot, GTemp, GField, GMCR, GIntent, G_ID 
     713 
    602714                        break 
    603715         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf

    r1018 r1023  
    879879 
    880880 
     881 
     882 
     883 
     884 
     885////////// 
     886// 
     887// These procedures are needed to write out MASK and DIV files 
     888// 
     889//////// 
     890 
     891 
     892// 
     893// saves a specified folder, with a given filename. 
     894// saves to the home path 
     895// 
     896Proc Save_VSANS_file(dfPath, filename) 
     897        String dfPath   ="root:VSANS_file"              // e.g., "root:FolderA" or ":" 
     898        String filename = "Test_VSANS_file.h5" 
     899         
     900        H_NXSANS_SaveGroupAsHDF5(dfPath, filename) 
     901End 
     902 
     903 
     904//       
     905// this is my procedure to save the folders to HDF5, once I've filled the folder tree 
     906// 
     907// this does NOT save attributes, but gets the folder structure correct 
     908// 
     909Function H_NXSANS_SaveGroupAsHDF5(dfPath, filename) 
     910        String dfPath   // e.g., "root:FolderA" or ":" 
     911        String filename 
     912 
     913        Variable result = 0     // 0 means no error 
     914         
     915        Variable fileID 
     916        HDF5CreateFile/P=home /O /Z fileID as filename 
     917        if (V_flag != 0) 
     918                Print "HDF5CreateFile failed" 
     919                return -1 
     920        endif 
     921 
     922        HDF5SaveGroup /IGOR=0 /O /R /Z $dfPath, fileID, "." 
     923//      HDF5SaveGroup /O /R /Z $dfPath, fileID, "." 
     924        if (V_flag != 0) 
     925                Print "HDF5SaveGroup failed" 
     926                result = -1 
     927        endif 
     928         
     929        HDF5CloseFile fileID 
     930 
     931        return result 
     932End 
     933 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf

    r1022 r1023  
    22#pragma rtGlobals=3             // Use modern global access method and strict wave access. 
    33 
    4 // 
    5 // does no scaling, only the basic (default) trim of the ends, concatenate, sort, and save 
    6 // 
    7  
    8  
     4 
     5// 
     6// Operation does no scaling, only the basic (default) trim of the ends, concatenate, sort, and save 
     7// -- if data has been converted to WORK and hte solid angle correction was done, then the data 
     8//   is per unit solid angle, and matches up - at least the simulated data does... 
     9// 
     10// 
     11// V_DataPlotting.ipf is where the I(q) panel is drawn and the binning is set 
    912// 
    1013// see the VCALC BinAllMiddlePanels() for an example of this 
    1114// see the binning routines in VC_DetectorBinning_Utils.ipf for the details 
    1215// 
     16 
    1317// TODO  
    1418// 
     
    2529// x- figure out when this needs to be called to (force) re-calculate I vs Q 
    2630// 
    27  
    28  
    2931 
    3032 
     
    105107        String type = root:Packages:NIST:VSANS:Globals:gCurDispType 
    106108 
    107 // figure out which binning was used 
    108109 
    109110// trim the data if needed 
     
    113114 
    114115// concatenate the data sets 
     116// TODO x- figure out which binning was used (this is done in V_1DConcatenate()) 
    115117        // clear the old tmp waves first, if they still exist 
    116118        SetDataFolder $("root:Packages:NIST:VSANS:"+type) 
     
    160162// 
    161163// TODO: 
     164// x- this currently ignores the binning type (one, two, etc. ) 
    162165// -- this currently assumes that all of the waves exist 
    163166// -- need robust error checking for wave existence 
    164167// -- wave names are hard-wired and their name and location may be different in the future 
    165 // -- if different averaging options were chosen (bin type of 2, 4 etc) then 
     168// x- if different averaging options were chosen (bin type of 2, 4 etc) then 
    166169//    although waves may exist, they may not be the right ones to use. There 
    167170//    will be a somewhat complex selection process 
    168171// x- detector B is currently skipped 
    169172// 
    170 // this seems like a lot of extra work to do something so simple... 
     173// this seems like a lot of extra work to do something so simple...but it's better than a loop 
    171174// 
    172175//  root:Packages:NIST:VSANS:RAW:iBin_qxqy_FB 
     176// 
     177// binType = 1 = one 
     178// binType = 2 = two 
     179// binType = 3 = four 
     180// binType = 4 = Slit Mode 
     181// 
    173182Function V_1DConcatenate(folderStr) 
    174183        String folderStr 
    175184         
     185        Variable binType = V_GetBinningPopMode() 
     186         
     187         
    176188        SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 
    177          
    178         Wave/Z q_fb = qBin_qxqy_FB 
    179         Wave/Z q_ft = qBin_qxqy_FT 
    180         Wave/Z q_fl = qBin_qxqy_FL 
    181         Wave/Z q_fr = qBin_qxqy_FR 
    182         Wave/Z q_mb = qBin_qxqy_MB 
    183         Wave/Z q_mt = qBin_qxqy_MT 
    184         Wave/Z q_ml = qBin_qxqy_ML 
    185         Wave/Z q_mr = qBin_qxqy_MR 
    186         Wave/Z q_b = qBin_qxqy_B 
    187  
    188         Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 
    189          
    190         Wave/Z i_fb = iBin_qxqy_FB 
    191         Wave/Z i_ft = iBin_qxqy_FT 
    192         Wave/Z i_fl = iBin_qxqy_FL 
    193         Wave/Z i_fr = iBin_qxqy_FR 
    194         Wave/Z i_mb = iBin_qxqy_MB 
    195         Wave/Z i_mt = iBin_qxqy_MT 
    196         Wave/Z i_ml = iBin_qxqy_ML 
    197         Wave/Z i_mr = iBin_qxqy_MR 
    198         Wave/Z i_b = iBin_qxqy_B 
    199          
    200         Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 
    201  
    202         Wave/Z s_fb = eBin_qxqy_FB 
    203         Wave/Z s_ft = eBin_qxqy_FT 
    204         Wave/Z s_fl = eBin_qxqy_FL 
    205         Wave/Z s_fr = eBin_qxqy_FR 
    206         Wave/Z s_mb = eBin_qxqy_MB 
    207         Wave/Z s_mt = eBin_qxqy_MT 
    208         Wave/Z s_ml = eBin_qxqy_ML 
    209         Wave/Z s_mr = eBin_qxqy_MR 
    210         Wave/Z s_b = eBin_qxqy_B 
    211          
    212         Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 
    213                  
    214 //      Concatenate/NP {$("root:"+folder1+":"+folder1+"_q"),$("root:"+folder2+":"+folder2+"_q")},tmp_q 
    215 //      Concatenate/NP {$("root:"+folder1+":"+folder1+"_i"),$("root:"+folder2+":"+folder2+"_i")},tmp_i 
    216 //      Concatenate/NP {$("root:"+folder1+":"+folder1+"_s"),$("root:"+folder2+":"+folder2+"_s")},tmp_s 
    217 //      Concatenate/NP {$("root:"+folder1+":res0"),$("root:"+folder2+":res0")},tmp_res0 
    218 //      Concatenate/NP {$("root:"+folder1+":res1"),$("root:"+folder2+":res1")},tmp_res1 
    219 //      Concatenate/NP {$("root:"+folder1+":res2"),$("root:"+folder2+":res2")},tmp_res2 
    220 //      Concatenate/NP {$("root:"+folder1+":res3"),$("root:"+folder2+":res3")},tmp_res3 
    221          
    222 //// move the concatenated result into the destination folder (killing the old stuff first) 
    223 //      KillWaves/Z $("root:"+folder2+":"+folder2+"_q") 
    224 //      KillWaves/Z $("root:"+folder2+":"+folder2+"_i") 
    225 //      KillWaves/Z $("root:"+folder2+":"+folder2+"_s") 
    226 //      KillWaves/Z $("root:"+folder2+":res0") 
    227 //      KillWaves/Z $("root:"+folder2+":res1") 
    228 //      KillWaves/Z $("root:"+folder2+":res2") 
    229 //      KillWaves/Z $("root:"+folder2+":res3") 
    230          
    231 //      Duplicate/O tmp_q $("root:"+folder2+":"+folder2+"_q") 
    232 //      Duplicate/O tmp_i $("root:"+folder2+":"+folder2+"_i") 
    233 //      Duplicate/O tmp_s $("root:"+folder2+":"+folder2+"_s") 
    234 //      Duplicate/O tmp_res0 $("root:"+folder2+":res0") 
    235 //      Duplicate/O tmp_res1 $("root:"+folder2+":res1") 
    236 //      Duplicate/O tmp_res2 $("root:"+folder2+":res2") 
    237 //      Duplicate/O tmp_res3 $("root:"+folder2+":res3") 
     189 
     190        if(binType == 1)         
     191                Wave/Z q_fb = qBin_qxqy_FB 
     192                Wave/Z q_ft = qBin_qxqy_FT 
     193                Wave/Z q_fl = qBin_qxqy_FL 
     194                Wave/Z q_fr = qBin_qxqy_FR 
     195                Wave/Z q_mb = qBin_qxqy_MB 
     196                Wave/Z q_mt = qBin_qxqy_MT 
     197                Wave/Z q_ml = qBin_qxqy_ML 
     198                Wave/Z q_mr = qBin_qxqy_MR 
     199                Wave/Z q_b = qBin_qxqy_B 
     200         
     201                Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 
     202                 
     203                Wave/Z i_fb = iBin_qxqy_FB 
     204                Wave/Z i_ft = iBin_qxqy_FT 
     205                Wave/Z i_fl = iBin_qxqy_FL 
     206                Wave/Z i_fr = iBin_qxqy_FR 
     207                Wave/Z i_mb = iBin_qxqy_MB 
     208                Wave/Z i_mt = iBin_qxqy_MT 
     209                Wave/Z i_ml = iBin_qxqy_ML 
     210                Wave/Z i_mr = iBin_qxqy_MR 
     211                Wave/Z i_b = iBin_qxqy_B 
     212                 
     213                Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 
     214         
     215                Wave/Z s_fb = eBin_qxqy_FB 
     216                Wave/Z s_ft = eBin_qxqy_FT 
     217                Wave/Z s_fl = eBin_qxqy_FL 
     218                Wave/Z s_fr = eBin_qxqy_FR 
     219                Wave/Z s_mb = eBin_qxqy_MB 
     220                Wave/Z s_mt = eBin_qxqy_MT 
     221                Wave/Z s_ml = eBin_qxqy_ML 
     222                Wave/Z s_mr = eBin_qxqy_MR 
     223                Wave/Z s_b = eBin_qxqy_B 
     224                 
     225                Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 
     226        endif 
     227 
     228        if(binType == 2)         
     229                Wave/Z q_ftb = qBin_qxqy_FTB 
     230                Wave/Z q_flr = qBin_qxqy_FLR 
     231                Wave/Z q_mtb = qBin_qxqy_MTB 
     232                Wave/Z q_mlr = qBin_qxqy_MLR 
     233                Wave/Z q_b = qBin_qxqy_B 
     234         
     235                Concatenate/NP {q_ftb,q_flr,q_mtb,q_mlr,q_b}, tmp_q 
     236                 
     237                Wave/Z i_ftb = iBin_qxqy_FTB 
     238                Wave/Z i_flr = iBin_qxqy_FLR 
     239                Wave/Z i_mtb = iBin_qxqy_MTB 
     240                Wave/Z i_mlr = iBin_qxqy_MLR 
     241                Wave/Z i_b = iBin_qxqy_B 
     242                 
     243                Concatenate/NP {i_ftb,i_flr,i_mtb,i_mlr,i_b}, tmp_i 
     244         
     245                Wave/Z s_ftb = eBin_qxqy_FTB 
     246                Wave/Z s_flr = eBin_qxqy_FLR 
     247                Wave/Z s_mtb = eBin_qxqy_MTB 
     248                Wave/Z s_mlr = eBin_qxqy_MLR 
     249                Wave/Z s_b = eBin_qxqy_B 
     250                 
     251                Concatenate/NP {s_ftb,s_flr,s_mtb,s_mlr,s_b}, tmp_s 
     252        endif 
     253 
     254        if(binType == 3)         
     255                Wave/Z q_flrtb = qBin_qxqy_FLRTB 
     256                Wave/Z q_mlrtb = qBin_qxqy_MLRTB 
     257                Wave/Z q_b = qBin_qxqy_B 
     258         
     259                Concatenate/NP {q_flrtb,q_mlrtb,q_b}, tmp_q 
     260                 
     261                Wave/Z i_flrtb = iBin_qxqy_FLRTB 
     262                Wave/Z i_mlrtb = iBin_qxqy_MLRTB 
     263                Wave/Z i_b = iBin_qxqy_B 
     264                 
     265                Concatenate/NP {i_flrtb,i_mlrtb,i_b}, tmp_i 
     266         
     267                Wave/Z s_flrtb = eBin_qxqy_FLRTB 
     268                Wave/Z s_mlrtb = eBin_qxqy_MLRTB 
     269                Wave/Z s_b = eBin_qxqy_B 
     270                 
     271                Concatenate/NP {s_flrtb,s_mlrtb,s_b}, tmp_s 
     272        endif 
     273 
     274// TODO - This is the identical set of waves as for the case of binType = 1. 
     275// they have the same names, but are averaged differently since it's slit mode. 
     276// I have separated this, since in practice the TB panels are probably best to ignore 
     277// and NOT include in the averaging since the Qy range is so limited. 
     278        if(binType == 4)         
     279                Wave/Z q_fb = qBin_qxqy_FB 
     280                Wave/Z q_ft = qBin_qxqy_FT 
     281                Wave/Z q_fl = qBin_qxqy_FL 
     282                Wave/Z q_fr = qBin_qxqy_FR 
     283                Wave/Z q_mb = qBin_qxqy_MB 
     284                Wave/Z q_mt = qBin_qxqy_MT 
     285                Wave/Z q_ml = qBin_qxqy_ML 
     286                Wave/Z q_mr = qBin_qxqy_MR 
     287                Wave/Z q_b = qBin_qxqy_B 
     288         
     289                Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 
     290                 
     291                Wave/Z i_fb = iBin_qxqy_FB 
     292                Wave/Z i_ft = iBin_qxqy_FT 
     293                Wave/Z i_fl = iBin_qxqy_FL 
     294                Wave/Z i_fr = iBin_qxqy_FR 
     295                Wave/Z i_mb = iBin_qxqy_MB 
     296                Wave/Z i_mt = iBin_qxqy_MT 
     297                Wave/Z i_ml = iBin_qxqy_ML 
     298                Wave/Z i_mr = iBin_qxqy_MR 
     299                Wave/Z i_b = iBin_qxqy_B 
     300                 
     301                Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 
     302         
     303                Wave/Z s_fb = eBin_qxqy_FB 
     304                Wave/Z s_ft = eBin_qxqy_FT 
     305                Wave/Z s_fl = eBin_qxqy_FL 
     306                Wave/Z s_fr = eBin_qxqy_FR 
     307                Wave/Z s_mb = eBin_qxqy_MB 
     308                Wave/Z s_mt = eBin_qxqy_MT 
     309                Wave/Z s_ml = eBin_qxqy_ML 
     310                Wave/Z s_mr = eBin_qxqy_MR 
     311                Wave/Z s_b = eBin_qxqy_B 
     312                 
     313                Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 
     314        endif 
     315 
     316 
     317 
    238318 
    239319// Can't kill here, since they are still needed to sort and write out! 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf

    r1022 r1023  
    164164 
    165165         
    166         // lookup waves for log and linear display of images 
     166        // set the lookup waves for log/lin display of the detector images 
     167        V_MakeImageLookupTables(10000,0,1) 
     168 
     169 
     170 
     171        //set flag if Demo Version is detected 
     172        Variable/G root:Packages:NIST:VSANS:Globals:isDemoVersion = V_isDemo() 
     173         
     174        //set XML globals 
     175//      String/G root:Packages:NIST:gXMLLoader_Title = "" 
     176         
     177        Return(0) 
     178End 
     179 
     180// 
     181//num = number of points (10000 seeems to be a good number so far) 
     182// lo = lower value (between 0 and 1) 
     183// hi = upper value (between 0 and 1) 
     184// 
     185// note that it is currenty NOT OK for lo > hi (!= reversed color scale, right now log(negative) == bad) 
     186// 
     187// TODO hi, lo not used properly here, seems to mangle log display now that I'm switching the lo,hi of the ctab 
     188// 
     189Function V_MakeImageLookupTables(num,lo,hi) 
     190        Variable num,lo,hi 
     191 
     192                // lookup waves for log and linear display of images 
    167193        // this is used for the main data display. With this, I can use the original 
    168194        // detector data (no copy) and the zeros in the data set are tolerated when displaying 
    169195        // on log scale 
    170196        SetDataFolder root:Packages:NIST:VSANS:Globals 
    171         Variable num,val,offset 
    172         num=10000 
    173         offset = 1/num 
     197        Variable val,offset 
     198         
     199        offset = 1/num          //can't use 1/lo if lo == 0 
    174200         
    175201        Make/O/D/N=(num) logLookupWave,linearLookupWave 
     202         
    176203        linearLookupWave = (p+1)/num 
     204         
    177205         
    178206        logLookupWave = log(linearLookupWave) 
     
    183211         
    184212        SetDataFolder root: 
    185  
    186  
    187         //set flag if Demo Version is detected 
    188         Variable/G root:Packages:NIST:VSANS:Globals:isDemoVersion = V_isDemo() 
    189          
    190         //set XML globals 
    191 //      String/G root:Packages:NIST:gXMLLoader_Title = "" 
    192          
    193         Return(0) 
    194 End 
    195  
     213         
     214        return(0) 
     215end 
    196216 
    197217// 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r1019 r1023  
    430430//      Button MainButton_4d,pos={15,180},size={110,20},proc=CatShort_MainButtonProc,title="CAT/Notebook" 
    431431//      Button MainButton_4d,help={"This will generate a CATalog notebook of all files in a specified local folder"} 
    432         Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans" 
    433         Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"} 
     432//      Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans" 
     433//      Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"} 
    434434        Button MainButton_4f,pos={180,120},size={130,20},proc=PRODIV_MainButtonProc,title="Make DIV file" 
    435435        Button MainButton_4f,help={"Merges two stored workfiles (CORrected) into a DIV file, and saves the result"} 
     
    443443        Button MainButton_4c,disable=1 
    444444//      Button MainButton_4d,disable=1 
    445         Button MainButton_4e,disable=1 
     445//      Button MainButton_4e,disable=1 
    446446        Button MainButton_4f,disable=1 
    447447        Button MainButton_4g,disable=1 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r1015 r1023  
    833833//      H_Fill_VSANS_Attributes() 
    834834         
    835         // fill in with VCALC simulation bits 
    836 //      H_Fill_VSANS_wSim() 
    837          
     835 
    838836End 
    839837 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf

    r1022 r1023  
    5454        FakeTabClick(1) 
    5555        FakeTabClick(0) 
     56 
     57        LogLinDisplayPref()             // resets the display depending on the preference state 
    5658         
    5759        // either clear the status, or fake a click 
     
    6971         
    7072end 
     73 
     74Function LogLinDisplayPref() 
     75 
     76        // get the state of the log/lin button, and make sure preferences are obeyed 
     77        // log/lin current state is in the S_UserData string (0=linear, 1=log) 
     78        ControlInfo/W=VSANS_Data button_log 
     79        Variable curState 
     80        curState = str2num(S_UserData) 
     81 
     82        NVAR gLogScalingAsDefault = root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault 
     83        if(curState != gLogScalingAsDefault) 
     84                STRUCT WMButtonAction ba 
     85                ba.eventCode = 2                //fake mouse click 
     86                LogLinButtonProc(ba) 
     87        endif 
     88         
     89        return(0) 
     90end 
     91 
    7192 
    7293// 
     
    92113End 
    93114 
     115 
    94116// TODO 
    95117// 
    96 // -- fill in the proper window title in the DoWindow/T command 
     118// -- now that the sliders work, label them and move them to a better location 
     119// -- logical location for all of the buttons 
     120// -- add raw data load button, load/draw mask button 
     121// x- fill in the proper window title in the DoWindow/T command 
    97122// -- add help text for all of the controls 
     123// -- tab order? can I set this? 
    98124// 
    99125Window VSANS_DataPanel() : Panel 
     
    126152 
    127153        TabControl tab0,pos={13,41},size={572,617},proc=VDataTabProc,tabLabel(0)="Front" 
    128         TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2 
     154        TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2,focusRing=0 
    129155 
    130156// on the side   
     
    136162        Button button_tab_p,pos={648,81},size={50,20},proc=Tab_p_ButtonProc,title="Tab >" 
    137163        Button button_isolate,pos={606,114},size={70,20},proc=IsolateButtonProc,title="Isolate" 
     164        Button button_toWork,pos={770,113},size={70,20},proc=ToWorkFileButtonProc,title="to WORK" 
    138165 
    139166        TitleBox title_file,pos={606,178},size={76,20},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
     
    142169         
    143170        Button button_tagFile,pos={603,412},size={70,20},proc=TagFileButtonProc,title="Tag File" 
     171        Button button_tagFile,disable=2 
    144172        Button button_saveIQ,pos={720,412},size={70,20},proc=SaveIQ_ButtonProc,title="Save I(Q)" 
    145173        Button button_BeamCtr,pos={603,450},size={70,20},proc=BeamCtrButtonProc,title="Beam Ctr" 
     
    212240 
    213241// 
    214 // event code 4 = mouse moved 
     242// event code 4: mouse moved 
     243// event code 11: keyboard events 
    215244//  
    216245// mouse moved is the only event that I really care about for the data display. 
    217246// 
    218 // TODO 
     247// TODO: 
    219248// -- figure out how to respond only to events in the main window 
    220249// -- figure out which is the correct image to respond "from" 
     250// -- More complete documentation of how the hook is identifying what graph is "under" the mouse 
     251//    AND what assumptions are behind this identification 
     252// 
    221253// 
    222254Function VSANSDataHook(s) 
     
    240272// TODO (Way in the future -- I could make the small graphs into "buttons" by responding to a "mouse up" (not down) 
    241273//    that hits in one of the small graph areas, and treat that as a click on that tab 
     274// -- instead of this, I can try to get the focus rectangle to work more easily to move with the TAB, 
     275//    if I can intercept the keystroke (event 11), see below. 
    242276// 
    243277                        break 
     
    378412                        break 
    379413                         
     414                        case 11: // keyboard event 
     415                                // TODO -- figure out why I'm not getting the TAB keystroke 
     416                                //  -- I want to be able to use the tab to change the focus only between File <.> and Tab > buttons, not everything 
     417                                // see the help file section "Keyboard Events" for an example and "WMWinHookStruct" 
     418                                 
     419                                //Print "key code = ",s.specialKeyCode 
     420                                //hookresult = 1                //if non-zero, we handled it and Igor will ignore it 
     421                                break 
    380422                // And so on . . . 
    381423        endswitch 
     
    384426End 
    385427 
     428 
     429// ******** 
     430// 
     431// this procedure does most of the work for drawing the panels, setting the proper log/lin 
     432// scaling, the color scale, and the location based on the active tab 
    386433// 
    387434//lots to to here: 
     
    397444//  x- remove the dependency on VCALC being initialized first, and using dummy waves from there... 
    398445// 
    399 // -- can I use "ReplaceWave" to do this? 
     446// 
    400447Function VDataTabProc(tca) : TabControl 
    401448        STRUCT WMTabControlAction &tca 
     
    413460                         
    414461                        SVAR dataType = root:Packages:NIST:VSANS:Globals:gCurDispType 
    415 // make sure log scaling is correct                      
     462                         
     463// make sure log scaling is correct 
    416464                        NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale 
    417465                        if(State == 0) 
     
    428476                        // -- only works for "B", since for M and F panels, all 4 data sets are named "data" 
    429477                        // in their respective folders... 
    430  
     478                         
     479                         
     480                        // get the slider values for the color mapping 
     481                        Variable lo,hi,lo_B,hi_B 
     482                        Variable lo_MT,lo_MB,lo_MR,lo_ML 
     483                        Variable lo_FT,lo_FB,lo_FR,lo_FL 
     484                        Variable hi_MT,hi_MB,hi_MR,hi_ML 
     485                        Variable hi_FT,hi_FB,hi_FR,hi_FL 
     486                        ControlInfo slider_lo 
     487                        lo = V_Value 
     488                        ControlInfo slider_hi 
     489                        hi = V_Value 
     490                         
     491                         
    431492                        String tmpStr 
    432493                        Variable ii 
     
    448509                                if(V_flag == 0)         // 0 == data is not displayed, so append it 
    449510                                        AppendImage/W=VSANS_Data#det_panelsB det_B 
    450                                         ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {*,*,ColdWarm,0} 
     511                                        lo_B = lo*(WaveMax(det_B) - WaveMin(det_B)) + WaveMin(det_B) 
     512                                        hi_B = hi*(WaveMax(det_B) - WaveMin(det_B)) + WaveMin(det_B) 
     513                                        ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {lo_B,hi_B,ColdWarm,0}          // don't autoscale {*,*,ColdWarm,0} 
    451514                                endif 
    452515                                MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50,185,517,620) 
     
    489552                                        AppendImage/W=VSANS_Data#det_panelsM det_ML 
    490553                                        AppendImage/W=VSANS_Data#det_panelsM det_MR 
    491                                         ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {*,*,ColdWarm,0}                // ''#n means act on the nth image (there are 4) 
    492                                         ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {*,*,ColdWarm,0} 
    493                                         ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {*,*,ColdWarm,0} 
    494                                         ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {*,*,ColdWarm,0} 
     554                                        lo_MT = lo*(WaveMax(det_MT) - WaveMin(det_MT)) + WaveMin(det_MT) 
     555                                        hi_MT = hi*(WaveMax(det_MT) - WaveMin(det_MT)) + WaveMin(det_MT) 
     556                                        lo_MB = lo*(WaveMax(det_MB) - WaveMin(det_MB)) + WaveMin(det_MB) 
     557                                        hi_MB = hi*(WaveMax(det_MB) - WaveMin(det_MB)) + WaveMin(det_MB) 
     558                                        lo_ML = lo*(WaveMax(det_ML) - WaveMin(det_ML)) + WaveMin(det_ML) 
     559                                        hi_ML = hi*(WaveMax(det_ML) - WaveMin(det_ML)) + WaveMin(det_ML) 
     560                                        lo_MR = lo*(WaveMax(det_MR) - WaveMin(det_MR)) + WaveMin(det_MR) 
     561                                        hi_MR = hi*(WaveMax(det_MR) - WaveMin(det_MR)) + WaveMin(det_MR) 
     562                                         
     563                                        ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {lo_MT,hi_MT,ColdWarm,0}                // ''#n means act on the nth image (there are 4) 
     564                                        ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {lo_MB,hi_MB,ColdWarm,0} 
     565                                        ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {lo_ML,hi_ML,ColdWarm,0} 
     566                                        ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {lo_MR,hi_MR,ColdWarm,0} 
    495567                                endif 
    496568                                MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50,185,517,620) 
     
    536608                                        AppendImage/W=VSANS_Data#det_panelsF det_FL 
    537609                                        AppendImage/W=VSANS_Data#det_panelsF det_FR 
    538                                         ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {*,*,ColdWarm,0} 
    539                                         ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {*,*,ColdWarm,0} 
    540                                         ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {*,*,ColdWarm,0} 
    541                                         ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {*,*,ColdWarm,0} 
     610                                        lo_FT = lo*(WaveMax(det_FT) - WaveMin(det_FT)) + WaveMin(det_FT) 
     611                                        hi_FT = hi*(WaveMax(det_FT) - WaveMin(det_FT)) + WaveMin(det_FT) 
     612                                        lo_FB = lo*(WaveMax(det_FB) - WaveMin(det_FB)) + WaveMin(det_FB) 
     613                                        hi_FB = hi*(WaveMax(det_FB) - WaveMin(det_FB)) + WaveMin(det_FB) 
     614                                        lo_FL = lo*(WaveMax(det_FL) - WaveMin(det_FL)) + WaveMin(det_FL) 
     615                                        hi_FL = hi*(WaveMax(det_FL) - WaveMin(det_FL)) + WaveMin(det_FL) 
     616                                        lo_FR = lo*(WaveMax(det_FR) - WaveMin(det_FR)) + WaveMin(det_FR) 
     617                                        hi_FR = hi*(WaveMax(det_FR) - WaveMin(det_FR)) + WaveMin(det_FR) 
     618                                         
     619                                        ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {lo_FT,hi_FT,ColdWarm,0} 
     620                                        ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {lo_FB,hi_FB,ColdWarm,0} 
     621                                        ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {lo_FL,hi_FL,ColdWarm,0} 
     622                                        ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {lo_FR,hi_FR,ColdWarm,0} 
    542623                                endif 
    543624                                MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50,185,517,620) 
     
    695776        return 0 
    696777End 
     778 
     779// 
     780// if the data display is RAW, convert to the specified WORK data type 
     781// 
     782// TODO 
     783// -- better error checking 
     784// -- if the data type is not RAW, can I Copy Folder instead? 
     785// 
     786Function ToWorkFileButtonProc(ba) : ButtonControl 
     787        STRUCT WMButtonAction &ba 
     788 
     789        switch( ba.eventCode ) 
     790                case 2: // mouse up 
     791                        // click code here 
     792                        //Convert_to_Workfile(newtype, doadd) // a proc 
     793                        Execute "Convert_to_Workfile()" 
     794 
     795                        break 
     796                case -1: // control being killed 
     797                        break 
     798        endswitch 
     799 
     800        return 0 
     801End 
     802 
    697803 
    698804// TODO 
     
    772878 
    773879// TODO: 
     880// x- link this to the preferences for the display. this is done in UpdateDisplayInformation (the main call) so that 
     881//     the panels are rescaled only once, rather than toggled three times (F, M, B) if I call from the tabProc 
    774882// -- come up with a better definition of the log lookup wave (> 1000 pts, what is the first point) 
    775883// -- make an equivalent linear wave 
     
    9621070                        if( sa.eventCode & 1 ) // value set 
    9631071                                Variable curval = sa.curval 
     1072                                ControlInfo tab0 
     1073                                FakeTabClick(V_Value) 
     1074                                 
     1075//                              ControlInfo slider_lo 
     1076//                              V_MakeImageLookupTables(10000,V_Value,curval) 
    9641077                        endif 
    9651078                        break 
     
    9841097                        if( sa.eventCode & 1 ) // value set 
    9851098                                Variable curval = sa.curval 
    986                         endif 
    987                         break 
    988         endswitch 
    989  
    990         return 0 
    991 End 
    992  
    993  
     1099                                ControlInfo tab0 
     1100                                FakeTabClick(V_Value) 
     1101 
     1102//                              ControlInfo slider_hi 
     1103//                              V_MakeImageLookupTables(10000,curval,V_Value) 
     1104                        endif 
     1105                        break 
     1106        endswitch 
     1107 
     1108        return 0 
     1109End 
     1110 
     1111 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf

    r1022 r1023  
    177177        Variable useIgorDraw            // True to use Igor's own draw method rather than native 
    178178         
    179         Variable num 
     179        Variable num,numToClean 
    180180         
    181181        // is there anything there to be killed? 
    182182        num = V_CleanOutOneRawVSANS() 
     183        numToClean = num 
    183184        if(num <= 0) 
    184185                return(0) 
     
    215216 
    216217        KillWindow ProgressPanel 
    217         return(0) 
     218        return(numToClean) 
    218219End 
    219220 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_VSANS_Preferences.ipf

    r1022 r1023  
    272272        CheckBox PrefCtrl_1m title="Do Tube Shadow Correction?",size={140,14},proc=V_DoTubeShadowCorPref 
    273273        CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoTubeShadowCor,pos={255,200},help={"TURN OFF ONLY FOR DEBUGGING."} 
    274         CheckBox PrefCtrl_1n title="Do Tube Shadow Correction?",size={140,14},proc=V_DoMonitorNormPref 
    275         CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."} 
     274//      CheckBox PrefCtrl_1n title="Do Tube Shadow Correction?",size={140,14},proc=V_DoMonitorNormPref 
     275//      CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."} 
    276276                 
    277277         
Note: See TracChangeset for help on using the changeset viewer.