Changeset 857


Ignore:
Timestamp:
Feb 23, 2020 7:33:39 PM (20 months ago)
Author:
ilavsky
Message:

Working on MultiDataFit? tool

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Irena/IR1_Loader.ipf

    r854 r857  
    7979#include ":IR3_GuinierPorodModel", version>=1.11
    8080#include ":IR3_MergingData", version>=1.19
     81#include ":IR3_MultiDataPlot", version>=1
    8182#include ":IR3_SimpleFits", version>=1.10
    8283#include ":IR3_WAXSDiffraction", version>=1.14
  • trunk/User Procedures/Irena/IR1_Main.ipf

    r855 r857  
    160160        "Plotting II", IR2D_DWSPlotToolMain()
    161161        help = {"Plotting tool which controls any top graph"}
     162        "Multi Sample Plot-Fit - under developement", IR3L_MultiSaPlotFit()
     163        help={"Plotting and fitting of multiple SAS data. Developement for now. Do not use. "}
    162164                SubMenu "Support Tools for plots and tables"
    163165                "Draw Line Of Any Slope", IR2P_DrawLineOfAnySlope()
     
    173175                End
    174176        "---"
     177        //"Multi Sample Fit - under developement", IR3L_MultiSaPlotFit()
     178        //help={"Plotting and fitting of multiple SAS data. Developement for now. Do not use. "}
    175179        "Unified Fit", IR1A_UnifiedModel()
    176180        help = {"Modeling of SAS by modeling Guinier and Power law dependecies, based on Unified model by Gregg Beaucage"}
     
    187191        "Small-Angle Diffraction", IR2D_MainSmallAngleDiff()
    188192        help={"Modeling of small angle diffraction - up to 6 peaks and Powerlaw background"}
    189         //"Simple Fits - under developement", IR3L_SimpleFits()
    190         //help={"Simple fitting of SAS data. Developement for now. Do not use. "}
    191193        "Powder Diffraction fitting = WAXS", IR3W_WAXS()
    192         help={"Simple tool for analysis of WAXS/Powder diffraction data. Developement version for public."}
     194        help={"Tool for analysis of WAXS/Powder diffraction data. Developement version for public."}
    193195        "Pair distance dist. fnct.", IR2Pr_MainPDDF()
    194196        help={"Calculate pair distribution function using various methods"}
  • trunk/User Procedures/Irena/IR3_SimpleFits.ipf

    r804 r857  
    11#pragma rtGlobals=3             // Use modern global access method and strict wave access.
    22#pragma version=1.1
    3 constant IR3LversionNumber = 1                  //Data merging panel version number
     3constant IR3JversionNumber = 1                  //Data merging panel version number
    44
    55//*************************************************************************\
     
    1010
    1111//1.1 combined this ipf with "Simple fits models"
    12 //1.0 Simple Fits tool first release version
     12//1.0 Simple Fits tool first test version
    1313
    1414
     
    1818///******************************************************************************************
    1919///******************************************************************************************
    20 Function IR3L_SimpleFits()
     20Function IR3J_MultiSaPlotFit()
    2121
    2222        IN2G_CheckScreenSize("width",1200)
    23         DoWIndow IR3L_SimpleFitsPanel
     23        DoWIndow IR3J_MultiSaPlotFitPanel
    2424        if(V_Flag)
    25                 DoWindow/F IR3L_SimpleFitsPanel
    26                 //DoWindow/K IR3L_SimpleFitsPanel
    27                 //Execute("IR3L_SimpleFitsPanel()")
     25                DoWindow/F IR3J_MultiSaPlotFitPanel
     26                //DoWindow/K IR3J_MultiSaPlotFitPanel
     27                //Execute("IR3J_MultiSaPlotFitPanel()")
    2828        else
    29                 IR3L_InitSimpleFits()
    30                 Execute("IR3L_SimpleFitsPanel()")
    31 //              setWIndow IR3L_SimpleFitsPanel, hook(CursorMoved)=IR3D_PanelHookFunction
     29                IR3J_InitMultiSaPlotFit()
     30                IR3J_MultiSaPlotFitPanelFnct()
     31//              setWIndow IR3J_MultiSaPlotFitPanel, hook(CursorMoved)=IR3D_PanelHookFunction
    3232        endif
    3333//      UpdatePanelVersionNumber("IR3D_DataMergePanel", IR3DversionNumber)
     
    4141//************************************************************************************************************
    4242//************************************************************************************************************
    43 Proc IR3L_SimpleFitsPanel()
     43Function IR3J_MultiSaPlotFitPanelFnct()
    4444        PauseUpdate; Silent 1           // building window...
    4545        NewPanel /K=1 /W=(2.25,43.25,1195,800) as "Simple Fits"
    46         DoWIndow/C IR3L_SimpleFitsPanel
    47         TitleBox MainTitle title="Linerization fits panel",pos={280,2},frame=0,fstyle=3, fixedSize=1,font= "Times New Roman", size={360,30},fSize=22,fColor=(0,0,52224)
     46        DoWIndow/C IR3J_MultiSaPlotFitPanel
     47        TitleBox MainTitle title="Multi Sample plot & fit",pos={200,2},frame=0,fstyle=3, fixedSize=1,font= "Times New Roman", size={360,30},fSize=22,fColor=(0,0,52224)
    4848//      TitleBox FakeLine1 title=" ",fixedSize=1,size={330,3},pos={16,148},frame=0,fColor=(0,0,52224), labelBack=(0,0,52224)
    4949//      TitleBox FakeLine2 title=" ",fixedSize=1,size={330,3},pos={16,428},frame=0,fColor=(0,0,52224), labelBack=(0,0,52224)
     
    5656        string XUserLookup=""
    5757        string EUserLookup=""
    58         IR2C_AddDataControls("Irena:SimpleFits","IR3L_SimpleFitsPanel","DSM_Int;M_DSM_Int;SMR_Int;M_SMR_Int;","AllCurrentlyAllowedTypes",UserDataTypes,UserNameString,XUserLookup,EUserLookup, 0,1, DoNotAddControls=1)
     58        IR2C_AddDataControls("Irena:MultiSaPlotFit","IR3J_MultiSaPlotFitPanel","DSM_Int;M_DSM_Int;SMR_Int;M_SMR_Int;","AllCurrentlyAllowedTypes",UserDataTypes,UserNameString,XUserLookup,EUserLookup, 0,1, DoNotAddControls=1)
    5959
    6060
    6161        DrawText 60,25,"Data selection"
    62         Checkbox UseIndra2Data, pos={10,30},size={76,14},title="USAXS", proc=IR3L_LinearFitsCheckProc, variable=root:Packages:Irena:SimpleFits:UseIndra2Data
    63         checkbox UseQRSData, pos={120,30}, title="QRS(QIS)", size={76,14},proc=IR3L_LinearFitsCheckProc, variable=root:Packages:Irena:SimpleFits:UseQRSdata
    64         PopupMenu StartFolderSelection,pos={10,50},size={180,15},proc=IR3L_PopMenuProc,title="Start fldr"
    65         PopupMenu StartFolderSelection,mode=1,popvalue=root:Packages:Irena:SimpleFits:DataStartFolder,value= #"\"root:;\"+IR2S_GenStringOfFolders2(root:Packages:Irena:SimpleFits:UseIndra2Data, root:Packages:Irena:SimpleFits:UseQRSdata,2,1)"
    66         SetVariable FolderNameMatchString,pos={10,75},size={210,15}, proc=IR3L_SetVarProc,title="Folder Match (RegEx)"
    67         Setvariable FolderNameMatchString,fSize=10,fStyle=2, variable=root:Packages:Irena:SimpleFits:DataMatchString
    68         PopupMenu SortFolders,pos={10,100},size={180,20},fStyle=2,proc=IR3L_PopMenuProc,title="Sort Folders"
    69         PopupMenu SortFolders,mode=1,popvalue=root:Packages:Irena:SimpleFits:FolderSortString,value= root:Packages:Irena:SimpleFits:FolderSortStringAll
    70 
    71         ListBox DataFolderSelection,pos={4,135},size={250,480}, mode=10
    72         ListBox DataFolderSelection,listWave=root:Packages:Irena:SimpleFits:ListOfAvailableData
    73         ListBox DataFolderSelection,selWave=root:Packages:Irena:SimpleFits:SelectionOfAvailableData
    74         ListBox DataFolderSelection,proc=IR3L_LinFitsListBoxProc
    75 
    76         SetVariable DataQEnd,pos={280,90},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Fit Q max      ",bodyWidth=150
    77         Setvariable DataQEnd, variable=root:Packages:Irena:SimpleFits:DataQEnd, limits={-inf,inf,0}
    78         SetVariable DataQstart,pos={280,110},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Fit Q start      ",bodyWidth=150
    79         Setvariable DataQstart, variable=root:Packages:Irena:SimpleFits:DataQstart, limits={-inf,inf,0}
    80         SetVariable DataBackground,pos={280,130},size={200,15}, noproc,title="Background",bodyWidth=150
    81         Setvariable DataBackground, variable=root:Packages:Irena:SimpleFits:DataBackground, limits={-inf,inf,0}
    82 //      ListOfVariables+="DataBackground;"
    83 //      ListOfVariables+="Guinier_Rg;Guinier_I0;"
    84 //      ListOfVariables+="ProcessManually;ProcessSequentially;OverwriteExistingData;AutosaveAfterProcessing;"
    85 //      ListOfVariables+="DataQEnd;DataQstart;"
    86 
    87         PopupMenu SimpleModel,pos={280,175},size={180,20},fStyle=2,proc=IR3L_PopMenuProc,title="Model to fit : "
    88         PopupMenu SimpleModel,mode=1,popvalue=root:Packages:Irena:SimpleFits:ListOfSimpleModels,value= root:Packages:Irena:SimpleFits:SimpleModel
    89 
    90         SetVariable Guinier_Rg,pos={280,220},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Guinier  Rg    ",bodyWidth=150
    91         Setvariable Guinier_Rg, variable=root:Packages:Irena:SimpleFits:Guinier_Rg, limits={-inf,inf,0}
    92 
    93         SetVariable Guinier_I0,pos={280,200},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Guinier I0    ",bodyWidth=150
    94         Setvariable Guinier_I0, variable=root:Packages:Irena:SimpleFits:Guinier_I0, limits={-inf,inf,0}
     62        Checkbox UseIndra2Data, pos={10,30},size={76,14},title="USAXS", proc=IR3J_LinearFitsCheckProc, variable=root:Packages:Irena:MultiSaPlotFit:UseIndra2Data
     63        checkbox UseQRSData, pos={120,30}, title="QRS(QIS)", size={76,14},proc=IR3J_LinearFitsCheckProc, variable=root:Packages:Irena:MultiSaPlotFit:UseQRSdata
     64        PopupMenu StartFolderSelection,pos={10,50},size={180,15},proc=IR3J_PopMenuProc,title="Start fldr"
     65        SVAR DataStartFolder = root:Packages:Irena:MultiSaPlotFit:DataStartFolder
     66        PopupMenu StartFolderSelection,mode=1,popvalue=DataStartFolder,value= #"\"root:;\"+IR2S_GenStringOfFolders2(root:Packages:Irena:MultiSaPlotFit:UseIndra2Data, root:Packages:Irena:MultiSaPlotFit:UseQRSdata,2,1)"
     67        SetVariable FolderNameMatchString,pos={10,75},size={210,15}, proc=IR3J_SetVarProc,title="Folder Match (RegEx)"
     68        Setvariable FolderNameMatchString,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSaPlotFit:DataMatchString
     69        PopupMenu SortFolders,pos={10,100},size={180,20},fStyle=2,proc=IR3J_PopMenuProc,title="Sort Folders"
     70        SVAR FolderSortString = root:Packages:Irena:MultiSaPlotFit:FolderSortString
     71        PopupMenu SortFolders,mode=1,popvalue=FolderSortString,value=#"root:Packages:Irena:MultiSaPlotFit:FolderSortStringAll"
     72
     73        PopupMenu SubTypeData,pos={10,120},size={180,20},fStyle=2,proc=IR3J_PopMenuProc,title="Sub-type Data"
     74        SVAR DataSubType = root:Packages:Irena:MultiSaPlotFit:DataSubType
     75        PopupMenu SubTypeData,mode=1,popvalue=DataSubType,value= #""
     76
     77
     78        ListBox DataFolderSelection,pos={4,165},size={250,500}, mode=10
     79        ListBox DataFolderSelection,listWave=root:Packages:Irena:MultiSaPlotFit:ListOfAvailableData
     80        ListBox DataFolderSelection,selWave=root:Packages:Irena:MultiSaPlotFit:SelectionOfAvailableData
     81        ListBox DataFolderSelection,proc=IR3J_LinFitsListBoxProc
     82
     83
     84        //Plotting controls...
     85       
     86        Button PlotData,pos={280,180},size={100,20}, proc=noproc,title="Plot Selected", help={"Plot selected data"}
     87
     88
     89        //this is for fits, for now Guinier. Move to tab as needed
     90        //      ListOfVariables+="DataBackground;"
     91        //      ListOfVariables+="Guinier_Rg;Guinier_I0;"
     92        //      ListOfVariables+="ProcessManually;ProcessSequentially;OverwriteExistingData;AutosaveAfterProcessing;"
     93        //      ListOfVariables+="DataQEnd;DataQstart;"
     94        //              SetVariable DataQEnd,pos={280,90},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Fit Q max      ",bodyWidth=150
     95        //              Setvariable DataQEnd, variable=root:Packages:Irena:MultiSaPlotFit:DataQEnd, limits={-inf,inf,0}
     96        //              SetVariable DataQstart,pos={280,110},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Fit Q start      ",bodyWidth=150
     97        //              Setvariable DataQstart, variable=root:Packages:Irena:MultiSaPlotFit:DataQstart, limits={-inf,inf,0}
     98        //              SetVariable DataBackground,pos={280,130},size={200,15}, noproc,title="Background",bodyWidth=150
     99        //              Setvariable DataBackground, variable=root:Packages:Irena:MultiSaPlotFit:DataBackground, limits={-inf,inf,0}
     100        //     
     101        //              PopupMenu SimpleModel,pos={280,175},size={180,20},fStyle=2,proc=IR3J_PopMenuProc,title="Model to fit : "
     102        //              PopupMenu SimpleModel,mode=1,popvalue=root:Packages:Irena:MultiSaPlotFit:ListOfSimpleModels,value= root:Packages:Irena:MultiSaPlotFit:SimpleModel
     103        //     
     104        //              SetVariable Guinier_Rg,pos={280,220},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Guinier  Rg    ",bodyWidth=150
     105        //              Setvariable Guinier_Rg, variable=root:Packages:Irena:MultiSaPlotFit:Guinier_Rg, limits={-inf,inf,0}
     106        //     
     107        //              SetVariable Guinier_I0,pos={280,200},size={200,15}, proc=IR3D_MergeDataSetVarProc,title="Guinier I0    ",bodyWidth=150
     108        //              Setvariable Guinier_I0, variable=root:Packages:Irena:MultiSaPlotFit:Guinier_I0, limits={-inf,inf,0}
    95109
    96110
     
    129143//      SetVariable NewDataFolderName,pos={550,659},size={510,15}, noproc,variable=root:Packages:Irena:SASDataMerging:NewDataFolderName, title="Merged Data: "
    130144
    131         DrawText 4,650,"Double click to add data to graph."
    132         DrawText 4,663,"Shift-click to select range of data."
    133         DrawText 4,676,"Ctrl/Cmd-click to select one data set."
    134         DrawText 4,689,"Regex for not contain: ^((?!string).)*$"
    135         DrawText 4,702,"Regex for contain:  string"
    136         DrawText 4,715,"Regex for case independent contain:  (?i)string"
    137 end
    138 //**********************************************************************************************************
    139 //**********************************************************************************************************
    140 //**********************************************************************************************************
    141 
    142 Function IR3L_InitSimpleFits() 
     145        DrawText 4,678,"Double click to add data to graph."
     146        DrawText 4,695,"Shift-click to select range of data."
     147        DrawText 4,710,"Ctrl/Cmd-click to select one data set."
     148        DrawText 4,725,"Regex for not contain: ^((?!string).)*$"
     149        DrawText 4,740,"Regex for contain:  string"
     150        DrawText 4,755,"Regex for case independent contain:  (?i)string"
     151       
     152        IR3J_FixPanelControls()
     153end
     154//**********************************************************************************************************
     155//**********************************************************************************************************
     156//**********************************************************************************************************
     157Function IR3J_FixPanelControls()
     158
     159        NVAR UseIndra2Data = root:Packages:Irena:MultiSaPlotFit:UseIndra2Data
     160        NVAR UseQRSData=root:Packages:Irena:MultiSaPlotFit:UseQRSdata
     161        SVAR DataSubType = root:Packages:Irena:MultiSaPlotFit:DataSubType
     162        SVAR DataSubTypeResultsList=root:Packages:Irena:MultiSaPlotFit:DataSubTypeResultsList
     163        SVAR DataSubTypeUSAXSList = root:Packages:Irena:MultiSaPlotFit:DataSubTypeUSAXSList
     164        if(UseIndra2Data)
     165                        PopupMenu SubTypeData, disable =0
     166                        PopupMenu SubTypeData,mode=1,popvalue=DataSubType,value=#"root:Packages:Irena:MultiSaPlotFit:DataSubTypeUSAXSList"
     167        else
     168                        PopupMenu SubTypeData,mode=1,popvalue=DataSubType,value= ""
     169                        PopupMenu SubTypeData, disable=1
     170        endif
     171end
     172
     173//**********************************************************************************************************
     174//**********************************************************************************************************
     175//**********************************************************************************************************
     176
     177Function IR3J_InitMultiSaPlotFit()     
    143178
    144179
     
    148183        variable i
    149184               
    150         if (!DataFolderExists("root:Packages:Irena:SimpleFits"))                //create folder
     185        if (!DataFolderExists("root:Packages:Irena:MultiSaPlotFit"))            //create folder
    151186                NewDataFolder/O root:Packages
    152187                NewDataFolder/O root:Packages:Irena
    153                 NewDataFolder/O root:Packages:Irena:SimpleFits
    154         endif
    155         SetDataFolder root:Packages:Irena:SimpleFits                                    //go into the folder
     188                NewDataFolder/O root:Packages:Irena:MultiSaPlotFit
     189        endif
     190        SetDataFolder root:Packages:Irena:MultiSaPlotFit                                        //go into the folder
    156191
    157192        //here define the lists of variables and strings needed, separate names by ;...
     
    160195        ListOfStrings+="UserMessageString;SavedDataMessage;"
    161196        ListOfStrings+="SimpleModel;ListOfSimpleModels;"
     197        ListOfStrings+="DataSubTypeUSAXSList;DataSubTypeResultsList;DataSubType;"
    162198
    163199        ListOfVariables="UseIndra2Data1;UseQRSdata1;"
     
    177213
    178214        ListOfStrings="DataFolderName;IntensityWaveName;QWavename;ErrorWaveName;dQWavename;"
    179 //      ListOfStrings+="NewDataFolderName;NewIntensityWaveName;NewQWavename;NewErrorWaveName;"
    180215        for(i=0;i<itemsInList(ListOfStrings);i+=1)     
    181216                SVAR teststr=$(StringFromList(i,ListOfStrings))
     
    204239                SimpleModel="Guinier"
    205240        endif
     241        SVAR DataSubTypeUSAXSList
     242        DataSubTypeUSAXSList="DSM_Int;SMR_Int;R_Int;BL_R_Int;USAXS_PD;Monitor;"
     243        SVAR DataSubTypeResultsList
     244        DataSubTypeResultsList="Size"
     245        SVAR DataSubType
     246        DataSubType="DSM_Int"
     247
     248
    206249//      NVAR OverwriteExistingData
    207250//      NVAR AutosaveAfterProcessing
     
    226269//**************************************************************************************
    227270
    228 Function IR3L_LinearFitsCheckProc(cba) : CheckBoxControl
     271Function IR3J_LinearFitsCheckProc(cba) : CheckBoxControl
    229272        STRUCT WMCheckboxAction &cba
    230273
     
    232275                case 2: // mouse up
    233276                        Variable checked = cba.checked
    234                         NVAR UseIndra2Data =  root:Packages:Irena:SimpleFits:UseIndra2Data
    235                         NVAR UseQRSData =  root:Packages:Irena:SimpleFits:UseQRSData
    236                         SVAR DataStartFolder = root:Packages:Irena:SimpleFits:DataStartFolder
     277                        NVAR UseIndra2Data =  root:Packages:Irena:MultiSaPlotFit:UseIndra2Data
     278                        NVAR UseQRSData =  root:Packages:Irena:MultiSaPlotFit:UseQRSData
     279                        SVAR DataStartFolder = root:Packages:Irena:MultiSaPlotFit:DataStartFolder
    237280//                      SVAR UserMessageString=root:Packages:Irena:SASDataMerging:UserMessageString
    238281//                      NVAR ProcessManually =root:Packages:Irena:SASDataMerging:ProcessManually
     
    245288                                if(checked)
    246289                                        UseQRSData = 0
     290                                        IR3J_FixPanelControls()
    247291                                endif
    248292                        endif
     
    250294                                if(checked)
    251295                                        UseIndra2Data = 0
     296                                        IR3J_FixPanelControls()
    252297                                endif
    253298                        endif
    254299                        if(stringmatch(cba.ctrlName,"UseQRSData")||stringmatch(cba.ctrlName,"UseIndra2Data"))
    255300                                DataStartFolder = "root:"
    256                                 PopupMenu StartFolderSelection,win=IR3L_SimpleFitsPanel, mode=1,popvalue="root:"
    257                                 IR3L_UpdateListOfAvailFiles()
     301                                PopupMenu StartFolderSelection,win=IR3J_MultiSaPlotFitPanel, mode=1,popvalue="root:"
     302                                IR3J_UpdateListOfAvailFiles()
    258303                        endif
    259304//                      Checkbox AutosaveAfterProcessing, win=IR3D_DataMergePanel, disable=0
     
    315360//**************************************************************************************
    316361//**************************************************************************************
    317 Function IR3L_UpdateListOfAvailFiles()
     362Function IR3J_UpdateListOfAvailFiles()
    318363
    319364
    320365        string OldDF=GetDataFolder(1)
    321         setDataFolder root:Packages:Irena:SimpleFits
    322        
    323         NVAR UseIndra2Data=root:Packages:Irena:SimpleFits:UseIndra2Data
    324         NVAR UseQRSdata=root:Packages:Irena:SimpleFits:UseQRSData
    325         SVAR StartFolderName=root:Packages:Irena:SimpleFits:DataStartFolder
    326         SVAR DataMatchString= root:Packages:Irena:SimpleFits:DataMatchString
     366        setDataFolder root:Packages:Irena:MultiSaPlotFit
     367       
     368        NVAR UseIndra2Data=root:Packages:Irena:MultiSaPlotFit:UseIndra2Data
     369        NVAR UseQRSdata=root:Packages:Irena:MultiSaPlotFit:UseQRSData
     370        SVAR StartFolderName=root:Packages:Irena:MultiSaPlotFit:DataStartFolder
     371        SVAR DataMatchString= root:Packages:Irena:MultiSaPlotFit:DataMatchString
    327372        string LStartFolder, FolderContent
    328373        if(stringmatch(StartFolderName,"---"))
     
    333378        string CurrentFolders=IR3D_GenStringOfFolders(LStartFolder,UseIndra2Data, UseQRSData, 2,0,DataMatchString)
    334379
    335         Wave/T ListOfAvailableData=root:Packages:Irena:SimpleFits:ListOfAvailableData
    336         Wave SelectionOfAvailableData=root:Packages:Irena:SimpleFits:SelectionOfAvailableData
     380        Wave/T ListOfAvailableData=root:Packages:Irena:MultiSaPlotFit:ListOfAvailableData
     381        Wave SelectionOfAvailableData=root:Packages:Irena:MultiSaPlotFit:SelectionOfAvailableData
    337382        variable i, j, match
    338383        string TempStr, FolderCont
     
    353398        endif
    354399        SelectionOfAvailableData = 0
    355         IR3L_SortListOfAvailableFldrs()
     400        IR3J_SortListOfAvailableFldrs()
    356401        setDataFolder OldDF
    357402end
     
    366411//**************************************************************************************
    367412//**************************************************************************************
    368 Function IR3L_SortListOfAvailableFldrs()
    369        
    370         SVAR FolderSortString=root:Packages:Irena:SimpleFits:FolderSortString
    371         Wave/T ListOfAvailableData=root:Packages:Irena:SimpleFits:ListOfAvailableData
    372         Wave SelectionOfAvailableData=root:Packages:Irena:SimpleFits:SelectionOfAvailableData
     413Function IR3J_SortListOfAvailableFldrs()
     414       
     415        SVAR FolderSortString=root:Packages:Irena:MultiSaPlotFit:FolderSortString
     416        Wave/T ListOfAvailableData=root:Packages:Irena:MultiSaPlotFit:ListOfAvailableData
     417        Wave SelectionOfAvailableData=root:Packages:Irena:MultiSaPlotFit:SelectionOfAvailableData
    373418        if(numpnts(ListOfAvailableData)<2)
    374419                return 0
     
    518563//**************************************************************************************
    519564
    520 Function IR3L_PopMenuProc(ctrlName,popNum,popStr) : PopupMenuControl
     565Function IR3J_PopMenuProc(ctrlName,popNum,popStr) : PopupMenuControl
    521566        String ctrlName
    522567        Variable popNum
     
    525570        if(stringmatch(ctrlName,"StartFolderSelection"))
    526571                //Update the listbox using start folde popStr
    527                 SVAR StartFolderName=root:Packages:Irena:SimpleFits:DataStartFolder
     572                SVAR StartFolderName=root:Packages:Irena:MultiSaPlotFit:DataStartFolder
    528573                StartFolderName = popStr
    529                 IR3L_UpdateListOfAvailFiles()
     574                IR3J_UpdateListOfAvailFiles()
    530575        endif
    531576        if(stringmatch(ctrlName,"SortFolders"))
    532577                //do something here
    533                 SVAR FolderSortString = root:Packages:Irena:SimpleFits:FolderSortString
     578                SVAR FolderSortString = root:Packages:Irena:MultiSaPlotFit:FolderSortString
    534579                FolderSortString = popStr
    535                 IR3L_UpdateListOfAvailFiles()
     580                IR3J_UpdateListOfAvailFiles()
    536581        endif
    537582        if(stringmatch(ctrlName,"SimpleModel"))
    538583                //do something here
    539                 SVAR SimpleModel = root:Packages:Irena:SimpleFits:SimpleModel
     584                SVAR SimpleModel = root:Packages:Irena:MultiSaPlotFit:SimpleModel
    540585                SimpleModel = popStr
    541                 IR3L_CreateLinearizedData()
    542                 IR3L_AppendDataToGraphModel()
    543         endif
    544        
    545 end
    546 
    547 //**************************************************************************************
    548 //**************************************************************************************
    549 //**************************************************************************************
    550 //**************************************************************************************
    551 
    552 Function IR3L_SetVarProc(sva) : SetVariableControl
     586                IR3J_CreateLinearizedData()
     587                IR3J_AppendDataToGraphModel()
     588        endif
     589
     590        if(stringmatch(ctrlName,"SubTypeData"))
     591                //do something here
     592                SVAR DataSubType = root:Packages:Irena:MultiSaPlotFit:DataSubType
     593                DataSubType = popStr
     594        endif
     595end
     596
     597//**************************************************************************************
     598//**************************************************************************************
     599//**************************************************************************************
     600//**************************************************************************************
     601
     602Function IR3J_SetVarProc(sva) : SetVariableControl
    553603        STRUCT WMSetVariableAction &sva
    554604
     
    562612//                              IR2S_SortListOfAvailableFldrs()
    563613                        endif
    564                         NVAR DataQstart=root:Packages:Irena:SimpleFits:DataQstart
    565                         NVAR DataQEnd=root:Packages:Irena:SimpleFits:DataQEnd
     614                        NVAR DataQstart=root:Packages:Irena:MultiSaPlotFit:DataQstart
     615                        NVAR DataQEnd=root:Packages:Irena:MultiSaPlotFit:DataQEnd
    566616                       
    567617                        if(stringmatch(sva.ctrlName,"DataQEnd"))
    568                                 WAVE OriginalDataQWave = root:Packages:Irena:SimpleFits:OriginalDataQWave
     618                                WAVE OriginalDataQWave = root:Packages:Irena:MultiSaPlotFit:OriginalDataQWave
    569619                                tempP = BinarySearch(OriginalDataQWave, DataQEnd )
    570620                                if(tempP<1)
     
    576626                        endif
    577627                        if(stringmatch(sva.ctrlName,"DataQstart"))
    578                                 WAVE OriginalDataQWave = root:Packages:Irena:SimpleFits:OriginalDataQWave
     628                                WAVE OriginalDataQWave = root:Packages:Irena:MultiSaPlotFit:OriginalDataQWave
    579629                                tempP = BinarySearch(OriginalDataQWave, DataQstart )
    580630                                if(tempP<1)
     
    601651//**************************************************************************************
    602652
    603 Function IR3L_LinFitsListBoxProc(lba) : ListBoxControl
     653Function IR3J_LinFitsListBoxProc(lba) : ListBoxControl
    604654        STRUCT WMListboxAction &lba
    605655
     
    624674//                      endif
    625675                        FoldernameStr=listWave[row]
    626                         IR3L_CopyAndAppendData(FoldernameStr)
     676                        IR3J_CopyAndAppendData(FoldernameStr)
    627677//                      if(col==1&&!ProcessTest)                //this is second column of data
    628678//                              IR3D_MergeProcessData()
     
    647697//**************************************************************************************
    648698//**************************************************************************************
    649 Function IR3L_CopyAndAppendData(FolderNameStr)
     699Function IR3J_CopyAndAppendData(FolderNameStr)
    650700        string FolderNameStr
    651701       
    652702        string oldDf=GetDataFolder(1)
    653         SetDataFolder root:Packages:Irena:SimpleFits                                    //go into the folder
     703        SetDataFolder root:Packages:Irena:MultiSaPlotFit                                        //go into the folder
    654704        //IR3D_SetSavedNotSavedMessage(0)
    655705
    656                 SVAR DataStartFolder=root:Packages:Irena:SimpleFits:DataStartFolder
    657                 SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
    658                 SVAR IntensityWaveName=root:Packages:Irena:SimpleFits:IntensityWaveName
    659                 SVAR QWavename=root:Packages:Irena:SimpleFits:QWavename
    660                 SVAR ErrorWaveName=root:Packages:Irena:SimpleFits:ErrorWaveName
    661                 SVAR dQWavename=root:Packages:Irena:SimpleFits:dQWavename
    662                 NVAR UseIndra2Data=root:Packages:Irena:SimpleFits:UseIndra2Data
    663                 NVAR UseQRSdata=root:Packages:Irena:SimpleFits:UseQRSdata
     706                SVAR DataStartFolder=root:Packages:Irena:MultiSaPlotFit:DataStartFolder
     707                SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
     708                SVAR IntensityWaveName=root:Packages:Irena:MultiSaPlotFit:IntensityWaveName
     709                SVAR QWavename=root:Packages:Irena:MultiSaPlotFit:QWavename
     710                SVAR ErrorWaveName=root:Packages:Irena:MultiSaPlotFit:ErrorWaveName
     711                SVAR dQWavename=root:Packages:Irena:MultiSaPlotFit:dQWavename
     712                NVAR UseIndra2Data=root:Packages:Irena:MultiSaPlotFit:UseIndra2Data
     713                NVAR UseQRSdata=root:Packages:Irena:MultiSaPlotFit:UseQRSdata
     714                SVAR DataSubType = root:Packages:Irena:MultiSaPlotFit:DataSubType
    664715                //these are variables used by the control procedure
    665                 NVAR  UseResults=  root:Packages:Irena:SimpleFits:UseResults
    666                 NVAR  UseUserDefinedData=  root:Packages:Irena:SimpleFits:UseUserDefinedData
    667                 NVAR  UseModelData = root:Packages:Irena:SimpleFits:UseModelData
    668                 SVAR DataFolderName  = root:Packages:Irena:SimpleFits:DataFolderName
    669                 SVAR IntensityWaveName = root:Packages:Irena:SimpleFits:IntensityWaveName
    670                 SVAR QWavename = root:Packages:Irena:SimpleFits:QWavename
    671                 SVAR ErrorWaveName = root:Packages:Irena:SimpleFits:ErrorWaveName
     716                NVAR  UseResults=  root:Packages:Irena:MultiSaPlotFit:UseResults
     717                NVAR  UseUserDefinedData=  root:Packages:Irena:MultiSaPlotFit:UseUserDefinedData
     718                NVAR  UseModelData = root:Packages:Irena:MultiSaPlotFit:UseModelData
     719                SVAR DataFolderName  = root:Packages:Irena:MultiSaPlotFit:DataFolderName
     720                SVAR IntensityWaveName = root:Packages:Irena:MultiSaPlotFit:IntensityWaveName
     721                SVAR QWavename = root:Packages:Irena:MultiSaPlotFit:QWavename
     722                SVAR ErrorWaveName = root:Packages:Irena:MultiSaPlotFit:ErrorWaveName
    672723                UseResults = 0
    673724                UseUserDefinedData = 0
    674725                UseModelData = 0
    675                 //get the names of waves, assume this tool actually works. May not under some conditions. In that case this tool will not work.
    676726                DataFolderName = DataStartFolder+FolderNameStr
    677                 QWavename = stringFromList(0,IR2P_ListOfWaves("Xaxis","", "IR3L_SimpleFitsPanel"))
    678                 IntensityWaveName = stringFromList(0,IR2P_ListOfWaves("Yaxis","*", "IR3L_SimpleFitsPanel"))
    679                 ErrorWaveName = stringFromList(0,IR2P_ListOfWaves("Error","*", "IR3L_SimpleFitsPanel"))
    680                 if(UseIndra2Data)
    681                         dQWavename = ReplaceString("Qvec", QWavename, "dQ")
    682                 elseif(UseQRSdata)
    683                         dQWavename = "w"+QWavename[1,31]
    684                 else
    685                         dQWavename = ""
     727                if(UseQRSdata)
     728                        //get the names of waves, assume this tool actually works. May not under some conditions. In that case this tool will not work.
     729                        QWavename = stringFromList(0,IR2P_ListOfWaves("Xaxis","", "IR3J_MultiSaPlotFitPanel"))
     730                        IntensityWaveName = stringFromList(0,IR2P_ListOfWaves("Yaxis","*", "IR3J_MultiSaPlotFitPanel"))
     731                        ErrorWaveName = stringFromList(0,IR2P_ListOfWaves("Error","*", "IR3J_MultiSaPlotFitPanel"))
     732                        if(UseIndra2Data)
     733                                dQWavename = ReplaceString("Qvec", QWavename, "dQ")
     734                        elseif(UseQRSdata)
     735                                dQWavename = "w"+QWavename[1,31]
     736                        else
     737                                dQWavename = ""
     738                        endif
     739                elseif(UseIndra2Data)
     740                        string DataSubTypeInt = DataSubType
     741                        string QvecLookup="R_Int=R_Qvec;BL_R_Int=BL_R_Qvec;SMR_Int=SMR_Qvec;DSM_Int=DSM_Qvec;USAXS_PD=Ar_encoder;Monitor=Ar_encoder;"
     742                        string ErrorLookup="R_Int=R_Error;BL_R_Int=BL_R_error;SMR_Int=SMR_Error;DSM_Int=DSM_error;"
     743                        string dQLookup="SMR_Int=SMR_dQ;DSM_Int=DSM_dQ;"
     744                        string DataSubTypeQvec = StringByKey(DataSubTypeInt, QvecLookup,"=",";")
     745                        string DataSubTypeError = StringByKey(DataSubTypeInt, ErrorLookup,"=",";")
     746                        string DataSubTypedQ = StringByKey(DataSubTypeInt, dQLookup,"=",";")
     747                        IntensityWaveName = DataSubTypeInt
     748                        QWavename = QvecLookup
     749                        ErrorWaveName = ErrorLookup
     750                        dQWavename = dQLookup
    686751                endif
    687752                Wave/Z SourceIntWv=$(DataFolderName+IntensityWaveName)
     
    689754                Wave/Z SourceErrorWv=$(DataFolderName+ErrorWaveName)
    690755                Wave/Z SourcedQWv=$(DataFolderName+dQWavename)
    691                 if(!WaveExists(SourceIntWv)||   !WaveExists(SourceQWv)||!WaveExists(SourceErrorWv))
    692                         Abort "Data selection failed for Data 1"
     756                if(!WaveExists(SourceIntWv)||   !WaveExists(SourceQWv))
     757                        print "Data selection failed for "+DataFolderName
     758                        return 0
    693759                endif
    694760                Duplicate/O SourceIntWv, OriginalDataIntWave
    695761                Duplicate/O SourceQWv, OriginalDataQWave
    696                 Duplicate/O SourceErrorWv, OriginalDataErrorWave
     762                if(WaveExists(SourceErrorWv))
     763                        Duplicate/O SourceErrorWv, OriginalDataErrorWave
     764                else
     765                        Duplicate/O OriginalDataIntWave, OriginalDataErrorWave
     766                        Wave OriginalDataErrorWave
     767                        OriginalDataErrorWave = 0
     768                endif
    697769                if(WaveExists(SourcedQWv))
    698770                        Duplicate/O SourcedQWv, OriginalDatadQWave
     
    700772                        dQWavename=""
    701773                endif
    702                 IR3L_AppendDataToGraphLogLog()
    703                 IR3L_CreateLinearizedData()
    704                 IR3L_AppendDataToGraphModel()
    705 //              IR3D_PresetOutputStrings()
    706 //              Wave/Z ResultIntensity = root:Packages:Irena:SASDataMerging:ResultIntensity
    707 //              if(WaveExists(ResultIntensity))
    708 //                      ResultIntensity= NaN
    709 //              endif
     774                IR3J_AppendDataToGraphLogLog()
     775                IR3J_CreateLinearizedData()
     776                IR3J_AppendDataToGraphModel()
    710777                print "Added Data from folder : "+DataFolderName
    711778        SetDataFolder oldDf
    712 end
    713 //**********************************************************************************************************
    714 //**********************************************************************************************************
    715 //**********************************************************************************************************
    716 Function IR3L_CreateLinearizedData()
     779        return 1
     780end
     781//**********************************************************************************************************
     782//**********************************************************************************************************
     783//**********************************************************************************************************
     784Function IR3J_CreateLinearizedData()
    717785
    718786        string oldDf=GetDataFolder(1)
    719         SetDataFolder root:Packages:Irena:SimpleFits                                    //go into the folder
    720         Wave OriginalDataIntWave=root:Packages:Irena:SimpleFits:OriginalDataIntWave
    721         Wave OriginalDataQWave=root:Packages:Irena:SimpleFits:OriginalDataQWave
    722         Wave OriginalDataErrorWave=root:Packages:Irena:SimpleFits:OriginalDataErrorWave
    723         SVAR SimpleModel=root:Packages:Irena:SimpleFits:SimpleModel
     787        SetDataFolder root:Packages:Irena:MultiSaPlotFit                                        //go into the folder
     788        Wave OriginalDataIntWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataIntWave
     789        Wave OriginalDataQWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataQWave
     790        Wave OriginalDataErrorWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataErrorWave
     791        SVAR SimpleModel=root:Packages:Irena:MultiSaPlotFit:SimpleModel
    724792        Duplicate/O OriginalDataIntWave, LinModelDataIntWave, ModelNormalizedResidual
    725793        Duplicate/O OriginalDataQWave, LinModelDataQWave, ModelNormResXWave
     
    741809
    742810
    743 Function IR3L_AppendDataToGraphModel()
    744        
    745         DoWindow IR3L_SimpleFitsPanel
     811Function IR3J_AppendDataToGraphModel()
     812       
     813        DoWindow IR3J_MultiSaPlotFitPanel
    746814        if(!V_Flag)
    747815                return 0
     
    754822//      Duplicate/O OriginalDataErrorWave, LinModelDataEWave
    755823
    756         Wave LinModelDataIntWave=root:Packages:Irena:SimpleFits:LinModelDataIntWave
    757         Wave LinModelDataQWave=root:Packages:Irena:SimpleFits:LinModelDataQWave
    758         Wave LinModelDataEWave=root:Packages:Irena:SimpleFits:LinModelDataEWave
    759         CheckDisplayed /W=IR3L_SimpleFitsPanel#LogLogDataDisplay LinModelDataIntWave
     824        Wave LinModelDataIntWave=root:Packages:Irena:MultiSaPlotFit:LinModelDataIntWave
     825        Wave LinModelDataQWave=root:Packages:Irena:MultiSaPlotFit:LinModelDataQWave
     826        Wave LinModelDataEWave=root:Packages:Irena:MultiSaPlotFit:LinModelDataEWave
     827        CheckDisplayed /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay LinModelDataIntWave
    760828        if(!V_flag)
    761                 AppendToGraph /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay  LinModelDataIntWave  vs LinModelDataQWave
    762                 ModifyGraph /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay log=1, mirror(bottom)=1
    763                 Label /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay left "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Intensity"
    764                 Label /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay bottom "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Q [A\\S-1\\M]"
    765                 ErrorBars /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay LinModelDataIntWave Y,wave=(LinModelDataEWave,LinModelDataEWave)               
    766         endif
    767 //      NVAR DataQEnd = root:Packages:Irena:SimpleFits:DataQEnd
     829                AppendToGraph /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay  LinModelDataIntWave  vs LinModelDataQWave
     830                ModifyGraph /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay log=1, mirror(bottom)=1
     831                Label /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay left "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Intensity"
     832                Label /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay bottom "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Q [A\\S-1\\M]"
     833                ErrorBars /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay LinModelDataIntWave Y,wave=(LinModelDataEWave,LinModelDataEWave)           
     834        endif
     835//      NVAR DataQEnd = root:Packages:Irena:MultiSaPlotFit:DataQEnd
    768836//      if(DataQEnd>0)                  //old Q max already set.
    769837//              endQp = BinarySearch(OriginalDataQWave, DataQEnd)
     
    773841//              endQp = numpnts(OriginalDataQWave)-2
    774842//      endif
    775 //      cursor /W=IR3L_SimpleFitsPanel#LogLogDataDisplay B, OriginalDataIntWave, endQp
     843//      cursor /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay B, OriginalDataIntWave, endQp
    776844        DoUpdate
    777845
    778         Wave/Z ModelNormalizedResidual=root:Packages:Irena:SimpleFits:ModelNormalizedResidual
    779         Wave/Z ModelNormResXWave=root:Packages:Irena:SimpleFits:ModelNormResXWave
    780         CheckDisplayed /W=IR3L_SimpleFitsPanel#ResidualDataDisplay ModelNormalizedResidual  //, ResultIntensity
     846        Wave/Z ModelNormalizedResidual=root:Packages:Irena:MultiSaPlotFit:ModelNormalizedResidual
     847        Wave/Z ModelNormResXWave=root:Packages:Irena:MultiSaPlotFit:ModelNormResXWave
     848        CheckDisplayed /W=IR3J_MultiSaPlotFitPanel#ResidualDataDisplay ModelNormalizedResidual  //, ResultIntensity
    781849        if(!V_flag)
    782                 AppendToGraph /W=IR3L_SimpleFitsPanel#ResidualDataDisplay  ModelNormalizedResidual  vs ModelNormResXWave
    783                 ModifyGraph /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay log=1, mirror(bottom)=1
    784                 Label /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay left "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Normalized res."
    785                 Label /W=IR3L_SimpleFitsPanel#LinearizedDataDisplay bottom "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Q [A\\S-1\\M]"
     850                AppendToGraph /W=IR3J_MultiSaPlotFitPanel#ResidualDataDisplay  ModelNormalizedResidual  vs ModelNormResXWave
     851                ModifyGraph /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay log=1, mirror(bottom)=1
     852                Label /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay left "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Normalized res."
     853                Label /W=IR3J_MultiSaPlotFitPanel#LinearizedDataDisplay bottom "\\Z"+IN2G_LkUpDfltVar("AxisLabelSize")+"Q [A\\S-1\\M]"
    786854        endif
    787855
     
    792860        switch(V_Flag)  // numeric switch
    793861                case 0:         // execute if case matches expression
    794                         Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /N=text0/K
     862                        Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /N=text0/K
    795863                        break                                           // exit from switch
    796864//              case 1:         // execute if case matches expression
    797 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     865//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    798866//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    799 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1
     867//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1
    800868//                      break
    801869//              case 2:
    802 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     870//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    803871//                      Shortname2 = StringFromList(ItemsInList(DataFolderName2, ":")-1, DataFolderName2  ,":")
    804 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData2IntWave) " + Shortname2             
     872//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData2IntWave) " + Shortname2         
    805873//                      break
    806874//              case 3:
    807 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     875//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    808876//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    809 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2
     877//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2
    810878//                      break
    811879//              case 7:
    812 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     880//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    813881//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    814 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2+"\r\\s(ResultIntensity) Merged Data"
     882//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2+"\r\\s(ResultIntensity) Merged Data"
    815883                        break
    816884        endswitch
     
    823891
    824892
    825 Function IR3L_AppendDataToGraphLogLog()
    826        
    827         DoWindow IR3L_SimpleFitsPanel
     893Function IR3J_AppendDataToGraphLogLog()
     894       
     895        DoWindow IR3J_MultiSaPlotFitPanel
    828896        if(!V_Flag)
    829897                return 0
     
    831899        variable WhichLegend=0
    832900        variable startQp, endQp, tmpStQ
    833         Wave OriginalDataIntWave=root:Packages:Irena:SimpleFits:OriginalDataIntWave
    834         Wave OriginalDataQWave=root:Packages:Irena:SimpleFits:OriginalDataQWave
    835         Wave OriginalDataErrorWave=root:Packages:Irena:SimpleFits:OriginalDataErrorWave
    836         CheckDisplayed /W=IR3L_SimpleFitsPanel#LogLogDataDisplay OriginalDataIntWave
     901        Wave OriginalDataIntWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataIntWave
     902        Wave OriginalDataQWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataQWave
     903        Wave OriginalDataErrorWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataErrorWave
     904        CheckDisplayed /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay OriginalDataIntWave
    837905        if(!V_flag)
    838                 AppendToGraph /W=IR3L_SimpleFitsPanel#LogLogDataDisplay  OriginalDataIntWave  vs OriginalDataQWave
    839                 ModifyGraph /W=IR3L_SimpleFitsPanel#LogLogDataDisplay log=1, mirror(bottom)=1
    840                 Label /W=IR3L_SimpleFitsPanel#LogLogDataDisplay left "Intensity 1"
    841                 Label /W=IR3L_SimpleFitsPanel#LogLogDataDisplay bottom "Q [A\\S-1\\M]"
    842                 ErrorBars /W=IR3L_SimpleFitsPanel#LogLogDataDisplay OriginalDataIntWave Y,wave=(OriginalDataErrorWave,OriginalDataErrorWave)           
    843         endif
    844         NVAR DataQEnd = root:Packages:Irena:SimpleFits:DataQEnd
     906                AppendToGraph /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay  OriginalDataIntWave  vs OriginalDataQWave
     907                ModifyGraph /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay log=1, mirror(bottom)=1
     908                Label /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay left "Intensity 1"
     909                Label /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay bottom "Q [A\\S-1\\M]"
     910                ErrorBars /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay OriginalDataIntWave Y,wave=(OriginalDataErrorWave,OriginalDataErrorWave)               
     911        endif
     912        NVAR DataQEnd = root:Packages:Irena:MultiSaPlotFit:DataQEnd
    845913        if(DataQEnd>0)                  //old Q max already set.
    846914                endQp = BinarySearch(OriginalDataQWave, DataQEnd)
     
    850918                endQp = numpnts(OriginalDataQWave)-2
    851919        endif
    852         cursor /W=IR3L_SimpleFitsPanel#LogLogDataDisplay B, OriginalDataIntWave, endQp
     920        cursor /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay B, OriginalDataIntWave, endQp
    853921        DoUpdate
    854922
    855         Wave/Z OriginalDataIntWave=root:Packages:Irena:SimpleFits:OriginalDataIntWave
    856         CheckDisplayed /W=IR3L_SimpleFitsPanel#LogLogDataDisplay OriginalDataIntWave  //, ResultIntensity
     923        Wave/Z OriginalDataIntWave=root:Packages:Irena:MultiSaPlotFit:OriginalDataIntWave
     924        CheckDisplayed /W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay OriginalDataIntWave  //, ResultIntensity
    857925        string Shortname1, ShortName2
    858926       
    859927        switch(V_Flag)  // numeric switch
    860928                case 0:         // execute if case matches expression
    861                         Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /N=text0/K
     929                        Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /N=text0/K
    862930                        break                                           // exit from switch
    863931//              case 1:         // execute if case matches expression
    864 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     932//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    865933//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    866 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1
     934//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1
    867935//                      break
    868936//              case 2:
    869 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     937//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    870938//                      Shortname2 = StringFromList(ItemsInList(DataFolderName2, ":")-1, DataFolderName2  ,":")
    871 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData2IntWave) " + Shortname2             
     939//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData2IntWave) " + Shortname2         
    872940//                      break
    873941//              case 3:
    874 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     942//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    875943//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    876 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2
     944//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2
    877945//                      break
    878946//              case 7:
    879 //                      SVAR DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     947//                      SVAR DataFolderName=root:Packages:Irena:MultiSaPlotFit:DataFolderName
    880948//                      Shortname1 = StringFromList(ItemsInList(DataFolderName1, ":")-1, DataFolderName1  ,":")
    881 //                      Legend/W=IR3L_SimpleFitsPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2+"\r\\s(ResultIntensity) Merged Data"
     949//                      Legend/W=IR3J_MultiSaPlotFitPanel#LogLogDataDisplay /C/N=text0/J/A=LB "\\s(OriginalData1IntWave) "+Shortname1+"\r\\s(OriginalData2IntWave) "+Shortname2+"\r\\s(ResultIntensity) Merged Data"
    882950                        break
    883951        endswitch
  • trunk/User Procedures/Irena/Modification history.txt

    r856 r857  
    13132.691 (beta)
    1414Fractals - added optional use of Unified Fit Sphere form factor. This removes high-q Bessel function oscillations which are nto reasonable for most cases.
     15Added Multi Data Plot tool, new tool to plot quickly many data sets. New ipf file...
    1516
    1617
Note: See TracChangeset for help on using the changeset viewer.