Ignore:
Timestamp:
Jun 29, 2009 1:51:03 PM (13 years ago)
Author:
srkline
Message:

Fixed bugs introduced in r515 concerning the back-compatibility of the kw=val strings for the
model functions. Now should work correctly when no models are loaded.

Changed integration limits on paracrystal models

Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/FCC_ParaCrystal_v40.ipf

    r510 r516  
    3333        Make/O/D/n=(num) xwave_FCC_ParaCrystal, ywave_FCC_ParaCrystal 
    3434        xwave_FCC_ParaCrystal =  alog(log(qmin) + x*((log(qmax)-log(qmin))/num)) 
    35         Make/O/D coef_FCC_ParaCrystal = {1,220,0.06,40,3e-6,6.3e-6,0.0} 
     35        Make/O/D coef_FCC_ParaCrystal = {1,220,0.05,40,3e-6,6.3e-6,0.0} 
    3636        make/o/t parameters_FCC_ParaCrystal = {"scale","Nearest Neighbor (A)","distortion, g","Sphere Radius (A)","SLD sphere (A-2)","SLD solvent (A-2)", "Background (cm-1)"}   
    3737        Edit parameters_FCC_ParaCrystal, coef_FCC_ParaCrystal 
     
    7373         
    7474        // Setup parameter table for model function 
    75         Make/O/D smear_coef_FCC_ParaCrystal = {1,220,0.06,40,3e-6,6.3e-6,0.0} 
     75        Make/O/D smear_coef_FCC_ParaCrystal = {1,220,0.05,40,3e-6,6.3e-6,0.0} 
    7676        make/o/t smear_param_FCC_ParaCrystal = {"scale","Nearest Neighbor (A)","distortion, g","Sphere Radius (A)","SLD sphere (A-2)","SLD solvent (A-2)", "Background (cm-1)"} 
    7777        Edit smear_param_FCC_ParaCrystal,smear_coef_FCC_ParaCrystal                                     //display parameters in a table 
     
    108108#if exists("FCC_ParaCrystalX") 
    109109        yw = FCC_ParaCrystalX(cw,xw) 
     110 
     111//// to return just Z(q), undo the form factor calculation 
     112//      Variable latticeScale 
     113//      latticeScale = 4*(4/3)*pi*(cw[3]^3)/((cw[1]*(2^0.5))^3)  
     114//       
     115//      yw /= SphereForm_FCC(cw[3],cw[4]-cw[5],xw)*latticeScale 
     116////     
    110117#else 
    111118        yw = fFCC_ParaCrystal(cw,xw) 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2008/SC_ParaCrystal_v40.ipf

    r515 r516  
    126126        Variable integral,loLim,upLim 
    127127        loLim = 0 
    128         upLim = 2*Pi 
     128        upLim = Pi/2 
    129129         
    130130        Variable/G root:gDumY=0         //root:gDumX=0 
     
    169169        // 
    170170        loLim = 0 
    171         upLim = Pi 
     171        upLim = Pi/2 
    172172 
    173173        NVAR/Z nord=root:gNordSC 
     
    213213         
    214214        retVal = temp2*SCeval(xx,yy,temp3,temp4,temp5) 
    215         retVal /=4*Pi 
     215        retVal *= 2/pi 
    216216         
    217217        return(retVal) 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/ModelPicker/SANSModelPicker_v40.ipf

    r515 r516  
    199199  SANS_Model_List[66] = "Core_and_NShells.ipf" 
    200200  SANS_Model_List[67] = "PolyCore_and_NShells.ipf" 
    201   SANS_Model_List[68] = "Fractal_Polysphere.ipf" 
     201  SANS_Model_List[68] = "Fractal_PolySphere.ipf" 
    202202  SANS_Model_List[69] = "GaussLorentzGel.ipf" 
    203203  SANS_Model_List[70] = "PolyGaussCoil.ipf" 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r515 r516  
    3636                if(exists("root:Packages:NIST:suffixKWStr")==0) 
    3737                        String/G root:Packages:NIST:suffixKWStr="" 
     38                endif 
     39                if(exists("root:Packages:NIST:paramKWStr")==0) 
     40                        String/G root:Packages:NIST:paramKWStr="" 
    3841                endif 
    3942                Execute "WrapperPanel()" 
     
    499502        String paramStr="" 
    500503        SVAR/Z listStr=root:Packages:NIST:paramKWStr 
     504 
    501505        if(SVAR_Exists(listStr)) 
    502506                paramStr = StringByKey(funcStr, listStr  ,"=",";",0) 
     
    505509                endif 
    506510        else    //global string does not exist, create it and fill it in 
     511                Variable/G root:Pacakges:NIST:gReconstructStrings = 1                   //coefficients old style and must be rebuilt too 
    507512                String/G root:Packages:NIST:paramKWStr="" 
    508513                SVAR/Z listStr=root:Packages:NIST:paramKWStr 
    509         endif 
    510         // find everything 
    511         SVAR suffixKWStr = root:Packages:NIST:suffixKWStr 
     514        endif    
     515         
     516        // find everything to rebuild only if the model has been plotted (if so, coefficients will exist) 
    512517        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 
     518        if(strlen(coef)==0) 
     519                //model not plotted, don't reconstruct, return null string 
     520                return(paramStr) 
     521        endif 
    519522         
    520523        ///// NEED TO BE IN PROPER DATA FOLDER FOR SMEARED FUNCTIONS 
     
    533536                SetDataFolder root: 
    534537        endif 
    535                          
     538         
     539        // model was plotted, find the suffix to fill in the parameter wave 
     540        SVAR suffListStr=root:Packages:NIST:suffixKWStr 
     541        String suffix = StringByKey(coef, suffListStr  ,"=",";",0) 
    536542         
    537543        String paramWave = WaveList("*par*"+suffix,"","TEXT:1")         //should be one wave name, no trailing semicolon 
     
    558564// 
    559565// does NOT return the leading "_" as part of the suffix 
     566// may need to set the string correctly - so lost of messing around for back-compatibility 
    560567Function/S getModelSuffix(funcStr) 
    561568        String funcStr 
     
    564571        String suffixStr = StringByKey(funcStr, listStr  ,"=",";",0) 
    565572 
    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 
    571         return(suffixStr) 
     573        if(strlen(suffixStr) !=0)               //found it, get out 
     574                return(suffixStr) 
     575        endif 
     576         
     577        // was the model plotted? 
     578        String coef = getFunctionCoef(funcStr) 
     579        if(strlen(coef)==0)              
     580                //nothing plotted 
     581                return("") 
     582        else 
     583                //plotted, find the coeff 
     584                String suffix = StringByKey(coef, ListStr  ,"=",";",0) 
     585         
     586                // add to the suffix list in the new style, if it was found 
     587                if(strlen(suffix) !=0) 
     588                        listStr += funcStr+"="+suffix+";" 
     589                endif 
     590                return(suffix) 
     591        endif 
     592         
     593        return("") 
    572594End 
    573595 
Note: See TracChangeset for help on using the changeset viewer.