Ignore:
Timestamp:
Oct 1, 2009 10:15:08 AM (13 years ago)
Author:
srkline
Message:

A variety of changes...

  • fixed model strings for Sum_Model
  • /Z flag for RTHelp, Transmission help, FIT help, MRED help
  • added help and done buttons to SASCALC
  • added comments in MonteCarlo?
  • restored the 2-line buttons in USANS panels, now supported in Igor 6.1 (COR_Graph and Main_USANS)
  • added simple text notebook of UCALC configuration, and a save of PNG of the whole panel
  • added help and done buttons to UCALC
  • added links in SANS_Reduction_Help to the simluation help file (not added to SVN yet)
Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction
Files:
9 edited

Legend:

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

    r477 r564  
    115115Proc showFITHelp(ctrlName): ButtonControl 
    116116        String ctrlName 
    117         DisplayHelpTopic/K=1 "SANS Data Reduction Tutorial[Fit Lines to Your Data]" 
     117        DisplayHelpTopic/K=1/Z "SANS Data Reduction Tutorial[Fit Lines to Your Data]" 
    118118        if(V_flag !=0) 
    119119                DoAlert 0,"The SANS Data Reduction Tutorial Help file could not be found" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf

    r558 r564  
    1010// 
    1111// 
     12 
     13 
     14 
     15// *** look into erand48() as the (pseudo) random number generator (it's a standard c-lib function, at least on unix) 
     16//     and is apparantly thread safe. drand48() returns values [0.0,1.0) 
     17//http://qnxcs.unomaha.edu/help/product/neutrino/lib_ref/e/erand48.html 
     18 
     19 
     20 
    1221// - Why am I off by a factor of 2.7 - 3.7 (MC too high) relative to real data? 
    1322//   I need to include efficiency (70%?) - do I knock these off before the simulation or do I  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultipleReduce.ipf

    r412 r564  
    200200        String ctrlName 
    201201 
    202         DisplayHelpTopic/K=1 "SANS Data Reduction Tutorial[Reduce Multiple Files]" 
     202        DisplayHelpTopic/Z/K=1 "SANS Data Reduction Tutorial[Reduce Multiple Files]" 
    203203        if(V_flag !=0) 
    204204                DoAlert 0,"The SANS Data Reduction Tutorial Help file could not be found" 
     
    516516        return outputList 
    517517End 
    518  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/RealTimeUpdate_RT.ipf

    r543 r564  
    188188        String ctrlName 
    189189//      DoAlert 0,"the help file has not been written yet :-(" 
    190         DisplayHelpTopic/K=1 "SANS Data Reduction Tutorial[Real Time Data Display]" 
     190        DisplayHelpTopic/Z/K=1 "SANS Data Reduction Tutorial[Real Time Data Display]" 
    191191End 
    192192 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf

    r558 r564  
    379379        PopupMenu popup0_2,pos={108,127},size={55,20},proc=DeltaLambdaPopMenuProc 
    380380        PopupMenu popup0_2,mode=2,value= root:Packages:NIST:SAS:gDeltaLambdaStr 
    381         Button FreezeButton title="Freeze",size={60,20},pos={307,166} 
     381        Button FreezeButton title="Freeze",size={60,20},pos={180,166} 
    382382        Button FreezeButton proc=FreezeButtonProc 
    383         Button ClearButton title="Clear",size={60,20},pos={377,166} 
     383        Button ClearButton title="Clear",size={60,20},pos={250,166} 
    384384        Button ClearButton proc=S_ClearButtonProc 
    385385        GroupBox group0,pos={6,1},size={108,36},title="Instrument" 
     
    395395        CheckBox checkSim,value=0 
    396396         
     397        // help, done buttons 
     398        Button SC_helpButton,pos={340,166},size={25,20},proc=showSASCALCHelp,title="?" 
     399        Button SC_helpButton,help={"Show help file for simulation of SANS Data"} 
     400        Button SC_DoneButton,pos={380,166},size={50,20},proc=SASCALCDoneButton,title="Done" 
     401        Button SC_DoneButton,help={"This button will close the panel"} 
     402 
    397403        // set up a fake dependency to trigger recalculation 
    398404        //root:Packages:NIST:SAS:gCalculate := ReCalculateInten(root:Packages:NIST:SAS:gTouched) 
    399405EndMacro 
     406 
     407//clean up 
     408Proc SASCALCDoneButton(ctrlName): ButtonControl 
     409        String ctrlName 
     410        DoWindow/K SASCALC 
     411        DoWindow/K Trial_Configuration 
     412        DoWindow/K Saved_Configurations 
     413        DoWindow/K MC_SASCALC 
     414        DoWindow/K Sim_1D_Panel 
     415end 
     416 
     417// 
     418Proc showSASCALCHelp(ctrlName): ButtonControl 
     419        String ctrlName 
     420        DisplayHelpTopic/K=1/Z "SASCALC" 
     421        if(V_flag !=0) 
     422                DoAlert 0,"The SANS Simulation Help file could not be found" 
     423        endif 
     424end 
    400425 
    401426// based on the instrument selected... 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf

    r545 r564  
    10661066Proc ShowTransHelp(ctrlName) : ButtonControl 
    10671067        String ctrlName 
    1068         DisplayHelpTopic/K=1 "SANS Data Reduction Tutorial[Calculate Transmissions]" 
     1068        DisplayHelpTopic/Z/K=1 "SANS Data Reduction Tutorial[Calculate Transmissions]" 
    10691069        if(V_flag !=0) 
    10701070                DoAlert 0,"The SANS Data Reduction Tutorial Help file could not be found" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/COR_Graph.ipf

    r544 r564  
    4747                SetVariable gThick,help={"Thickness of the sample in centimeters"} 
    4848                SetVariable gThick,limits={0,5,0.01},value= $(USANSFolder+":Globals:MainPanel:gThick") 
    49                 Button UpdateButton,pos={115,19},size={88,20},proc=UpdateButtonProc,title="Update Trans" 
     49                Button UpdateButton,pos={125,15},size={70,40},proc=UpdateButtonProc,title="Update\rTrans" 
    5050                Button UpdateButton,help={"Updates both the wide and rocking transmission values based on the raw data files"} 
    51                 Button CorrectButton,pos={115,53},size={88,20},proc=CorrectButtonProc,title="Correct Data" 
     51                Button CorrectButton,pos={125,60},size={70,40},proc=CorrectButtonProc,title="Correct\rData" 
    5252                Button CorrectButton,help={"Corrects the sample data by subtracting empty cell and backgrond scattering"} 
    5353                Button SaveDataButton,pos={355,3},size={85,20},proc=SaveButtonProc,title="Save Data..." 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r544 r564  
    149149        ListBox samLB,pos={149,55},size={110,90},listWave=root:Packages:NIST:USANS:Globals:MainPanel:samWave 
    150150        ListBox samLB,mode= 1,selRow= -1 
    151         Button ClearSamButton,pos={224,148},size={35,21},proc=ClearButtonProc,title="Clr" 
     151        Button ClearSamButton,pos={227,148},size={35,20},proc=ClearButtonProc,title="Clr" 
    152152        Button ClearSamButton,help={"Clears the list of sample scans"} 
    153153        Button ClearEmpButton,pos={227,286},size={35,20},proc=ClearButtonProc,title="Clr" 
     
    155155        Button RefreshButton,pos={9,310},size={104,20},proc=RefreshListButtonProc,title="Refresh" 
    156156        Button RefreshButton,help={"Refreshes the list of raw ICP data files"} 
    157         Button DelSamButton,pos={186,148},size={35,20},proc=DelSamButtonProc,title="Del" 
     157        Button DelSamButton,pos={183,148},size={35,20},proc=DelSamButtonProc,title="Del" 
    158158        Button DelSamButton,help={"Deletes the selected file(s) from the list of sample scans"} 
    159         Button DelEmpButton,pos={190,286},size={35,20},proc=DelEmpButtonProc,title="Del" 
     159        Button DelEmpButton,pos={183,286},size={35,20},proc=DelEmpButtonProc,title="Del" 
    160160        Button DelEmpButton,help={"Deletes the selected file(s) from the list of empty scans"} 
    161161        ListBox empLB,pos={151,194},size={110,90} 
    162162        ListBox empLB,listWave=root:Packages:NIST:USANS:Globals:MainPanel:empWave,mode= 1,selRow= 0 
    163         Button toSamList,pos={118,55},size={25,90},proc=toSamListButtonProc,title="S->" 
     163        Button toSamList,pos={118,55},size={25,90},proc=toSamListButtonProc,title="S\r->" 
    164164        Button toSamList,help={"Adds the selected file(s) to the list of sample scans"} 
    165         Button toEmpList,pos={120,195},size={25,90},proc=toEmptyListButtonProc,title="E->" 
     165        Button toEmpList,pos={120,195},size={25,90},proc=toEmptyListButtonProc,title="E\r->" 
    166166        Button toEmpList,help={"Adds the selected file(s) to the list of empty (cell) scans"} 
    167167        ListBox StatusLB,pos={11,358},size={386,77} 
     
    169169        Button pickPathButton,pos={6,8},size={80,20},proc=PickBT5PathButton,title="DataPath..." 
    170170        Button pickPathButton,help={"Select the data folder where the raw ICP data files are located"} 
    171         Button PlotSelectedSAMButton,pos={148,148},size={35,20},proc=PlotSelectedSAMButtonProc,title="Plot" 
     171        Button PlotSelectedSAMButton,pos={140,148},size={35,20},proc=PlotSelectedSAMButtonProc,title="Plot" 
    172172        Button PlotSelectedSAMButton,help={"Plot the selected sample scattering files in the COR_Graph"} 
    173         Button PlotSelectedEMPButton,pos={152,286},size={35,20},proc=PlotSelectedEMPButtonProc,title="Plot" 
     173        Button PlotSelectedEMPButton,pos={140,286},size={35,20},proc=PlotSelectedEMPButtonProc,title="Plot" 
    174174        Button PlotSelectedEMPButton,help={"Plot the selected empty cell scattering files in the COR_Graph"} 
    175175        Button pickSavePathButton,pos={97,8},size={80,20},proc=PickSaveButtonProc,title="SavePath..." 
     
    179179        Button RefreshCurrent,pos={298,310},size={95,20},proc=RefreshCurrentButtonProc,title="Refresh",disable=2 
    180180        Button RefreshCurrent,help={"Updates data files on Charlotte and gets current data file name"} 
    181         Button AddCurToSAM,pos={264,55},size={25,90},proc=CurtoSamListButtonProc,title="<-S",disable=2 
     181        Button AddCurToSAM,pos={264,55},size={25,90},proc=CurtoSamListButtonProc,title="S\r<-",disable=2 
    182182        Button AddCurToSAM,help={"Adds the current data file to the list of sample scans"} 
    183         Button AddCurToEMP,pos={265,194},size={25,90},proc=CurtoEmptyListButtonProc,title="<-E",disable=2 
     183        Button AddCurToEMP,pos={265,194},size={25,90},proc=CurtoEmptyListButtonProc,title="E\r<-",disable=2 
    184184        Button AddCurToEMP,help={"Adds the current data file to the list of empty scans"} 
    185185        ListBox CurFileBox,pos={295,55},size={100,230},proc=FileListBoxProc,disable=1 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf

    r558 r564  
    113113        Variable/G gAngHigh7 = 95 
    114114        Variable/G gNumPts7 = 10 
    115         Variable/G gCtTime7 = 0 
    116         Variable/G gIncr7 = 3000         
     115        Variable/G gCtTime7 = 3000 
     116        Variable/G gIncr7 = 5    
    117117         
    118118        // results, setup values 
     
    459459        ValDisplay valdisp0_3,limits={0,0,0},barmisc={0,1000},value=root:Packages:NIST:USANS:Globals:U_Sim:g_1DEstTrans 
    460460        ValDisplay valdisp0_3,disable=1 
    461         Button button1,pos={left+20,440},size={150,20},proc=U_SaveButtonProc,title="Save Simulated Data" 
    462  
    463          
     461        Button button1,pos={left+20,400},size={150,20},proc=U_SavePanelProc,title="Save PNG" 
     462        Button button2,pos={left+20,430},size={150,20},proc=U_ConfigTextProc,title="Config Text" 
     463        Button button3,pos={left+20,460},size={150,20},proc=U_SaveButtonProc,title="Save Simulated Data" 
     464 
     465// help, done buttons 
     466        Button U_helpButton,pos={300,440},size={25,20},proc=showUCALCHelp,title="?" 
     467        Button U_helpButton,help={"Show help file for simulation of USANS Data"} 
     468        Button U_DoneButton,pos={350,440},size={50,20},proc=UCALCDoneButton,title="Done" 
     469        Button U_DoneButton,help={"This button will close the panel"} 
     470                 
    464471        SetDataFolder root: 
    465472 
    466473EndMacro 
    467474 
     475Proc UCALCDoneButton(ctrlName): ButtonControl 
     476        String ctrlName 
     477        DoWindow/K UCALC 
     478end 
     479 
     480Proc showUCALCHelp(ctrlName): ButtonControl 
     481        String ctrlName 
     482        DisplayHelpTopic/K=1/Z "UCALC" 
     483        if(V_flag !=0) 
     484                DoAlert 0,"The USANS Simulation Help file could not be found" 
     485        endif 
     486end 
    468487 
    469488// changing theta min - hold incr and #, result is new theta max 
     
    16551674        return(0) 
    16561675end 
     1676 
     1677 
     1678// print out the USANS configuration in some reasonable format 
     1679Function/S USANSConfigurationText() 
     1680 
     1681        String str="",temp 
     1682 
     1683        SetDataFolder root:Packages:NIST:USANS:Globals:U_Sim 
     1684         
     1685        // results, setup values 
     1686        SVAR gTotTimeStr=gTotTimeStr 
     1687         
     1688        Variable ii,num 
     1689        String pathStr="root:Packages:NIST:USANS:Globals:U_Sim:" 
     1690        num=7 
     1691         
     1692        str += "USANS Instrument Configuration:\r\r" 
     1693        str += "Theta Min  Theta Max   Increment   # Points   Count Time\r" 
     1694         
     1695         
     1696        for(ii=1;ii<=num;ii+=1) 
     1697                NVAR ctTime = $(pathStr+"gCtTime"+num2str(ii)) 
     1698                if(ctTime>0) 
     1699                        NVAR angLow = $(pathStr+"gAngLow"+num2str(ii)) 
     1700                        NVAR angHigh = $(pathStr+"gAngHigh"+num2str(ii)) 
     1701                        NVAR incr = $(pathStr+"gIncr"+num2str(ii)) 
     1702                        NVAR numPts = $(pathStr+"gNumPts"+num2str(ii)) 
     1703                         
     1704                        sprintf temp,"%9.3f  %9.3f  %9.3f  %9d  %9d\r",angLow,angHigh,incr,numPts,ctTime 
     1705                        str += temp 
     1706                endif 
     1707        endfor 
     1708         
     1709         
     1710        sprintf temp,"\r\rTotal Counting Time (HR:MIN) = %s\r",gTotTimeStr 
     1711        str += temp 
     1712 
     1713         
     1714   setDataFolder root: 
     1715   return str                     
     1716End 
     1717 
     1718Function DisplayUCALCText() 
     1719 
     1720        if(WinType("USANS_Configuration")==0) 
     1721                NewNotebook/F=0/K=1/N=USANS_Configuration /W=(480,44,880,369) 
     1722        endif 
     1723        //replace the text 
     1724        Notebook USANS_Configuration selection={startOfFile, endOfFile} 
     1725        Notebook USANS_Configuration font="Monaco",fSize=10,text=USANSConfigurationText() 
     1726        return(0) 
     1727end 
     1728 
     1729 
     1730// 
     1731Function U_ConfigTextProc(ba) : ButtonControl 
     1732        STRUCT WMButtonAction &ba 
     1733 
     1734         
     1735        switch( ba.eventCode ) 
     1736                case 2: // mouse up 
     1737                        // click code here 
     1738                         
     1739                                DisplayUCALCText()                                       
     1740                        break 
     1741        endswitch 
     1742 
     1743        return 0 
     1744End 
     1745 
     1746// this will save a graphic of the whole panel that then needs to be opened and printed 
     1747// must be a PNG @ screen resolution 
     1748// 
     1749Function U_SavePanelProc(ba) : ButtonControl 
     1750        STRUCT WMButtonAction &ba 
     1751 
     1752         
     1753        switch( ba.eventCode ) 
     1754                case 2: // mouse up 
     1755                        // click code here 
     1756                         
     1757                        SavePICT/P=home/E=-5/B=72/SNAP=1         
     1758                         
     1759                        // can I reload and print? 
     1760                        // how will the users know where this went and what to do with it? 
     1761                        //                       
     1762                        break 
     1763        endswitch 
     1764 
     1765        return 0 
     1766End 
Note: See TracChangeset for help on using the changeset viewer.