Changeset 647


Ignore:
Timestamp:
Mar 23, 2010 3:59:52 PM (12 years ago)
Author:
srkline
Message:

(1) fixed file numbering scheme in HFIR_Utils to generate 4-digit number
(2) moved transmission beta operations to new buttons on the transmission panel
(3) cleared transmissin beta operations from the beta menu

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
5 edited

Legend:

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

    r641 r647  
    166166        KillWaves/Z notRAWlist 
    167167// 
    168         Print "Total time (s) = ",(ticks - t1)/60.15 
    169         Print "Time per raw data file (s) = ",(ticks - t1)/60.15/(numItems-numpnts(notRawList)) 
     168//      Print "Total time (s) = ",(ticks - t1)/60.15 
     169//      Print "Time per raw data file (s) = ",(ticks - t1)/60.15/(numItems-numpnts(notRawList)) 
    170170        return(0) 
    171171End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_Utils.ipf

    r642 r647  
    270270        String fullName="",partialName="",item="" 
    271271        //get list of raw data files in folder that match "num" (add leading zeros) 
    272         if( (num>9999) || (num<=0) ) 
     272        if( (num>9999) || (num<0) ) 
    273273                //Print "error in  FindFileFromRunNumber(num), file number too large or too small" 
    274274                Return ("") 
     
    280280                numStr = num2str(num) 
    281281        endif 
    282         if(num > 99) 
     282        if(num > 99 && num < 1000) 
    283283                numStr = "0"+num2str(num) 
    284284        endif 
    285         if(num > 9) 
     285        if(num > 9 && num < 100) 
    286286                numStr = "00"+num2str(num) 
    287         else 
     287        endif 
     288        if(num < 10) 
    288289                numStr = "000"+num2Str(num) 
    289290        endif 
    290          
     291        if(num == 0) 
     292                numStr = "0000" 
     293        endif 
     294                 
    291295        //make sure that path exists 
    292296        PathInfo catPathName 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf

    r646 r647  
    9696        "Help for Beta Operations",DisplayHelpTopic/Z/K=1 "Beta SANS Tools" 
    9797        "-" 
    98         "FillEMPUsingSelection" 
     98//      "FillEMPUsingSelection"         // Transmission utilities have been added directly to the panel 
    9999//      "GuessEveryTransFile" 
    100100//      "GuessSelectedTransFiles" 
    101         "ClearSelectedTransAssignments" 
    102         "-" 
     101//      "ClearSelectedTransAssignments" 
     102//      "-" 
    103103////    "CreateRunNumList" 
    104104////    "TransList" 
     
    106106////    "RemoveRunFromList" 
    107107//      "FillMREDList" 
    108         "-" 
     108//      "-" 
    109109////    "Set3NSORTFiles" 
    110110        "CreateTableToCombine" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANS_Utilities.ipf

    r646 r647  
    232232 
    233233Proc FillEMPUsingSelection() 
    234         FillEMPFilenameWSelection() 
     234        FillEMPFilenameWSelection("") 
    235235End 
    236236 
     
    246246 
    247247Proc ClearSelectedTransAssignments() 
    248         ClearSelectedAssignments() 
     248        ClearSelectedAssignments("") 
    249249End 
    250250 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf

    r577 r647  
    10351035Proc Trans_Panel()  
    10361036        PauseUpdate; Silent 1           // building window... 
    1037         NewPanel /W=(173,197,540,424)/K=1 as "Calculate Transmissions" 
     1037        NewPanel /W=(173,197,548,444) /K=1 as "Calculate Transmissions" 
    10381038        DoWindow/C Trans_Panel 
    10391039        ModifyPanel cbRGB=(49807,47186,38011) 
     
    10411041        SetDrawLayer UserBack 
    10421042        DrawLine 0,56,368,56 
    1043         DrawLine 0,125,368,125 
    1044         Button pick_emp,pos={4,65},size={105,20},proc=PickEMPTransButton,title="set BCENT file" 
     1043        DrawLine 0,142,368,142 
     1044        Button pick_emp,pos={4,65},size={105,20},proc=PickEMPTransButton,title="set EMPTY file" 
    10451045        Button pick_emp,help={"This button will set the file selected in the Transmission file table to be the empty beam file."} 
    10461046        SetVariable empStr,pos={114,67},size={250,17},title="file:" 
     
    10481048        SetVariable empStr,fSize=10 
    10491049        SetVariable empStr,limits={-Inf,Inf,0},value= root:myGlobals:TransHeaderInfo:gEMP 
    1050         Button Trn_button_1,pos={5,101},size={90,20},proc=Trn_SetXYBoxButton,title="Set XY Box" 
     1050        Button Trn_button_1,pos={5,91},size={90,20},proc=Trn_SetXYBoxButton,title="Set XY Box" 
    10511051        Button Trn_button_1,help={"Sets the XY box to sum over"} 
    1052         Button Trn_button_2,pos={174,139},size={110,20},proc=Trn_SortFilesByDate,title="Sort by Date" 
     1052        Button Trn_button_2,pos={174,156},size={110,20},proc=Trn_SortFilesByDate,title="Sort by Date" 
    10531053        Button Trn_button_2,help={"Sort the scattering and transmission files by creation date."} 
    1054         Button Trn_button_3,pos={174,169},size={110,20},proc=Trn_SortFilesByLabel,title="Sort by Label" 
     1054        Button Trn_button_3,pos={174,186},size={110,20},proc=Trn_SortFilesByLabel,title="Sort by Label" 
    10551055        Button Trn_button_3,help={"Sort the scattering and transmission files by label."} 
    1056         Button Trn_button_4,pos={295,139},size={67,20},proc=Trn_ShowHelpProc,title="Help" 
    1057         Button Trn_button_4,help={"Show a help notebook for calculating transmissions."} 
    1058         SetVariable Trn_setvar_1,pos={135,100},size={227,17},title="Box is " 
     1056        SetVariable Trn_setvar_1,pos={135,90},size={227,17},title="Box is " 
    10591057        SetVariable Trn_setvar_1,help={"Box coordinates to sum over"},fSize=10 
    10601058        SetVariable Trn_setvar_1,limits={-Inf,Inf,0},value= root:myGlobals:TransHeaderInfo:gBox 
     
    10661064        SetVariable Trn_setvar_0,help={"Currently selected data path"},fSize=10 
    10671065        SetVariable Trn_setvar_0,limits={-Inf,Inf,0},value= root:myGlobals:TransHeaderInfo:gCatPathStr 
    1068         Button Trn_button_5,pos={5,169},size={161,20},proc=Trn_CalcAllFilesButton,title="Calculate All Files" 
     1066        Button Trn_button_5,pos={5,186},size={161,20},proc=Trn_CalcAllFilesButton,title="Calculate All Files" 
    10691067        Button Trn_button_5,help={"Calculate transmission and patch headers of ALL files in the Scattering File Table."} 
    1070         Button Trn_button_6,pos={295,198},size={67,20},proc=Trn_PanelDoneButtonProc,title="Done" 
     1068        Button Trn_button_6,pos={295,215},size={67,20},proc=Trn_PanelDoneButtonProc,title="Done" 
    10711069        Button Trn_button_6,help={"Close the panel when done calculating transmissions"} 
    10721070        Button Trn_button_7,pos={67,32},size={214,20},proc=Trn_RefreshProc,title="List Files" 
    10731071        Button Trn_button_7,help={"Generate or refresh the tables of files."} 
    1074         Button Trn_button_8,pos={5,139},size={161,20},proc=Trn_CalcSelectedFilesButton,title="Calculate Selected Files" 
     1072        Button Trn_button_8,pos={5,156},size={161,20},proc=Trn_CalcSelectedFilesButton,title="Calculate Selected Files" 
    10751073        Button Trn_button_8,help={"Calculate transmission and patch headers of selected files in the Scattering File Table."} 
    1076         Button Trn_button_10,pos={5,198}, size={161,20},proc=TotalTransButtonProc 
     1074        Button Trn_button_10,pos={5,215}, size={161,20},proc=TotalTransButtonProc 
    10771075        Button Trn_button_10 title="Calculate Total Trans" 
    10781076        Button Trn_button_10 help={"Calculate transmission over the whole detector and patch headers of ALL files in the data folder."} 
     1077        Button setEmpForAll,pos={4,117},size={120,20},proc=FillEMPFilenameWSelection,title="Use EMP for ALL" 
     1078        Button setEmpForAll,help={"This button will set the file selected in the Transmission file table to be the empty beam file."} 
     1079        Button ClearTrans,pos={175,215},size={110,20},proc=ClearSelectedAssignments,title="Clear Selection" 
     1080        Button ClearTrans,help={"This button will set the file selected in the Transmission file table to be the empty beam file."} 
    10791081EndMacro 
    10801082 
     
    15701572// 
    15711573///// 
    1572 Function FillEMPFilenameWSelection() 
    1573  
    1574         GetSelection table,TransFileTable,3 
    1575         Variable row=V_startRow                 //ony need the selected row, we know the column names and location 
     1574// March 2010: 
     1575// changed from the previous beta menu operation, now uses the text from the file name box 
     1576// rather than requiring a selection on the table (since you just set the box...) 
     1577// 
     1578Function FillEMPFilenameWSelection(ctrlName) 
     1579        String ctrlName 
     1580         
     1581//      GetSelection table,TransFileTable,3 
     1582//      Variable row=V_startRow                 //ony need the selected row, we know the column names and location 
     1583 
     1584        SVAR empName = root:myGlobals:TransHeaderInfo:gEMP 
     1585        if(strlen(empName)==0 || cmpstr(empName,"no path selected")==0) 
     1586                DoAlert 0,"Please select and set an empty beam file" 
     1587                return(0) 
     1588        endif 
    15761589        Wave/T fw = root:myGlobals:TransHeaderInfo:T_FileNames          //trans files 
    15771590        Wave/T ew = root:myGlobals:TransHeaderInfo:T_EMP_FileNames              //empty beam reference files 
    15781591         
    1579         ew[] = fw[row] 
     1592        ew[] = empName 
    15801593         
    15811594        return(0) 
     
    19391952End 
    19401953 
    1941 Function ClearSelectedAssignments() 
    1942          
    1943         String winStr = WinList("*", ";", "WIN:" )              //returns the target window 
     1954// now a button on the Transmission Panel 
     1955Function ClearSelectedAssignments(ctrlName) 
     1956        String ctrlName 
     1957 
     1958        /// old way, from the menu - takes the selection from the top window, have it now return the top table. 
     1959//      String winStr = WinList("*", ";", "WIN:" )              //returns the top window (with a trailing semicolon!) 
     1960        String winStr = WinName(0,2,1)                  //returns the top visible table 
    19441961        Variable scatterTableExists, transTableExists 
    1945         Print winStr 
    1946         scatterTableExists = cmpstr(winStr,"ScatterFileTable;") 
     1962//      Print winStr 
     1963        scatterTableExists = cmpstr(winStr,"ScatterFileTable") 
    19471964        if (scatterTableExists == 0) 
    19481965                GetSelection table,ScatterFileTable,1    
     
    19501967        endif 
    19511968         
    1952         transTableExists = cmpstr(winStr,"TransFileTable;") 
     1969        transTableExists = cmpstr(winStr,"TransFileTable") 
    19531970        if (transTableExists == 0) 
    19541971                GetSelection table,TransFileTable,1      
     
    19561973        endif 
    19571974         
     1975///////// new method, presents a clunky dialog - don't use this way unless I absolutely need to 
     1976//      Variable whichTable=1 
     1977//      Prompt whichTable,"Which Table?",popup,"Transmission Files;Scattering Files;" 
     1978//      DoPrompt "Which Selection to Clear",whichTable 
     1979//      if (V_Flag) 
     1980//              return 0                                                                        // user canceled 
     1981//      endif 
     1982// 
     1983//      if (whichTable == 1)            //the Transmission Table 
     1984//              GetSelection table,TransFileTable,1      
     1985//              fClearSelectedAssignments(V_startRow,V_endRow,2) 
     1986//      else 
     1987//              //the Scattering Files table 
     1988//              GetSelection table,ScatterFileTable,1    
     1989//              fClearSelectedAssignments(V_startRow,V_endRow,1) 
     1990//      endif 
    19581991        return(0) 
    19591992End 
Note: See TracChangeset for help on using the changeset viewer.