Changeset 940


Ignore:
Timestamp:
May 21, 2020 10:01:33 AM (2 years ago)
Author:
ilavsky
Message:

Bug fixes, Igor 9 testing and associated bug fixes

Location:
trunk/User Procedures
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Indra 2/IN2_GeneralProcedures.ipf

    r939 r940  
    544544        endif
    545545        //check for wave type, need numerical waves ...
    546         if(WaveType($(SelectedWaveNm1),1)!=1 || WaveType($(SelectedWaveNm2),1)!=1)              //not text wave, bail out...
     546        if(WaveType($(SelectedWaveNm1),1)!=1 || WaveType($(SelectedWaveNm2),1)!=1)              //not numerical waves, bail out...
    547547                        return 0
    548548        endif
    549549        Wave/Z Wave1 = $(SelectedWaveNm1)
    550550        Wave/Z Wave2 = $(SelectedWaveNm2)
    551         Display Wave1 vs Wave2
     551        if(WaveExists(Wave1) && WaveExists(Wave2))
     552                Variable keys = GetKeyState(0)
     553                if (keys == 0)
     554                        Display/K=1 Wave1 vs Wave2 as NameofWave(Wave1)+" vs "+NameofWave(Wave2)
     555                        Label left (NameofWave(Wave1))
     556                        Label bottom (NameofWave(Wave2))
     557                else
     558                        Display/K=1 Wave2 vs Wave1 as NameofWave(Wave2)+" vs "+NameofWave(Wave1)
     559                        Label left (NameofWave(Wave2))
     560                        Label bottom (NameofWave(Wave1))
     561                endif
     562        else
     563                return 0
     564        endif
     565        return 1
    552566end
    553567
     
    12651279        String abortMessage     //HR Used if we have to abort because of an unexpected error
    12661280        DFref oldDf= GetDataFolderDFR()
    1267 
     1281        //if PathStr="", we get weird errros on Igor 9
     1282        //print PathStr
    12681283        //create location for the results waves...
    12691284        NewDataFolder/O/S root:Packages
     
    13301345                                //HR Recurse only if S_aliasPath points to a folder. I don't really know what I'm doing here but this seems like it will prevent the infinite loop.
    13311346                                GetFileFolderInfo/Z/Q/P=tempPath S_aliasPath   
    1332                                 isItXOP = IamOnMac * stringmatch(S_aliasPath, "*xop*" )
     1347                                isItXOP = IamOnMac * stringmatch(S_Path, "*xop*" )
    13331348                                if (V_flag==0 && V_isFolder&&!isItXOP)          //this is folder, so all items in the folder are included... Except XOP is folder too...
    1334                                         IN2G_ListProcFiles(S_aliasPath, 0)
     1349                                        IN2G_ListProcFiles(S_Path, 0)
    13351350                                elseif(V_flag==0 && (!V_isFolder || isItXOP))   //this is link to file. Need to include the info on the file...
    13361351                                        //*************
    13371352                                        Redimension/N=(numpnts(FileNames)+1) FileNames, PathToFiles,FileVersions
    1338                                         tempFileName =stringFromList(ItemsInList(S_aliasPath,":")-1, S_aliasPath,":")
    1339                                         tempPathStr = RemoveFromList(tempFileName, S_aliasPath,":")
     1353                                        tempFileName =stringFromList(ItemsInList(S_Path,":")-1, S_Path,":")
     1354                                        tempPathStr = RemoveFromList(tempFileName, S_Path,":")
    13401355                                        FileNames[numpnts(FileNames)] = tempFileName
    13411356                                        PathToFiles[numpnts(FileNames)] = tempPathStr
  • trunk/User Procedures/Irena/IR1_FormFactors.ipf

    r893 r940  
    16921692        variable start
    16931693        variable Imax=numpnts(D_Distribution)
     1694        if(Imax==1)
     1695                return D_Distribution[0]
     1696        endif
    16941697       
    16951698        if (i==0)
     
    17191722        variable endL
    17201723        variable Imax=numpnts(D_distribution)
     1724        if(Imax==1)
     1725                return D_Distribution[0]
     1726        endif
    17211727       
    17221728        if (i==0)
  • trunk/User Procedures/Irena/IR1_Main.ipf

    r938 r940  
    179179                End
    180180        "---"
    181         "Basic+Simple Analysis", IR3J_SimpleFits()
     181        "Basic Fits+Simple Analysis", IR3J_SimpleFits()
    182182        help={"Quick and simple fitting of multiple SAS or results data. Guinier, Porod, Sphere and Spheroid. "}
    183183        "Unified Fit", IR1A_UnifiedModel()
  • trunk/User Procedures/Irena/IR2_PanelCntrlProcs.ipf

    r930 r940  
    34873487                        SVAR ControlMouseDownFunction = root:Packages:IrenaControlProcs:ControlMouseDownFunction
    34883488                        ControlMouseDownFunctionName=StringByKey(WinNameStr, ControlMouseDownFunction,":",";" )
     3489                        if(numpnts(listWave)<(row+1))
     3490                                return 0
     3491                        endif           
    34893492                        FoldernameStr=listWave[row]
    34903493                        if(strlen(ControlMouseDownFunctionName)>0)
  • trunk/User Procedures/Irena/IR3_MultiDataPlot.ipf

    r935 r940  
    141141
    142142        SetVariable XAxisLegend,pos={260,300},size={160,15}, proc=IR3L_SetVarProc,title=" "
    143         Setvariable XAxisLegend,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:XAxisLegend, help={"Legend for X axis, you can change it. "}
     143        Setvariable XAxisLegend, fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:XAxisLegend, help={"Legend for X axis, you can change it. "}
    144144        SetVariable YAxislegend,pos={430,300},size={160,15}, proc=IR3L_SetVarProc,title=" "
    145         Setvariable YAxislegend,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:YAxislegend, help={"legend for Y axis. You can change it. "}
     145        Setvariable YAxislegend, fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:YAxislegend, help={"legend for Y axis. You can change it. "}
    146146       
    147147        Checkbox LogXAxis, pos={280,320},size={76,14},title="LogXAxis?", proc=IR3L_CheckProc, variable=root:Packages:Irena:MultiSamplePlot:LogXAxis, help={"Use log X axis. You can change it. "}
     
    149149
    150150        SetVariable XOffset,pos={260,340},size={130,15}, proc=IR3L_SetVarProc,title="X offset :     ", limits={0,inf,1}
    151         Setvariable XOffset,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:XOffset, help={"X Offxet for X axis, you can change it. "}
     151        Setvariable XOffset, fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:XOffset, help={"X Offxet for X axis, you can change it. "}
    152152        SetVariable YOffset,pos={430,340},size={130,15}, proc=IR3L_SetVarProc,title="Y offset :     ",limits={0,inf,1}
    153         Setvariable YOffset,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:YOffset, help={"Y Offset for Y axis. You can change it. "}
     153        Setvariable YOffset, fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:YOffset, help={"Y Offset for Y axis. You can change it. "}
    154154
    155155
     
    167167        PopupMenu SymbolSize,value="0;1;2;3;5;7;10;",mode=1, popvalue=num2str(SymbolSize)
    168168        SetVariable LineThickness,pos={430,500},size={160,15}, proc=IR3L_SetVarProc,title="Line Thickness",limits={0.5,10,0.5}
    169         Setvariable LineThickness,fSize=10,fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:LineThickness, help={"Line Thickness. You can change it. "}
     169        Setvariable LineThickness, fStyle=2, variable=root:Packages:Irena:MultiSamplePlot:LineThickness, help={"Line Thickness. You can change it. "}
    170170
    171171
     
    880880        variable i
    881881        string FoldernameStr
    882         SVAR GraphUserTitle=root:Packages:Irena:MultiSamplePlot:GraphUserTitle
    883         SVAR GraphWindowName=root:Packages:Irena:MultiSamplePlot:GraphWindowName
    884882        switch( ba.eventCode )
    885883                case 2: // mouse up
     884                        SVAR GraphUserTitle=root:Packages:Irena:MultiSamplePlot:GraphUserTitle
     885                        SVAR GraphWindowName=root:Packages:Irena:MultiSamplePlot:GraphWindowName
    886886                        // click code here
    887887                        if(stringmatch(ba.ctrlname,"NewGraphPlotData"))
  • trunk/User Procedures/Irena/IR3_SimpleFits.ipf

    r939 r940  
    102102        //hide what is not needed
    103103        checkbox UseResults, disable=0
    104         SetVariable DataQEnd,pos={290,90},size={170,15}, proc=IR3J_SetVarProc,title="Q max for fitting    "
     104        SetVariable DataQEnd,pos={290,90},size={190,15}, proc=IR3J_SetVarProc,title="Q max for fitting    "
    105105        Setvariable DataQEnd, variable=root:Packages:Irena:SimpleFits:DataQEnd, limits={-inf,inf,0}
    106         SetVariable DataQstart,pos={290,110},size={170,15}, proc=IR3J_SetVarProc,title="Q min for fitting     "
     106        SetVariable DataQstart,pos={290,110},size={190,15}, proc=IR3J_SetVarProc,title="Q min for fitting     "
    107107        Setvariable DataQstart, variable=root:Packages:Irena:SimpleFits:DataQstart, limits={-inf,inf,0}
    108         SetVariable DataBackground,pos={280,130},size={170,15}, proc=IR3J_SetVarProc,title="Background    "
    109         Setvariable DataBackground, variable=root:Packages:Irena:SimpleFits:DataBackground, limits={-inf,inf,0}
     108        SetVariable DataFolderName,noproc,title=" ",pos={250,140},size={270,17},frame=0, fstyle=1,valueColor=(0,0,65535)
     109        Setvariable DataFolderName, variable=root:Packages:Irena:SimpleFits:DataFolderName, noedit=1
     110
     111
    110112
    111113        Button SelectAll,pos={200,680},size={80,15}, proc=IR3J_ButtonProc,title="SelectAll", help={"Select All data in Listbox"}
     
    123125        Setvariable Guinier_Rg, variable=root:Packages:Irena:SimpleFits:Guinier_Rg, limits={3,inf,0}, help={"Guinier Rg value"}
    124126        //Porod
    125         SetVariable Porod_Constant,pos={240,230},size={220,15}, proc=IR3J_SetVarProc,title="Porod Con. [cm2/cm3/A^4] ", bodywidth=80
     127        SetVariable Porod_Constant,pos={290,230},size={220,15}, proc=IR3J_SetVarProc,title="Porod Con. [cm2/cm3/A^4] ", bodywidth=80
    126128        Setvariable Porod_Constant, variable=root:Packages:Irena:SimpleFits:Porod_Constant, limits={1e-20,inf,0}, help={"Porod constant"}
    127         SetVariable ScatteringContrast,pos={240,260},size={220,15}, proc=IR3J_SetVarProc,title="Contrast [10^20 cm^-4]", bodywidth=80
     129        SetVariable ScatteringContrast,pos={290,260},size={220,15}, proc=IR3J_SetVarProc,title="Contrast [10^20 cm^-4]", bodywidth=80
    128130        Setvariable ScatteringContrast, variable=root:Packages:Irena:SimpleFits:ScatteringContrast, limits={1,inf,0}, help={"Scattering Contrast for the scatterers"}
    129         SetVariable Porod_SpecificSurface,pos={240,290},size={220,15}, proc=IR3J_SetVarProc,title="Spec. Sfc area [cm2/cm3]", bodywidth=80, limits={0,inf,0}
     131        SetVariable Porod_SpecificSurface,pos={290,290},size={220,15}, proc=IR3J_SetVarProc,title="Spec. Sfc area [cm2/cm3]", bodywidth=80, limits={0,inf,0}
    130132        Setvariable Porod_SpecificSurface, variable=root:Packages:Irena:SimpleFits:Porod_SpecificSurface, disable=0, noedit=1, help={"Porod constant"}
    131133        //Sphere controls
     
    754756                                IR3J_SaveResultsToNotebook()
    755757                                IR3J_SaveResultsToWaves()
     758                                IR3J_CleanUnusedParamWaves()
    756759                                IR3J_SaveResultsToFolder()
    757760                        endif
     
    794797//      SetActiveSubwindow ##
    795798//**********************************************************************************************************
    796 //**********************************************************************************************************
     799static Function IR3J_CleanUnusedParamWaves()
     800
     801        Wave/Z TimeWave
     802        if(sum(TimeWave)<=0 || numtype(sum(TimeWave))!=0)
     803                KillWaves/Z  TimeWave
     804        endif
     805        Wave/Z TemperatureWave
     806        if(sum(TemperatureWave)<=0 || numtype(sum(TemperatureWave))!=0)
     807                KillWaves/Z  TemperatureWave
     808        endif
     809        Wave/Z PercentWave
     810        if(sum(PercentWave)<=0|| numtype(sum(PercentWave))!=0)
     811                KillWaves/Z  PercentWave
     812        endif
     813        Wave/Z OrderWave
     814        if(sum(OrderWave)<=0|| numtype(sum(OrderWave))!=0)
     815                KillWaves/Z  OrderWave
     816        endif
     817
     818end
     819//
     820////**********************************************************************************************************
    797821//**********************************************************************************************************
    798822
     
    883907                        endif
    884908                endfor
     909                IR3J_CleanUnusedParamWaves()
    885910                print "all selected data processed"
    886911end
     
    894919        Variable hookResult = 0
    895920
    896         switch(s.eventCode)
     921        switch(s.eventCode) 
    897922                case 0:                         // Activate
    898923                        // Handle activate
     
    16681693
    16691694        IN2G_PrintDebugStatement(IrenaDebugLevel, 5,"")
     1695        NVAR SaveToNotebook=root:Packages:Irena:SimpleFits:SaveToNotebook
     1696        NVAR SaveToWaves=root:Packages:Irena:SimpleFits:SaveToWaves
     1697        NVAR SaveToFolder=root:Packages:Irena:SimpleFits:SaveToFolder
     1698        if(!SaveToNotebook)
     1699                return 0
     1700        endif   
    16701701        IR1_CreateResultsNbk()
    16711702        DFref oldDf= GetDataFolderDFR()
     
    16911722        NVAR DataBackground                     =root:Packages:Irena:SimpleFits:DataBackground
    16921723        SVAR SimpleModel                                = root:Packages:Irena:SimpleFits:SimpleModel
    1693         NVAR SaveToNotebook=root:Packages:Irena:SimpleFits:SaveToNotebook
    1694         NVAR SaveToWaves=root:Packages:Irena:SimpleFits:SaveToWaves
    1695         NVAR SaveToFolder=root:Packages:Irena:SimpleFits:SaveToFolder
    16961724        NVAR VOlSD_Rg                                   =root:Packages:Irena:SimpleFits:VOlSD_Rg
    16971725        NVAR VolSD_Volume                               =root:Packages:Irena:SimpleFits:VolSD_Volume
     
    17041732        NVAR NumSD_ModeDiamater         =root:Packages:Irena:SimpleFits:NumSD_ModeDiamater
    17051733
    1706         if(!SaveToNotebook)
    1707                 return 0
    1708         endif   
    17091734        Wave/Z ModelInt = root:Packages:Irena:SimpleFits:ModelLogLogInt
    17101735        Wave/Z ModelQ = root:Packages:Irena:SimpleFits:ModelLogLogQ
     
    19081933        IN2G_PrintDebugStatement(IrenaDebugLevel, 5,"")
    19091934        DFref oldDf= GetDataFolderDFR()
     1935        NVAR SaveToNotebook=root:Packages:Irena:SimpleFits:SaveToNotebook
     1936        NVAR SaveToWaves=root:Packages:Irena:SimpleFits:SaveToWaves
     1937        NVAR SaveToFolder=root:Packages:Irena:SimpleFits:SaveToFolder
     1938        if(!SaveToWaves)
     1939                return 0
     1940        endif
    19101941        SetDataFolder root:Packages:Irena:SimpleFits                                                            //go into the folder
    19111942        SVAR  DataFolderName=root:Packages:Irena:SimpleFits:DataFolderName
     
    19401971        NVAR NumSD_MedianDiameter       =root:Packages:Irena:SimpleFits:NumSD_MedianDiameter
    19411972        NVAR NumSD_ModeDiamater         =root:Packages:Irena:SimpleFits:NumSD_ModeDiamater
    1942         NVAR SaveToNotebook=root:Packages:Irena:SimpleFits:SaveToNotebook
    1943         NVAR SaveToWaves=root:Packages:Irena:SimpleFits:SaveToWaves
    1944         NVAR SaveToFolder=root:Packages:Irena:SimpleFits:SaveToFolder
    1945         if(!SaveToWaves)
    1946                 return 0
    1947         endif   
    19481973        Wave/Z ModelInt = root:Packages:Irena:SimpleFits:ModelLogLogInt
    19491974        Wave/Z ModelQ = root:Packages:Irena:SimpleFits:ModelLogLogQ
     
    20282053                Wave/Z PorodConstant
    20292054                if(!WaveExists(PorodConstant))
    2030                         make/O/N=0 PorodConstant, PorodBackground, PorodQmin, PorodQmax, PorodChiSquare, TimeWave, TemperatureWave, PercentWave, OrderWave,ScatteringContrastWave, PorodSpecificSurfaceWave
     2055                        make/O/N=0 PorodConstant, PorodBackground, PorodQmin, PorodQmax, PorodChiSquare, TimeWave, TemperatureWave, PercentWave, OrderWave, ScatteringContrastWave, PorodSpecificSurfaceWave
    20312056                        make/O/N=0/T SampleName
    20322057                        SetScale/P x 0,1,"1/cm 1/A^4", PorodConstant                    //Unified fit GUI source
     
    20342059                endif
    20352060                curlength = numpnts(PorodConstant)
    2036                 redimension/N=(curlength+1) SampleName,PorodConstant, PorodBackground, PorodQmin, PorodQmax, PorodChiSquare, TimeWave, TemperatureWave, PercentWave, OrderWave, ScatteringContrastWave, PorodSpecificSurfaceWave
     2061                redimension/N=(curlength+1) SampleName, PorodConstant, PorodBackground, PorodQmin, PorodQmax, PorodChiSquare, TimeWave, TemperatureWave, PercentWave, OrderWave, ScatteringContrastWave, PorodSpecificSurfaceWave
    20372062                SampleName[curlength] = DataFolderName
    20382063                TimeWave[curlength]                             =       IN2G_IdentifyNameComponent(DataFolderName, "_xyzmin")
     
    21442169
    21452170                //IR3J_GetTableWithresults()
    2146         endif
    2147         if(sum(TimeWave)<=0 || numtype(sum(TimeWave))!=0)
    2148                 KillWaves/Z  TimeWave
    2149         endif
    2150         if(sum(TemperatureWave)<=0 || numtype(sum(TemperatureWave))!=0)
    2151                 KillWaves/Z  TemperatureWave
    2152         endif
    2153         if(sum(PercentWave)<=0|| numtype(sum(PercentWave))!=0)
    2154                 KillWaves/Z  PercentWave
    2155         endif
    2156         if(sum(OrderWave)<=0|| numtype(sum(OrderWave))!=0)
    2157                 KillWaves/Z  OrderWave
    21582171        endif
    21592172       
Note: See TracChangeset for help on using the changeset viewer.