Changeset 954


Ignore:
Timestamp:
May 30, 2020 9:33:57 PM (2 years ago)
Author:
ilavsky
Message:

Add samrt blank selection for USAXS, add sorting by _xyzs (as in seconds) for Multi Sample selection tool.

Location:
trunk/User Procedures
Files:
4 edited

Legend:

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

    r942 r954  
    22#pragma rtGlobals=3                     // Use modern global access method.
    33//#pragma rtGlobals=1           // Use modern global access method.
    4 #pragma version=1.41
     4#pragma version=1.42
    55
    66//*************************************************************************\
     
    1010//*************************************************************************/
    1111
     12//1.42 added IN3_SmartBlankSelection(DataFolderName) to automatically select Blank measured before the current sample.
    1213//1.41 added some fudge factor for Qmin search and MSAXS handling. And change the logic so one can understand, what is happening.
    1314//1.40 added automatci location of the Qmin where data start due to Int Sa/Bl ratio.
     
    134135                        endif
    135136                        IN3_LoadData()          //load data in the tool.
     137                        IN3_SmartBlankSelection(DataFolderName)
    136138                        IN3_LoadBlank()
    137139                        IN3_SetPDParameters()
     
    177179                endif
    178180                IN3_LoadData()          //load data in the tool.
     181                IN3_SmartBlankSelection(DataFolderName)
    179182                IN3_LoadBlank()
    180183                IN3_SetPDParameters()
     
    264267//***********************************************************************************************************************************
    265268//***********************************************************************************************************************************
    266 //***********************************************************************************************************************************
     269Function IN3_SmartBlankSelection(DataFolderName)
     270        string DataFolderName
     271
     272        NVAR/Z SmartSelectBlank = root:Packages:Indra3:SmartSelectBlank
     273        if(!NVAR_Exists(SmartSelectBlank))
     274                variable/g root:Packages:Indra3:SmartSelectBlank
     275                NVAR SmartSelectBlank = root:Packages:Indra3:SmartSelectBlank
     276                SmartSelectBlank = 0
     277        endif
     278        if(SmartSelectBlank)
     279                variable DataOrderNum=IN2G_FindNumIndxForSort(DataFolderName)
     280                if(DataOrderNum>0)                      //found order number
     281                        string AllBlanks=IN3_GenStringOfFolders(1)
     282                        //smart number 1... Nearest to the scan number, preferably one before.
     283                        Wave/T AllBlanksWave = ListToTextWave(AllBlanks, ";")
     284                        make/Free/N=(numpnts(AllBlanksWave)) BlankOrderNumbers
     285                        BlankOrderNumbers = IN2G_FindNumIndxForSort(AllBlanksWave[p])
     286                        Sort BlankOrderNumbers, BlankOrderNumbers, AllBlanksWave
     287                        variable MatchON = BinarySearch(BlankOrderNumbers,DataOrderNum)
     288                        if(MatchON<0)
     289                                MatchON = 0
     290                        endif
     291                        String BestBlankName = AllBlanksWave[MatchON]
     292                        //this si what we need to select...
     293                        SVAR BlankName = root:Packages:Indra3:BlankName
     294                        BlankName = BestBlankName
     295                        PopupMenu SelectBlankFolder win=USAXSDataReduction, popmatch=BlankName
     296                        TitleBox SelectBlankFolderWarning win=USAXSDataReduction, disable=0
     297                endif
     298        endif
     299end//***********************************************************************************************************************************
    267300//***********************************************************************************************************************************
    268301
  • trunk/User Procedures/Indra 2/IN3_Main.ipf

    r942 r954  
    22#pragma rtGlobals=3                     // Use modern global access method.
    33//#pragma rtGlobals=1           // Use modern global access method.
    4 #pragma version = 1.97
     4#pragma version = 1.975
    55#pragma IgorVersion=7.05
    66
     
    1313//*************************************************************************/
    1414
     15//1.975 May2020 beta
    1516//1.97 February 2020, fix GUI for step scanning
    1617        //1.97 add controls if to remove vibrations or not, seems sometimes is not vibrations which causes less points to be recorded...
     
    4041//1.78, 2/2013, JIL: Added option to calibrate by weight. Needed for USAXS users.
    4142
    42 Constant IN3_ReduceDataMainVersionNumber=1.99           //these two needs to be the same!
    43 Constant IN3_NewReduceDataMainVersionNum=1.99   //these two needs to be the same!
     43Constant IN3_ReduceDataMainVersionNumber=2.00           //these two needs to be the same!
     44Constant IN3_NewReduceDataMainVersionNum=2.00           //these two needs to be the same!
    4445constant SmoothBlankForUSAXS = 1
    4546Constant Indra_PDIntBackFixScaleVmin=1.1
     
    182183        PopupMenu SelectBlankFolder, disable = IsBlank
    183184        TitleBox SelectBlankFolderWarning title="\Zr120 Blank auto selected!!",pos={290,292},frame=0,fstyle=1, anchor=MC,size={120,20},fColor=(65535,0,0), disable=1
     185        CheckBox SmartSelectBlank,pos={290,315},size={90,14},noproc,title="Smart select Blank?"
     186        CheckBox SmartSelectBlank,variable= root:Packages:Indra3:SmartSelectBlank, help={"Check, if you want to try to select Blank smartly (using order numbers)"}
    184187
    185188
     
    947950        ListOfVariables+="DesmearData;DesmearNumberOfInterations;DesmearNumPoints;DesmearBckgStart;"
    948951
     952        ListOfVariables+="SmartSelectBlank;"
    949953
    950954        // these are created automatically... "DataFoldername;IntensityWavename;QWavename;ErrorWaveName;"
  • trunk/User Procedures/Indra 2/Readme.txt

    r947 r954  
    1313Modification history:
    1414_____________________________________________________________________________________
    15 1.972 beta
     151.975 beta
    1616Require Igor 8.03 or higher.
     17Added "Smart select Blank" for selection of Blank measured BEFORE the sample measurements.
    1718DataBrowser - Igor 8 - dded Buttons to display w1 vs w2 and extract info from USAXS Folder name strings. Same tools are in Igor 9 right click.
    1819Added for every graph right click option to export as jpg and pxp. Also to duplicate graph (which Igor does on ctrl/cmd-D) but with duplicate of all data in the graph. 1D graphs only.   
  • trunk/User Procedures/Irena/IR2_PanelCntrlProcs.ipf

    r953 r954  
    11#pragma TextEncoding = "UTF-8"
    22#pragma rtGlobals=3                     // Use modern global access method.
    3 #pragma version = 1.60
     3#pragma version = 1.61
    44
    55
     
    1010//*************************************************************************/
    1111
     12//1.61 add to Multi controls sorting by _xyzs as time in seconds.
    1213//1.60 add Multi controls - controls with listbox... For tools needing ability to select multiple data sets.
    1314//                      changed bahavior for generic (no defined data types selected) data. Now, if user selects X, Y, or E wave and in next folder user selects such waves exist,
     
    35843585        endfor         
    35853586        SVAR FolderSortStringAll
    3586         FolderSortStringAll = "Alphabetical;Reverse Alphabetical;_xyz;_xyz.ext;Reverse _xyz;Reverse _xyz.ext;Sxyz_;Reverse Sxyz_;_xyzmin;_xyzC;_xyzpct;_xyz_000;Reverse _xyz_000;_XYZ_xyz;"
     3587        FolderSortStringAll = "Alphabetical;Reverse Alphabetical;_xyz;_xyz.ext;Reverse _xyz;Reverse _xyz.ext;Sxyz_;Reverse Sxyz_;_xyzmin;_xyzC;_xyzpct;_xyz_000;Reverse _xyz_000;_XYZ_xyz;_xyzs;Reverse _xyzs;"
    35873588        SVAR DataSubTypeUSAXSList
    35883589        if(OnlyUSAXSReducedData)
     
    40634064                        Sort TempWv, ListOfAvailableData
    40644065                endif
     4066        elseif(stringMatch(FolderSortString,"_xyzs"))
     4067                Do
     4068                        For(i=0;i<ItemsInList(ListOfAvailableData[j] , "_");i+=1)
     4069                                if(StringMatch(ReplaceString(":", StringFromList(i, ListOfAvailableData[j], "_"),""), "*s" ))
     4070                                        InfoLoc = i
     4071                                        break
     4072                                endif
     4073                        endfor
     4074                        j+=1
     4075                        if(j>(numpnts(ListOfAvailableData)-1))
     4076                                DIDNotFindInfo=1
     4077                                break
     4078                        endif
     4079                while (InfoLoc<1)
     4080                if(DIDNotFindInfo)
     4081                        DoAlert /T="Information not found" 0, "Cannot find location of _xyzs information, sorting alphabetically"
     4082                        Sort /A ListOfAvailableData, ListOfAvailableData
     4083                else
     4084                        For(i=0;i<numpnts(TempWv);i+=1)
     4085                                if(StringMatch(StringFromList(InfoLoc, ListOfAvailableData[i], "_"), "*s*" ))
     4086                                        TempWv[i] = str2num(ReplaceString("s", StringFromList(InfoLoc, ListOfAvailableData[i], "_"), ""))
     4087                                else    //data not found
     4088                                        TempWv[i] = inf
     4089                                endif
     4090                        endfor
     4091                        Sort TempWv, ListOfAvailableData
     4092                endif
     4093        elseif(stringMatch(FolderSortString,"Reverse _xyzs"))
     4094                Do
     4095                        For(i=0;i<ItemsInList(ListOfAvailableData[j] , "_");i+=1)
     4096                                if(StringMatch(ReplaceString(":", StringFromList(i, ListOfAvailableData[j], "_"),""), "*s" ))
     4097                                        InfoLoc = i
     4098                                        break
     4099                                endif
     4100                        endfor
     4101                        j+=1
     4102                        if(j>(numpnts(ListOfAvailableData)-1))
     4103                                DIDNotFindInfo=1
     4104                                break
     4105                        endif
     4106                while (InfoLoc<1)
     4107                if(DIDNotFindInfo)
     4108                        DoAlert /T="Information not found" 0, "Cannot find location of _xyzs information, sorting alphabetically"
     4109                        Sort /A ListOfAvailableData, ListOfAvailableData
     4110                else
     4111                        For(i=0;i<numpnts(TempWv);i+=1)
     4112                                if(StringMatch(StringFromList(InfoLoc, ListOfAvailableData[i], "_"), "*s*" ))
     4113                                        TempWv[i] = str2num(ReplaceString("s", StringFromList(InfoLoc, ListOfAvailableData[i], "_"), ""))
     4114                                else    //data not found
     4115                                        TempWv[i] = inf
     4116                                endif
     4117                        endfor
     4118                        Sort/R TempWv, ListOfAvailableData
     4119                endif
    40654120        elseif(stringMatch(FolderSortString,"_xyz.ext"))
    40664121                For(i=0;i<numpnts(TempWv);i+=1)
Note: See TracChangeset for help on using the changeset viewer.