Ignore:
Timestamp:
Jun 23, 2009 6:06:24 PM (13 years ago)
Author:
srkline
Message:

A bunch of random changes:
-SASCALC - added the 2.5 cm aperture NG3/7g/polarizer back in, but made the 5 cm the default
-Some fiddling with 2D functionality to enable 2D resolution smearing. Still a work in progress
-Added two new model functions, and added them to the list.
-Changes to the wrapper for the new release to generate kw=val strings as needed for each function
and its coefficients and parameters. This behavior has been changed in the new release, so this
fix should keep old analysis experiments compatible with the new version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r510 r515  
    487487// always pass this the function string 
    488488// 
     489// this is new in the 2009 release, so make sure that it generates itself as needed. 
     490// Two options: (1) search and construct as needed, ask for intervention if I need it. 
     491// (2) since I'm passed the function, try to replot it to re-run the function 
     492// to fill in the strings. (Being sure to save the coefficients) 
     493// 
     494// using method (1) to fill in what I need with no intervention 
     495// 
    489496Function/S getFunctionParams(funcStr) 
    490497        String funcStr 
    491498 
    492         SVAR listStr=root:Packages:NIST:paramKWStr 
    493         String paramStr = StringByKey(funcStr, listStr  ,"=",";",0) 
     499        String paramStr="" 
     500        SVAR/Z listStr=root:Packages:NIST:paramKWStr 
     501        if(SVAR_Exists(listStr)) 
     502                paramStr = StringByKey(funcStr, listStr  ,"=",";",0) 
     503                if(strlen(paramStr)!=0)                 //will drop out of loop if string can't be found 
     504                        return(paramStr) 
     505                endif 
     506        else    //global string does not exist, create it and fill it in 
     507                String/G root:Packages:NIST:paramKWStr="" 
     508                SVAR/Z listStr=root:Packages:NIST:paramKWStr 
     509        endif 
     510        // find everything 
     511        SVAR suffixKWStr = root:Packages:NIST:suffixKWStr 
     512        String coef = getFunctionCoef(funcStr) 
     513        String suffix = getModelSuffix(coef)            //!! normally takes funcStr 
     514         
     515        // add to the suffix list 
     516        suffixKWStr += funcStr+"="+suffix+";" 
     517         
     518        // add to the paramList 
     519         
     520        ///// NEED TO BE IN PROPER DATA FOLDER FOR SMEARED FUNCTIONS 
     521        // FUNCTION POP MENU WILL LOOK IN ROOT OTHERWISE 
     522        ControlInfo/W=WrapperPanel popup_0 
     523        String folderStr=S_Value 
     524        // this if/else/endif should not ever return an error alert      
     525        // it should simply set the data folder properly         
     526        if(Stringmatch(funcStr,"Smear*"))               //simple test for smeared function 
     527                if(DataFolderExists("root:"+folderStr)) 
     528                        SetDataFolder $("root:"+folderStr) 
     529                else 
     530                        SetDataFolder root: 
     531                endif 
     532        else 
     533                SetDataFolder root: 
     534        endif 
     535                         
     536         
     537        String paramWave = WaveList("*par*"+suffix,"","TEXT:1")         //should be one wave name, no trailing semicolon 
     538        listStr += funcStr+"="+paramWave+";" 
     539 
     540        //now look it up again 
     541        paramStr = StringByKey(funcStr, listStr  ,"=",";",0) 
    494542 
    495543        return(paramStr) 
     
    516564        String suffixStr = StringByKey(funcStr, listStr  ,"=",";",0) 
    517565 
     566        if(strlen(suffixStr)==0) 
     567                // run through the param function to set the strings properly 
     568                String str = getFunctionParams(funcStr) 
     569                suffixStr = getModelSuffix(funcStr)             //then call again 
     570        endif 
    518571        return(suffixStr) 
    519572End 
Note: See TracChangeset for help on using the changeset viewer.