Changeset 950


Ignore:
Timestamp:
Nov 25, 2014 3:10:21 PM (8 years ago)
Author:
srkline
Message:

adding new procedures for testing -- that will enable:

(1) automation of SANS data reduction, at least in some of the more standard cases. The more consistently the data files are named, the better this works.
(2) Much simpler scripting of experiment simulation. now a simulated experiment can be set up is the same way that a real experiemtn can -- by setting up a list of "runs"

Help files are to follow for all of these. Prelimiary help for the automation has been added to the SANS Reduction Help file. Videos to follow. Loaders for these two items have been added to the Macros menu so that all of the dependencies are satisfied.

More testing is still necessary to make sure that nothing has been broken, and that sufficient error catching has been done so that meaningful testing can be done.

Location:
sans/Dev/trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf

    r912 r950  
    4949        "Event Mode Processing",EventModeLoader() 
    5050        "Load Batch Fitting - Beta",BatchFitLoader() 
     51        "Load Simulation Run Builder",SimSANSRunListLoader() 
     52        "Automated SANS Reduction - Beta",AutomateSANSLoader() 
    5153 
    5254//      "-" 
     
    710712        return(0) 
    711713End 
     714 
     715// loads the Reduction package, then the Auto_Reduction panel 
     716Function AutomateSANSLoader() 
     717 
     718        // be sure that the SANS reduction is loaded and compiles 
     719        NCNR_SANSReductionLoader("Load NCNR SANS Reduction Macros") 
     720         
     721        // then bring up the Auto_reduction panel 
     722        Execute/P "Auto_Reduce_Panel()" 
     723         
     724        return(0) 
     725End 
     726 
     727 
     728 
     729// for SANS simulation scripting, need to load the reduction, analysis,  
     730// then the two scripting procedures 
     731// 
     732// -- this is to avoid the entanglement betwen analysis models and SASCALC (in reduction) 
     733// 
     734Function SimSANSRunListLoader() 
     735 
     736        // be sure that the SANS reduction is loaded and compiles 
     737        NCNR_SANSReductionLoader("Load NCNR SANS Reduction Macros") 
     738         
     739        // be sure that the SANS Analysis is loaded and compiles 
     740        NCNR_AnalysisLoader("Load NCNR Analysis Macros") 
     741         
     742        // then the Scripting files 
     743        Execute/P "INSERTINCLUDE \"MC_SimulationScripting\"" 
     744        Execute/P "INSERTINCLUDE \"MC_Script_Panels\"" 
     745        Execute/P "COMPILEPROCEDURES " 
     746//      Execute/P "InitializeAutoFitPanel()" 
     747         
     748        BuildMenu "Macros" 
     749        return(0) 
     750End 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r948 r950  
    13221322//      list = RemoveFromList("EC_Empirical;SmearedEC_Empirical;",list,";") 
    13231323        list = RemoveFromList("SAS_XS_Sphere;Generate_UofR;Setup_Ur_HS;",list,";") 
    1324                  
     1324 
     1325 
     1326// from 2014 Automation of reduction 
     1327        list = RemoveFromList("DoAnnulusGraph;DoArcGraph;",list,";") 
     1328         
     1329                         
    13251330        list = SortList(list) 
    13261331        return(list) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MC_SimulationScripting.ipf

    r942 r950  
    9696// x- fill in the "RunSample" functions 
    9797// 
    98 //  -- I need a little panel to control all of this, and get the information, just  
     98//  x- I need a little panel to control all of this, and get the information, just  
    9999//     like setting up a real experiment. Or maybe not. Maybe better to keep some of this 
    100100//     hidden. 
     
    102102//     For some experiments it's quite useful to see the level of this contribution, rather than 
    103103//     the completely clean simulation. 
    104 //  -- in this file, clearly separate the examples from the utility functions 
     104//  x- in this file, clearly separate the examples from the utility functions 
    105105//  -- get a function list of everything, and document what each does (if not obvious) 
    106106//  -- step by step comments of one of the examples (1D and 2D) are probably the most useful 
    107 //  -- "dry run" function to estimate the total simulation time for 2D. (? set all monitor counts to 1000 
     107//  x- "dry run" function to estimate the total simulation time for 2D. (? set all monitor counts to 1000 
    108108//      or whatever I use to get other estimates, and then run through everything to get estimated times) 
    109109// 
     
    113113// 
    114114// 
    115 // ----- transmission really doesn't work in the simulation... 
    116 // -- add function to simulate transmission in 2D by saving a "Trans" configuration 
     115// ----- transmission really in the simulation... 
     116//  x- add function to simulate transmission in 2D by saving a "Trans" configuration 
    117117//     and automatically using that. Currently the trans is already written to the file 
    118 // x- would also need a function to simulate an empty beam measurement to rescale the  
     118//  x- would also need a function to simulate an empty beam measurement to rescale the  
    119119//     transmissions. (use the model given, set scale (w[0] to something really small) 
    120 //  -- or better, use the empty cell function that is guaranteed to have coefficients that are 
     120//  x- or better, use the empty cell function that is guaranteed to have coefficients that are 
    121121//     well behaved - and I can set/reset them to get a proper "empty beam" 
    122122// 
     
    128128 
    129129/// un-comment this by removing the "x" from the word xMenu. Then compile. 
     130// - note that no menu items will appear unless BOTH the Reduction and Analysis are loaded 
    130131Menu "Macros" 
    131132                Submenu "Simulation Scripting - Beta" 
    132                         ScriptItem(0),Sim_saveConfProc() 
    133                         ScriptItem(1),Sim_moveConfProc() 
    134                         ScriptItem(2),ListSASCALCConfigs() 
     133                        ScriptItem(0),ShowRunListPanel() 
     134//                      ScriptItem(0),Sim_StoreConfProc() 
     135//                      ScriptItem(1),Sim_moveConfProc() 
     136                        ScriptItem(1) 
     137//                      ScriptItem(2),ListSASCALCConfigs() 
    135138                        ScriptItem(3),DryRunProc_1D() 
    136                         ScriptItem(4),DryRunProc_2D() 
     139//                      ScriptItem(4),DryRunProc_2D() 
    137140                        ScriptItem(5),OptimalCountProc() 
    138141                        ScriptItem(6),MakeCombineTable_byName() 
     
    141144                        ScriptItem(9) 
    142145                        ScriptItem(10),Setup_Sim_Example() 
    143                         ScriptItem(11),Example_1DSim() 
    144                         ScriptItem(12),Example_2DSim() 
     146//                      ScriptItem(11),Example_1DSim() 
     147//                      ScriptItem(12),Example_2DSim() 
    145148                        ScriptItem(13) 
    146149                        ScriptItem(14),DisplayProcedure "Example_1DSim" 
     
    156159                switch(num)      
    157160                        case 0:  
    158                                 str = "Save Configuration" 
     161                                str = "Run List Panel" 
     162                                //str = "Save Configuration" 
    159163                                break 
    160164                        case 1: 
    161                                 str = "Move to Configuration" 
     165                                //str = "Move to Configuration" 
     166                                str = "-" 
    162167                                break 
    163168                        case 2: 
     
    236241Function Example_1DSim() 
    237242 
    238         String confList,ctTimeList,saveNameList,funcStr,titleStr 
     243        String confList,ctTimeList,saveNameList,funcStr,titleStrList 
    239244         
    240245 
     
    264269        ctTimeList = "100;300;900;" 
    265270        saveNameList = "sim_1m.abs;sim_4m.abs;sim_13m.abs;" 
    266         titleStr = "MySample 1" 
     271        titleStrList = "MySample 1 at 1m;MySample 1 at 4m;MySample 1 at 13m;" 
    267272 
    268273        // then this runs the samples as listed 
    269         Sim_RunSample_1D(confList,ctTimeList,titleStr,saveNameList) 
     274        Sim_RunSample_1D(confList,ctTimeList,titleStrList,saveNameList) 
    270275 
    271276        // no transmissions or empty beam measurements to make for 1D simulation 
     
    277282Function Example_2DSim() 
    278283 
    279         String confList,ctTimeList,titleStr,transConfList,transCtTimeList 
     284        String confList,ctTimeList,titleStrList,transConfList,transCtTimeList 
    280285        Variable runIndex,val,totalTime 
    281286        String funcStr 
     
    319324        transConfList = "Config_13m;"           // trans only @ 13m 
    320325        transCtTimeList = "1;"                          // trans count time = 1s 
    321         titleStr = "MySample 1" 
     326        titleStrList = "MySample 1 at 1m;MySample 1 at 4m;MySample 1 at 13m;" 
    322327 
    323328        // runIndex is PBR and updates as the number of files are written 
    324329         
    325330        // this runs the sample 
    326         totalTime += Sim_RunSample_2D(confList,ctTimeList,titleStr,runIndex) 
     331        totalTime += Sim_RunSample_2D(confList,ctTimeList,titleStrList,runIndex) 
    327332        // this runs the transmissions 
    328         totalTime += Sim_RunTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 
     333        totalTime += Sim_RunTrans_2D(transConfList,transCtTimeList,titleStrList,runIndex) 
    329334         
    330335        // run the empty beam at all configurations 
     
    332337        transConfList = "Config_1m;Config_4m;Config_13m;" 
    333338        transCtTimeList = "1;1;1;"       
    334         titleStr = "Empty Beam" 
    335         totalTime += Sim_RunEmptyBeamTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 
     339        titleStrList = "Empty Beam at 1m;Empty Beam at 4m;Empty Beam at 13m;" 
     340        totalTime += Sim_RunEmptyBeamTrans_2D(transConfList,transCtTimeList,titleStrList,runIndex) 
    336341         
    337342        Print "runIndex = ",runIndex 
     
    348353Function Example_Loop_1DSim() 
    349354 
    350         String confList,ctTimeList,saveNameList,funcStr,titleStr 
     355        String confList,ctTimeList,saveNameList,funcStr,titleStrList 
    351356         
    352357 
     
    376381        ctTimeList = ""         //filled in the loop 
    377382        saveNameList = "" 
    378         titleStr = "DAB versus count time t = " 
     383        titleStrList = "DAB versus count time t = "             //overwritten in loop 
    379384 
    380385        Make/O/D ctTime = {5,11,16,21,27,32,37,43,48,53,107,160,214,267,321,374,428,481,535,1604,5348,21390,53476} 
     
    384389        for(jj=0;jj<numpnts(ctTime);jj+=1)       
    385390                for(ii=0;ii<nTrials;ii+=1) 
    386                         titleStr = "DAB versus count time t = "+num2str(ctTime[jj]) 
     391                        titleStrList = "DAB versus count time t = "+num2str(ctTime[jj]) 
    387392                        saveNameList = "DAB_4m_t"+num2str(ctTime[jj])+"_"+num2str(ii)+".abs;" 
    388393                        ctTimeList = num2str(ctTime[jj])+";" 
    389394                        // then this runs the samples as listed 
    390                         Sim_RunSample_1D(confList,ctTimeList,titleStr,saveNameList) 
     395                        Sim_RunSample_1D(confList,ctTimeList,titleStrList,saveNameList) 
    391396                endfor 
    392397        endfor 
     
    411416Function Example_Loop_2DSim() 
    412417 
    413         String confList,ctTimeList,titleStr,transConfList,transCtTimeList 
     418        String confList,ctTimeList,titleStrList,transConfList,transCtTimeList 
    414419        Variable runIndex,val,totalTime 
    415420        String funcStr 
     
    454459        transConfList = "Config_1m;Config_4m;Config_13m;" 
    455460        transCtTimeList = "1;1;1;"       
    456         titleStr = "Empty Beam" 
    457         totalTime += Sim_RunEmptyBeamTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 
     461        titleStrList = "Empty Beam at 1m;Empty Beam at 4m;Empty Beam at 13m;" 
     462        totalTime += Sim_RunEmptyBeamTrans_2D(transConfList,transCtTimeList,titleStrList,runIndex) 
    458463         
    459464         
     
    464469        transConfList = "Config_13m"            // trans only @ 13m 
    465470        transCtTimeList = "1;"                          // trans count time = 1s 
    466         titleStr = "MySample 1" 
     471        titleStrList = "MySample 1" 
    467472 
    468473        // runIndex is PBR and updates as the number of files are written 
     
    483488 
    484489                confList = conf[ii] +";" 
    485                 titleStr = "DAB simulation, thick = "+num2str(thick[ii]) 
     490                titleStrList = "DAB simulation, thick = "+num2str(thick[ii]) 
    486491                ctTimeList = num2str(ctTime[ii])+";" 
    487492                 
    488493                // this runs the transmissions (only at 13m) 
    489494                if(cmpstr(conf[ii],"Config_13m")==0) 
    490                         totalTime += Sim_RunTrans_2D(transConfList,transCtTimeList,titleStr,runIndex) 
     495                        totalTime += Sim_RunTrans_2D(transConfList,transCtTimeList,titleStrList,runIndex) 
    491496                endif 
    492497                 
    493498                // this runs the sample 
    494                 totalTime += Sim_RunSample_2D(confList,ctTimeList,titleStr,runIndex) 
     499                totalTime += Sim_RunSample_2D(confList,ctTimeList,titleStrList,runIndex) 
    495500 
    496501        endfor 
     
    516521 
    517522// pass in a semicolon delimited list of configurations + corresponding count times + saved names 
    518 Function Sim_RunSample_1D(confList,ctTimeList,titleStr,saveNameList) 
    519         String confList,ctTimeList,titleStr,saveNameList 
     523Function Sim_RunSample_1D(confList,ctTimeList,titleStrList,saveNameList) 
     524        String confList,ctTimeList,titleStrList,saveNameList 
    520525         
    521526        Variable ii,num,ct,cr,numPt 
    522         String twStr,fname,type 
     527        String twStr,fname,type,titleStr 
    523528        NVAR g_estimateOnly = root:Packages:NIST:SAS:g_estimateOnly             // == 1 for just count rate, == 0 (default) to do the simulation and save 
    524529        WAVE/Z crWave = root:CR_1D 
     
    533538                ct = str2num(StringFromList(ii, ctTimeList,";")) 
    534539                fname = StringFromList(ii, saveNameList,";") 
     540                titleStr = StringFromList(ii, titleStrList,";") 
    535541                 
    536542                Sim_MoveToConfiguration(tw) 
     
    584590// of the model to something tiny so that there is no coherent scattering 
    585591// 
    586 Function Sim_RunTrans_2D(confList,ctTimeList,titleStr,runIndex) 
    587         String confList,ctTimeList,titleStr 
     592Function Sim_RunTrans_2D(confList,ctTimeList,titleStrList,runIndex) 
     593        String confList,ctTimeList,titleStrList 
    588594        Variable &runIndex 
    589595         
    590596        Variable ii,num,ct,index,totalTime 
    591         String twStr,type 
     597        String twStr,type,titleStr 
    592598 
    593599        NVAR g_estimateOnly = root:Packages:NIST:SAS:g_estimateOnly             // == 1 for just a time estimate, == 0 (default) to do the simulation 
     
    600606        for(ii=0;ii<num;ii+=1) 
    601607                twStr = StringFromList(ii, confList,";") 
     608                titleStr = StringFromList(ii, titleStrList,";") 
    602609                Wave/T tw=$("root:Packages:NIST:SAS:"+twStr) 
    603610                ct = str2num(StringFromList(ii, ctTimeList,";")) 
     
    628635//      Print "Sample Simulation (2D) CR = ",results[9]/ctTime 
    629636// -- for estimates, iMon is set to 1000, so time=1000/(root:Packages:NIST:SAS:gImon) 
    630 Function Sim_RunSample_2D(confList,ctTimeList,titleStr,runIndex) 
    631         String confList,ctTimeList,titleStr 
     637Function Sim_RunSample_2D(confList,ctTimeList,titleStrList,runIndex) 
     638        String confList,ctTimeList,titleStrList 
    632639        Variable &runIndex 
    633640 
    634641        Variable ii,num,ct,index,totalTime 
    635         String twStr,type 
     642        String twStr,type,titleStr 
    636643 
    637644        NVAR g_estimateOnly = root:Packages:NIST:SAS:g_estimateOnly             // == 1 for just a time estimate, == 0 (default) to do the simulation 
     
    645652        for(ii=0;ii<num;ii+=1) 
    646653                twStr = StringFromList(ii, confList,";") 
     654                titleStr = StringFromList(ii, titleStrList,";") 
    647655                Wave/T tw=$("root:Packages:NIST:SAS:"+twStr) 
    648656                ct = str2num(StringFromList(ii, ctTimeList,";")) 
     
    11321140End 
    11331141 
    1134 Proc Sim_saveConfProc(waveStr) 
     1142Proc Sim_StoreConfProc(waveStr) 
    11351143        String waveStr 
    11361144         
    1137         Sim_SaveConfiguration(waveStr) 
     1145        Sim_StoreConfiguration(waveStr) 
    11381146End 
    11391147// 
     
    11551163// 9 = offset 
    11561164// 
    1157 Function Sim_SaveConfiguration(waveStr) 
     1165Function Sim_StoreConfiguration(waveStr) 
    11581166        String waveStr 
    11591167         
     
    11621170        SetDataFolder root:Packages:NIST:SAS 
    11631171         
    1164         Make/O/T/N=20 $("Config_"+waveStr) 
    1165         Wave/T tw=$("Config_"+waveStr) 
     1172        waveStr = CleanupName("Config_"+waveStr,0) 
     1173 
     1174        Make/O/T/N=20 $(waveStr) 
     1175        Wave/T tw=$(waveStr) 
    11661176        tw = "" 
    11671177         
     
    12711281 
    12721282 
    1273 ///////////// a panel to (maybe) write to speed the setup of the runs 
    1274 // 
    1275 Function/S ListSASCALCConfigs() 
    1276         String str 
    1277         SetDataFolder root:Packages:NIST:SAS 
    1278         str = WaveList("Conf*",";","") 
    1279         SetDataFolder root: 
    1280         print str 
    1281         return(str) 
    1282 End 
    1283  
    1284 //Proc Sim_SetupRunPanel() : Panel 
    1285 //      PauseUpdate; Silent 1           // building window... 
    1286 //      NewPanel /W=(399,44,764,386) 
    1287 //      ModifyPanel cbRGB=(56639,28443,117) 
    1288 //      ShowTools/A 
    1289 //EndMacro 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Includes_v520.ipf

    r916 r950  
    8888 
    8989// SRK JAN 2013 - to make simulation easier 
    90 #include "MC_SimulationScripting" 
     90// SRK NOV 2014 -- moved to a separate loader to avoid reduction/analysis tangles 
     91//#include "MC_SimulationScripting" 
     92 
     93// SRK NOV 2014 -- beta of automated reduction routines 
     94#include "Automated_SANS_Reduction" 
     95 
     96// SRK NOV 2014 -- beta of a "run panel" for scripting of simulation 
     97// SRK NOV 2014 -- moved to a separate loader to avoid reduction/analysis tangles 
     98//#include "MC_Script_Panels" 
    9199 
    92100// a simple list of items to add to the Beta menu 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf

    r949 r950  
    18441844        endif 
    18451845         
     1846        Variable num=numpnts(matchRows) 
     1847        String result="",tmpStr 
     1848         
    18461849        Wave/T sw = root:myGlobals:TransHeaderInfo:S_Labels             //Sample file labels 
    18471850        Wave/T tw = root:myGlobals:TransHeaderInfo:T_Labels             //trans file labels 
     
    18491852        Wave/T snam = root:myGlobals:TransHeaderInfo:S_TRANS_FileNames  //Scattering - trans correspondence 
    18501853        Wave/T samfile = root:myGlobals:TransHeaderInfo:S_FileNames     //Scattering file name 
    1851          
     1854 
     1855        //// set up as a list box 
     1856        Make/O/T/N=(num,4) root:myGlobals:TransHeaderInfo:T_ListWave="" 
     1857        Make/O/D/N=(num,4,2) root:myGlobals:TransHeaderInfo:T_selWave 
     1858        Make/O/T/N=4 root:myGlobals:TransHeaderInfo:T_titles                                    // 4 rows to match 4-column ListWave 
     1859        Make/O/W/U/N=(2,3) root:myGlobals:TransHeaderInfo:T_Colors 
     1860        WAVE/T ListWave = root:myGlobals:TransHeaderInfo:T_ListWave 
     1861        WAVE selWave = root:myGlobals:TransHeaderInfo:T_selWave 
     1862        WAVE/T titles = root:myGlobals:TransHeaderInfo:T_titles 
     1863        WAVE colors = root:myGlobals:TransHeaderInfo:T_Colors 
     1864 
     1865 
     1866        colors[][] = 0 
     1867        colors[0][] = 65000 
     1868        colors[1][] = 60000 
     1869 
     1870 
    18521871        // can do fancy formatted string with ... 
    18531872        //"asdf* matches file: \\f01filen\\f00 \\K(52428,1,1)\\f01afdsfdd\\f00\\K(0,0,0)asdfasdfs" 
    1854         Variable num=numpnts(matchRows) 
    1855         String result="",tmpStr 
     1873 
    18561874        for(ii=0;ii<num;ii+=1) 
    18571875                sprintf tmpStr,"\\f01\\K(52428,1,1)%s\\K(0,0,0)\\f00* Matches file: \\f01%s\\f00 | \\K(52428,1,1)\\f01%s\\f00\\K(0,0,0)%s\r",(tw[row])[0,numChars-1],samfile[matchRows[ii]],(sw[matchRows[ii]])[0,numchars-1],(sw[matchRows[ii]])[numchars,59] 
    18581876                result += tmpStr 
     1877                listWave[ii][1] = (tw[row])[0,numChars-1] + "*" + (tw[row])[numChars,59] 
     1878                listWave[ii][2] = samfile[matchRows[ii]] 
     1879                listWave[ii][3] = (sw[matchRows[ii]])[0,numchars-1] + (sw[matchRows[ii]])[numchars,59]  // ?? 
    18591880        endfor 
     1881         
    18601882         
    18611883        if(cmpstr(result,"")==0) 
     
    18671889         
    18681890        String/G root:myGlobals:TransHeaderInfo:gResultStr = result 
     1891        selWave[][][] = 0 
     1892        selWave[][0][] = 2^5     + 2^4          //if 2^4 also, it's selected  --- if((val & 2^4) != 0), then the bit is set 
     1893         
     1894        selWave[][][1]= round(p/2-trunc(p/2))                                   // change the color index values 
     1895        SetDimLabel 2,1,backColors,selWave 
     1896 
     1897        titles[0] = "Keep Match?" 
     1898        titles[1] = "Match String" 
     1899        titles[2] = "Matching Sample File" 
     1900        titles[3] = "Matching Sample Label" 
     1901         
     1902 
    18691903         
    18701904        DoWindow/F ConfirmGuess         //if being called recursively, the panel is already up 
     
    18721906                TitleBox title0,pos={9,5},variable=root:myGlobals:TransHeaderInfo:gResultStr 
    18731907        else 
    1874                 NewPanel /W=(600,44,1150,225) as "Confirm Guess" 
     1908                NewPanel /W=(600,44,1200,270) as "Confirm Guess" 
    18751909                DoWindow/C ConfirmGuess 
    1876                 TitleBox title0,pos={15,8},size={560,32} 
    1877                 TitleBox title0,variable= root:myGlobals:TransHeaderInfo:gResultStr 
    1878                 Button button0,pos={240,150},size={190,20},proc=DoAssignTransButtonProc,title="Assign Transmission Files" 
    1879                 Button button1,pos={10,150},size={100,20},proc=DoTryAgainMoreButtonProc,title="Try Again (+)" 
    1880                 Button button2,pos={120,150},size={100,20},proc=DoTryAgainFewerButtonProc,title="Try Again (-)" 
    1881                 Button button3,pos={450,150},size={70,20},proc=SkipTransButtonProc,title="Skip" 
     1910 
     1911                ListBox list0,pos={1,2},size={580,180},listWave=ListWave,selWave=selWave,colorWave=colors 
     1912                ListBox list0,titleWave=titles,widths={70,180,150,180} 
     1913                         
     1914//              TitleBox title0,pos={15,8},size={560,32} 
     1915//              TitleBox title0,variable= root:myGlobals:TransHeaderInfo:gResultStr 
     1916                 
     1917                Button button0,pos={240,190},size={190,20},proc=DoAssignTransButtonProc,title="Assign Transmission Files" 
     1918                Button button1,pos={10,190},size={100,20},proc=DoTryAgainMoreButtonProc,title="Try Again (+)" 
     1919                Button button2,pos={120,190},size={100,20},proc=DoTryAgainFewerButtonProc,title="Try Again (-)" 
     1920                Button button3,pos={450,190},size={70,20},proc=SkipTransButtonProc,title="Skip" 
    18821921        endif 
    18831922         
     
    18981937                        num=numpnts(matchRows)          //this may have changed 
    18991938                        for(ii=0;ii<num;ii+=1) 
    1900                                 snam[matchRows[ii]] = tnam[row] 
    1901                                 AssignSelTransFilesToData(matchRows[ii],matchRows[ii]) 
    1902                                 CalcSelTransFromHeader(matchRows[ii],matchRows[ii])             //does only that sample file 
    1903                                 gMatchSamStr += samfile(matchRows[ii]) + ";" 
     1939                                if((selWave[ii][0] & 2^4) != 0)                 //box is checked, make the assignment for this file 
     1940                                        snam[matchRows[ii]] = tnam[row] 
     1941                                        AssignSelTransFilesToData(matchRows[ii],matchRows[ii]) 
     1942                                        CalcSelTransFromHeader(matchRows[ii],matchRows[ii])             //does only that sample file 
     1943                                        gMatchSamStr += samfile(matchRows[ii]) + ";"                    // this is for later, when trying to guess whish sample files to combine 
     1944                                endif 
    19041945                        endfor                   
    19051946                        break                                            
     
    20322073                        Make/O/D/N=0 root:myGlobals:TransHeaderInfo:matchRows 
    20332074                        Wave matchRows=root:myGlobals:TransHeaderInfo:matchRows 
    2034          
     2075 
     2076                        WAVE/T ListWave = root:myGlobals:TransHeaderInfo:T_ListWave 
     2077                        WAVE selWave = root:myGlobals:TransHeaderInfo:T_selWave 
     2078                        WAVE/T titles = root:myGlobals:TransHeaderInfo:T_titles 
     2079                 
    20352080                   //transTableExists = WinType("TransFileTable") 
    20362081                //if (transTableExists != 0) 
     
    20402085                 
    20412086                        num=numpnts(matchRows) 
     2087                         
     2088                        //Redimension the list box waves 
     2089                        Redimension/N=(num,4) ListWave 
     2090                        Redimension/N=(num,4,2) selWave 
     2091                        ListWave = "" 
     2092                        selWave[][][] = 0 
     2093 
     2094                        selWave[][0][] = 2^5 + 2^4 
     2095 
     2096                        selWave[][][1]= round(p/2-trunc(p/2))                                   // change the color index values 
    20422097 
    20432098                        resultStr = "" 
     
    20452100                                sprintf tmpStr,"\\f01\\K(52428,1,1)%s\\K(0,0,0)\\f00* Matches file: \\f01%s\\f00 | \\K(52428,1,1)\\f01%s\\f00\\K(0,0,0)%s\r",(tw[row])[0,numChars-1],samfile[matchRows[ii]],(sw[matchRows[ii]])[0,numchars-1],(sw[matchRows[ii]])[numchars,59] 
    20462101                                resultStr += tmpStr 
     2102                                listWave[ii][1] = (tw[row])[0,numChars-1] + "*" + (tw[row])[numChars,59] 
     2103                                listWave[ii][2] = samfile[matchRows[ii]] 
     2104                                listWave[ii][3] = (sw[matchRows[ii]])[0,numchars-1] + (sw[matchRows[ii]])[numchars,59]  // ?? 
    20472105                        endfor 
    20482106         
     
    20852143                        Make/O/D/N=0 root:myGlobals:TransHeaderInfo:matchRows 
    20862144                        Wave matchRows=root:myGlobals:TransHeaderInfo:matchRows 
    2087          
     2145 
     2146                        WAVE/T ListWave = root:myGlobals:TransHeaderInfo:T_ListWave 
     2147                        WAVE selWave = root:myGlobals:TransHeaderInfo:T_selWave 
     2148                        WAVE/T titles = root:myGlobals:TransHeaderInfo:T_titles 
     2149                 
    20882150                   //transTableExists = WinType("TransFileTable") 
    20892151                //if (transTableExists != 0) 
     
    20942156                        num=numpnts(matchRows) 
    20952157 
     2158                        //Redimension the list box waves 
     2159                        Redimension/N=(num,4) ListWave 
     2160                        Redimension/N=(num,4,2) selWave 
     2161                        ListWave = "" 
     2162                        selWave[][][] = 0 
     2163 
     2164                        selWave[][0][] = 2^5 + 2^4 
     2165 
     2166                        selWave[][][1]= round(p/2-trunc(p/2))                                   // change the color index values 
     2167 
    20962168                        resultStr = "" 
    20972169                        for(ii=0;ii<num;ii+=1) 
    20982170                                sprintf tmpStr,"\\f01\\K(52428,1,1)%s\\K(0,0,0)\\f00* Matches file: \\f01%s\\f00 | \\K(52428,1,1)\\f01%s\\f00\\K(0,0,0)%s\r",(tw[row])[0,numChars-1],samfile[matchRows[ii]],(sw[matchRows[ii]])[0,numchars-1],(sw[matchRows[ii]])[numchars,59] 
    20992171                                resultStr += tmpStr 
     2172                                listWave[ii][1] = (tw[row])[0,numChars-1] + "*" + (tw[row])[numChars,59] 
     2173                                listWave[ii][2] = samfile[matchRows[ii]] 
     2174                                listWave[ii][3] = (sw[matchRows[ii]])[0,numchars-1] + (sw[matchRows[ii]])[numchars,59]  // ?? 
    21002175                        endfor 
    21012176         
Note: See TracChangeset for help on using the changeset viewer.