Changeset 693 for sans/Dev


Ignore:
Timestamp:
Apr 15, 2010 2:25:11 PM (13 years ago)
Author:
srkline
Message:

Corrected the identification of HFIR trans files

Added new includes for analysis and usans, with higher version numbers. the old ones now simply point to the new one. this provides a mechanism for identifying experiments that were generated and saved with an older version of the macros - the old include file will be present. All three packages now display an alert if the experiment was generated from asn old version of the macros.

Location:
sans/Dev/trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf

    r663 r693  
    3434        String itemStr 
    3535                 
    36         if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.02) 
    37                 Abort "Your version of Igor is lower than 6.02, these macros need version 6.02 or higher.... " 
     36        if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.1) 
     37                Abort "Your version of Igor is lower than 6.1, these macros need version 6.1 or higher.... " 
    3838        endif 
    3939         
     
    4848        strswitch(itemStr)      // string switch 
    4949                case "Load NCNR Analysis Macros":        
    50                         Execute/P "INSERTINCLUDE \"SA_Includes_v400\"" 
     50                        Execute/P "INSERTINCLUDE \"SA_Includes_v410\"" 
    5151                        Execute/P "INSERTINCLUDE \"PlotUtilsMacro_v40\"" 
    5252                        Execute/P "INSERTINCLUDE \"GaussUtils_v40\"" 
     
    6767                case "Unload NCNR Analysis Macros":      
    6868                // very dangerous - don't really want to implement this because it will surely crash 
    69                         Execute/P "DELETEINCLUDE \"SA_Includes_v400\"" 
     69                        Execute/P "DELETEINCLUDE \"SA_Includes_v410\"" 
    7070                        Execute/P "DELETEINCLUDE \"PlotUtilsMacro_v40\"" 
    7171                        Execute/P "DELETEINCLUDE \"GaussUtils_v40\"" 
     
    118118        String itemStr 
    119119         
    120         if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.02) 
    121                 Abort "Your version of Igor is lower than 6.02, these macros need version 6.02 or higher.... " 
     120        if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.1) 
     121                Abort "Your version of Igor is lower than 6.1, these macros need version 6.1 or higher.... " 
    122122        endif 
    123123         
     
    189189        String itemStr 
    190190         
    191         if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.02) 
    192                 Abort "Your version of Igor is lower than 6.02, these macros need version 6.02 or higher.... " 
     191        if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.1) 
     192                Abort "Your version of Igor is lower than 6.1, these macros need version 6.1 or higher.... " 
    193193        endif 
    194194         
     
    203203        strswitch(itemStr)      // string switch 
    204204                case "Load NCNR USANS Reduction Macros":         
    205                         Execute/P "INSERTINCLUDE \"USANS_Includes\"" 
     205                        Execute/P "INSERTINCLUDE \"USANS_Includes_v230\"" 
    206206                        Execute/P "COMPILEPROCEDURES " 
    207207                        Execute/P ("ShowUSANSPanel()") 
     
    216216                case "Unload NCNR USANS Reduction Macros":       
    217217                // very dangerous - don't really want to implement this because it will surely crash 
    218                         Execute/P "DELETEINCLUDE \"USANS_Includes\"" 
     218                        Execute/P "DELETEINCLUDE \"USANS_Includes_v230\"" 
    219219                        Execute/P "COMPILEPROCEDURES " 
    220220                        DoWindow USANS_Panel 
     
    274274        String itemStr 
    275275         
    276         if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.02) 
    277                 Abort "Your version of Igor is lower than 6.02, these macros need version 6.02 or higher.... " 
     276        if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.1) 
     277                Abort "Your version of Igor is lower than 6.1, these macros need version 6.1 or higher.... " 
    278278        endif 
    279279         
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r668 r693  
    11#pragma rtGlobals=1             // Use modern global access method. 
    2 #pragma version=4.00 
     2#pragma version=4.10 
    33#pragma IgorVersion=6.1 
    44 
     
    99 
    1010Function Init_WrapperPanel() 
     11 
     12        if(itemsinlist(WinList("SA_includes_v400.ipf", ";","INCLUDE:6"),";") != 0) 
     13                //must be opening a v4.00 or earlier template 
     14                DoAlert 0,"This experiment was created with an old version (v4.0) of the macros. I'll try to make this work, but please start new work with a current version" 
     15        endif 
     16         
    1117        //make sure that folders exist - this is the first initialization to be called 
    1218        NewDataFolder/O root:Packages 
     
    1420 
    1521        //Create useful globals 
    16         Variable/G root:Packages:NIST:SANS_ANA_VERSION=4.00 
     22        Variable/G root:Packages:NIST:SANS_ANA_VERSION=4.10 
    1723        String/G root:Packages:NIST:SANS_ANA_EXTENSION="_v40" 
    1824        //Set this variable to 1 to force use of trapezoidal integration routine for USANS smearing 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/SA_includes_v400.ipf

    r665 r693  
    33#pragma IgorVersion=6.1 
    44 
    5 //************* 
    6 // the list of files to include in the SANS reduction experiment 
    7 //  - files must be located somewhere in the User Procedures folder 
    8 // or sub-folders 
     5 
     6// now simply point to the current version of the includes v410 
     7// -- then if this file is open, I'll know the experiment is "old" 
     8#include "SA_includes_v410" 
     9 
     10////************* 
     11//// the list of files to include in the SANS reduction experiment 
     12////  - files must be located somewhere in the User Procedures folder 
     13//// or sub-folders 
     14//// 
    915// 
    10  
    11 //always include the picker 
    12 #include "SANSModelPicker_v40"                  version>=4.00 
    13 //utility procedures 
    14 #include "GaussUtils_v40"                               version>=4.00 
    15 #include "NIST_XML_V40"                                 //added September 2008 
    16 #include "PlotUtilsMacro_v40"                   version>=4.00 
    17 #include "PlotManager_v40"                              version>=4.00 
    18 #include "NCNR_GenFitUtils"                     // April 2009, compiles OK if XOP not present 
    19 #include "NCNR_Utils" 
    20  
    21 #include "USANS_SlitSmearing_v40" 
    22 #include "WriteModelData_v40" 
    23 #include "Wrapper_v40" 
    24 #include "PlotUtils2D_v40" 
    25 #include "GizmoCylinder_v40" 
    26  
    27 #include "CheckVersionFTP"                              //added June 2008 
    28  
    29 #include "DataSetHandling"                                      //added Nov 2009 AJJ 
    30  
    31 Menu "SANS Models" 
    32         "Fit Manager", Init_WrapperPanel() 
    33         "Load Model Functions",Execute/P "INSERTINCLUDE \"SANSModelPicker_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()" 
    34         "Load and Plot Manager", Show_Plot_Manager() 
    35         "Freeze Model" 
    36         "Write Model Data" 
    37         "ReWrite Experimental Data",ReWrite1DData() 
    38         "1D Arithmetic Panel",MakeDAPanel() 
    39         "-" 
    40         Submenu "Packages" 
    41                 "Sum Two Models",Execute/P "INSERTINCLUDE \"SumSANSModels_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SumModelPanel()" 
    42                 "Global Fitting",Execute/P "INSERTINCLUDE \"GlobalFit2_NCNR_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "WM_NewGlobalFit1#InitNewGlobalFitPanel()" 
    43                 "Simple Global Fitting",Execute/P "INSERTINCLUDE \"GlobalFit2_NCNR_v40\"";Execute/P "INSERTINCLUDE \"SimpleGlobalFit_NCNR_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SimpleGlobalFit()" 
    44                 "Determine Invariant",Execute/P "INSERTINCLUDE \"Invariant_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Make_Invariant_Panel()" 
    45                 "Do Linear Fits",Execute/P "INSERTINCLUDE \"LinearizedFits_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "A_OpenFitPanel()" 
    46                 GenOpFlagEnable()+"Genetic Optimization Enabled", Init_GenOp() 
    47                 GenOpFlagDisable()+"Genetic Optimization Disabled", UnSet_GenOp() 
    48         End 
    49         "-" 
    50         Submenu "2D Utilities" 
    51                 "Generate Fake QxQy Data",FakeQxQy() 
    52                 "Show Cylinder Orientation" 
    53                 "Change Angle" 
    54         end 
    55         "-" 
    56         "NCNR Preferences",Show_Preferences_Panel() 
    57         "Feedback or Bug Report",OpenTracTicketPage() 
    58         "Open Help Movie Page",OpenHelpMoviePage() 
    59         "Check for Updates",CheckForLatestVersion() 
    60 End 
    61  
     16////always include the picker 
     17//#include "SANSModelPicker_v40"                        version>=4.00 
     18////utility procedures 
     19//#include "GaussUtils_v40"                             version>=4.00 
     20//#include "NIST_XML_V40"                                       //added September 2008 
     21//#include "PlotUtilsMacro_v40"                 version>=4.00 
     22//#include "PlotManager_v40"                            version>=4.00 
     23//#include "NCNR_GenFitUtils"                   // April 2009, compiles OK if XOP not present 
     24//#include "NCNR_Utils" 
     25// 
     26//#include "USANS_SlitSmearing_v40" 
     27//#include "WriteModelData_v40" 
     28//#include "Wrapper_v40" 
     29//#include "PlotUtils2D_v40" 
     30//#include "GizmoCylinder_v40" 
     31// 
     32//#include "CheckVersionFTP"                            //added June 2008 
     33// 
     34//#include "DataSetHandling"                                    //added Nov 2009 AJJ 
     35// 
     36//Menu "SANS Models" 
     37//      "Fit Manager", Init_WrapperPanel() 
     38//      "Load Model Functions",Execute/P "INSERTINCLUDE \"SANSModelPicker_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()" 
     39//      "Load and Plot Manager", Show_Plot_Manager() 
     40//      "Freeze Model" 
     41//      "Write Model Data" 
     42//      "ReWrite Experimental Data",ReWrite1DData() 
     43//      "1D Arithmetic Panel",MakeDAPanel() 
     44//      "-" 
     45//      Submenu "Packages" 
     46//              "Sum Two Models",Execute/P "INSERTINCLUDE \"SumSANSModels_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SumModelPanel()" 
     47//              "Global Fitting",Execute/P "INSERTINCLUDE \"GlobalFit2_NCNR_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "WM_NewGlobalFit1#InitNewGlobalFitPanel()" 
     48//              "Simple Global Fitting",Execute/P "INSERTINCLUDE \"GlobalFit2_NCNR_v40\"";Execute/P "INSERTINCLUDE \"SimpleGlobalFit_NCNR_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SimpleGlobalFit()" 
     49//              "Determine Invariant",Execute/P "INSERTINCLUDE \"Invariant_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Make_Invariant_Panel()" 
     50//              "Do Linear Fits",Execute/P "INSERTINCLUDE \"LinearizedFits_v40\"";Execute/P "COMPILEPROCEDURES ";Execute/P "A_OpenFitPanel()" 
     51//              GenOpFlagEnable()+"Genetic Optimization Enabled", Init_GenOp() 
     52//              GenOpFlagDisable()+"Genetic Optimization Disabled", UnSet_GenOp() 
     53//      End 
     54//      "-" 
     55//      Submenu "2D Utilities" 
     56//              "Generate Fake QxQy Data",FakeQxQy() 
     57//              "Show Cylinder Orientation" 
     58//              "Change Angle" 
     59//      end 
     60//      "-" 
     61//      "NCNR Preferences",Show_Preferences_Panel() 
     62//      "Feedback or Bug Report",OpenTracTicketPage() 
     63//      "Open Help Movie Page",OpenHelpMoviePage() 
     64//      "Check for Updates",CheckForLatestVersion() 
     65//End 
     66// 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/HFIR_Utils.ipf

    r692 r693  
    429429// 
    430430// there is a field for this in the header, write "True", so I don't need to guess again. 
     431// -- but this field is often incorrect - for some sample data ALL FILES were "True" 
     432// -- better to check the physical location every time 
    431433// 
    432434Function isTransFile(fName)   ///  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    433435        String fname 
    434436         
     437        Variable beamtrap_1y=0,beamtrap_2y=0,beamtrap_3y=0,beamtrap_4y=0,tol=451 
    435438        //Check by key "transsmission" 
    436         if (stringmatch( getIsTrans(fName),"True")>0) 
    437                 return (1) 
    438         else 
     439//      if (stringmatch( getIsTrans(fName),"True")>0) 
     440//              return (1) 
     441//      else 
    439442                //Check from beam stop motor position 
    440         Variable beamtrap_1y=0,beamtrap_2y=0,beamtrap_3y=0,beamtrap_4y=0,tol=451 
    441443        //      if(your test here) 
    442444                beamtrap_1y=getRealValueFromHeader(fname,"//Motor_Positions/trap_y_101mm","mm") 
     
    451453                else 
    452454                        //some other file 
     455                        Write_isTransmissionToHeader(fName,"False") 
    453456                        return (0) 
    454457                endif 
    455         endif 
     458                 
     459//      endif 
     460 
    456461        return (0) 
    457462End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes.ipf

    r668 r693  
    55 
    66 
    7 // SRK 7 APR 2012 
     7// SRK 7 APR 2010 
    88// as of version 5.1, this is now a pointer to the current version of the includes 
    99#include "Includes_v520" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf

    r668 r693  
    11#pragma rtGlobals=1             // Use modern global access method. 
    2 #pragma version=5.0 
     2#pragma version=5.2 
    33#pragma IgorVersion=6.1 
    44 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Initialize.ipf

    r683 r693  
    11#pragma rtGlobals=1             // Use modern global access method. 
    2 #pragma version=5.1 
     2#pragma version=5.2 
    33#pragma IgorVersion=6.1 
    44 
     
    2828Proc Initialize() 
    2929 
    30         Variable/G root:SANS_RED_VERSION=5.10 
    31          
     30        Variable curVersion = 5.2 
     31        Variable oldVersion = NumVarOrDefault("root:SANS_RED_VERSION",curVersion) 
     32         
     33        //check for really old versions 
    3234        if(itemsinlist(WinList("Includes.ipf", ";","INCLUDE:6"),";") != 0) 
    3335                //must be opening a v4.2 or earlier template 
    34                 DoAlert 0,"This experiment was created with an old version of the macros. I'll try to make this work, but please start new work with a current template" 
     36                oldVersion = 4.2 
     37        endif 
     38         
     39        if(itemsinlist(WinList("Includes_v510.ipf", ";","INCLUDE:6"),";") != 0) 
     40                oldVersion = 5.10 
     41        endif 
     42        if(itemsinlist(WinList("Includes_v500.ipf", ";","INCLUDE:6"),";") != 0) 
     43                oldVersion = 5.00 
     44        endif 
     45         
     46        if(itemsinlist(WinList("Includes_v520.ipf", ";","INCLUDE:6"),";") != 0) 
     47                oldVersion = 5.20 
     48                //must just be a new startup with the current version 
     49                Variable/G root:SANS_RED_VERSION=5.20 
     50        endif 
     51         
     52        if(oldVersion < curVersion) 
     53                String str =    "This experiment was created with version "+num2str(oldVersion)+" of the macros. I'll try to make this work, but please start new work with a current template" 
     54                DoAlert 0,str 
    3555        endif 
    3656         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultipleReduce.ipf

    r646 r693  
    546546        Endif 
    547547         
    548         list = NumWave2CommaList(numW) 
     548        list = NumWave2IntegerCommaList(numW) 
    549549         
    550550        //force an update If the SVAR exists, then the panel does too - MRED cleans up after itself when done 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NSORT.ipf

    r686 r693  
    16941694         
    16951695        if(WinType("NSORT_Panel") == 0) 
    1696                 DoAlert 0, "The NSORT Panel must bo open to combine the files" 
     1696                DoAlert 0, "The NSORT Panel must be open to combine the files" 
    16971697                return(0) 
    16981698        endif 
    16991699         
    1700         DoAlert 1,"Do you have all the assignments set in the bottom table? If not, <no> will exit." 
     1700        DoAlert 1,"Do you have all the assignments set in the bottom table? If not, < No > will exit." 
    17011701        if(V_flag == 2) 
    17021702                return(0)               //no, get out 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANS_Utilities.ipf

    r647 r693  
    3636        do 
    3737                list += textw[ii] + ";" 
     38                ii+=1 
     39        while(ii<num) 
     40        return(list) 
     41End 
     42 
     43Function/S NumWave2IntegerCommaList(numW) 
     44        Wave numW 
     45         
     46        String list="" 
     47        Variable num=numpnts(numW),ii=0 
     48        do 
     49                list += num2iStr(numW[ii]) + "," 
    3850                ii+=1 
    3951        while(ii<num) 
     
    91103                list = "" 
    92104        else 
    93                 list=NumWave2CommaList(w) 
     105                list=NumWave2IntegerCommaList(w) 
    94106        endif 
    95107        return(list) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WriteQIS.ipf

    r628 r693  
    642642// Removed the SAVE of the 2D resolution waves - I'm not sure they are correct. Can't verify the  
    643643// smearing of the 2D data yet. For a future minor release... 
     644// -- when the Qz and resolution are written, be sure to change the tw[15] in the header back to the  
     645//              proper labels 
    644646// 
    645647// 
     
    729731        labelWave[13] = "" 
    730732        labelWave[14] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 
    731         labelWave[15] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQx - SigmaQy - fSubS(beam stop shadow)" 
     733        labelWave[15] = "Data columns are Qx - Qy - I(Qx,Qy)" 
     734//      labelWave[15] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQx - SigmaQy - fSubS(beam stop shadow)" 
    732735        labelWave[16] = "" 
    733736        labelWave[17] = "ASCII data created " +date()+" "+time() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r668 r693  
    4343// 
    4444Proc ShowUSANSPanel() 
     45 
     46        if(itemsinlist(WinList("USANS_Includes.ipf", ";","INCLUDE:6"),";") != 0) 
     47                //must be opening a v2.2 or earlier template 
     48                DoAlert 0,"This experiment was created with an old version (v2.2 or earlier) of the macros. I'll try to make this work, but please start new work with a current template" 
     49        endif 
     50         
    4551        //version number 
    46         Variable/G root:USANS_RED_VERSION=2.21                  //distribution as of Jan 2007 
     52        Variable/G root:USANS_RED_VERSION=2.3                   //distribution as of Jan 2007 
    4753         
    4854        Init_MainUSANS() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/USANS_Includes.ipf

    r608 r693  
    33#pragma IgorVersion=6.1 
    44 
    5 //************* 
    6 // the list of files to include in the USANS reduction experiment 
    7 //  - files must be located somewhere in the User Procedures folder 
    8 // or sub-folders 
     5 
     6///point to the current version, so I can recognize old experiments 
     7#include "USANS_Includes_v230" 
     8 
     9 
     10////************* 
     11//// the list of files to include in the USANS reduction experiment 
     12////  - files must be located somewhere in the User Procedures folder 
     13//// or sub-folders 
     14//// 
    915// 
    10  
    11 #include "BT5_Loader",version >= 2.20    
    12 #include "COR_Graph",version >= 2.20                     
    13 #include "Main_USANS",version >= 2.20    
    14 #include "PlotUtilsMacro_v40",version >= 2.20 
    15 #include "NIST_XML_v40" 
    16 #include "USANS_SlitSmearing_v40"        
    17 #include "WriteUSANSData",version >= 2.20        
    18 #include "LakeDesmearing_JB",version >= 2.20     
    19 #include "USANSCatNotebook",version >= 2.20      
    20 #include "CheckVersionFTP"                              //added June 2008 
    21 #include "GaussUtils_v40"                               //added Oct 2008 for unified file loading 
    22 #include "BT5_AddFiles"                                 //Oct 2009 to add raw data files 
    23  
    24 // USANS simulation and required procedures 
    25 #include "U_CALC" 
    26 #include "USANS_EmptyWaves" 
    27 #include "MultScatter_MonteCarlo_2D" 
    28 #include "SASCALC" 
    29 #include "NCNR_DataReadWrite" 
    30 #include "SANS_Utilities" 
    31 #include "NCNR_Utils" 
    32 #include "MultipleReduce" 
    33  
    34 //AJJ for data set output? 
    35 //#include "DataSetHandling" 
    36 //#Include "WriteModelData_v40" 
     16//#include "BT5_Loader",version >= 2.20  
     17//#include "COR_Graph",version >= 2.20                   
     18//#include "Main_USANS",version >= 2.20  
     19//#include "PlotUtilsMacro_v40",version >= 2.20 
     20//#include "NIST_XML_v40" 
     21//#include "USANS_SlitSmearing_v40"      
     22//#include "WriteUSANSData",version >= 2.20      
     23//#include "LakeDesmearing_JB",version >= 2.20   
     24//#include "USANSCatNotebook",version >= 2.20    
     25//#include "CheckVersionFTP"                            //added June 2008 
     26//#include "GaussUtils_v40"                             //added Oct 2008 for unified file loading 
     27//#include "BT5_AddFiles"                                       //Oct 2009 to add raw data files 
     28// 
     29//// USANS simulation and required procedures 
     30//#include "U_CALC" 
     31//#include "USANS_EmptyWaves" 
     32//#include "MultScatter_MonteCarlo_2D" 
     33//#include "SASCALC" 
     34//#include "NCNR_DataReadWrite" 
     35//#include "SANS_Utilities" 
     36//#include "NCNR_Utils" 
     37//#include "MultipleReduce" 
     38// 
     39////AJJ for data set output? 
     40////#include "DataSetHandling" 
     41////#Include "WriteModelData_v40" 
Note: See TracChangeset for help on using the changeset viewer.