Changeset 169


Ignore:
Timestamp:
Sep 27, 2007 1:45:22 PM (15 years ago)
Author:
srkline
Message:

Changed macros in models that plot distributions, Rg, I(0), etc. to look for the coef_ wave, and abort if it cannot be found. The user is advised to plot the unsmeared model to use with the extra macros. This is the easy way out. There may be a way to guess what other valid coefficient waves exist, but that would be cumbersome and possibly require user intervention as well.

Location:
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/BimodalSchulzSpheres.ipf

    r166 r169  
    8383        Variable nden1,nden2,phi1,phi2,R1,R2,Ravg,p1,p2,Rg1,Rg2,I1_0,I2_0,I0,Sv1,Sv2,Sv,vpoly1,vpoly2 
    8484        Variable z1,z2,v2poly1,v2poly2 
    85         if(WaveExists(coef_bss)==0) 
    86                 abort "You need to plot the model first to create the coefficient table" 
     85         
     86        if(Exists("coef_bss")!=1) 
     87                abort "You need to plot the unsmeared model first to create the coefficient table" 
    8788        Endif 
    8889         
     
    143144        variable p1,p2,r1,r2,z1,z2,phi1,phi2,f1,f2,nden1,nden2,vpoly1,vpoly2,maxr 
    144145         
    145         if(WaveExists(coef_bss)==0) 
    146                 abort "You need to plot the model first to create the coefficient table" 
     146        if(Exists("coef_bss")!=1) 
     147                abort "You need to plot the unsmeared model first to create the coefficient table" 
    147148        Endif 
    148149        phi1 = coef_bss[0]  // volume fraction, mode 1 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/BinaryHardSpheres.ipf

    r166 r169  
    492492Macro Plot_BinaryHS_PSF() 
    493493 
    494         if(WaveExists(coef_BinaryHS)==0) 
    495                 abort "You need to plot the model first to create the coefficient table" 
     494        if(Exists("coef_BinaryHS") != 1) 
     495                abort "You need to plot the unsmeared model first to create the coefficient table" 
    496496        Endif 
    497497         
    498498        Make/O/D/n=(numpnts(xwave_BinaryHS)) psf11_BinaryHS,psf12_BinaryHS,psf22_BinaryHS,QD2_BinaryHS 
    499499 
    500         psf11_BinaryHS := BinaryHS_psf11(coef_BinaryHS, xwave_BinaryHS) 
    501         psf12_BinaryHS := BinaryHS_psf12(coef_BinaryHS, xwave_BinaryHS) 
    502         psf22_BinaryHS := BinaryHS_psf22(coef_BinaryHS, xwave_BinaryHS) 
     500        Variable/G root:g_psf11,root:g_psf12,root:g_psf22,root:g_QD2 
     501         
     502        g_psf11 := BinaryHS_psf11(coef_BinaryHS, psf11_BinaryHS, xwave_BinaryHS) 
     503        g_psf12 := BinaryHS_psf12(coef_BinaryHS, psf12_BinaryHS, xwave_BinaryHS) 
     504        g_psf22 := BinaryHS_psf22(coef_BinaryHS, psf22_BinaryHS, xwave_BinaryHS) 
    503505        QD2_BinaryHS := xwave_BinaryHS*coef_BinaryHS[0]*2 
    504506//      Display psf11_BinaryHS vs xwave_BinaryHS 
     
    538540        Print "Radius (smaller) = ",r1 
    539541         
     542        if(Exists("coef_BinaryHS") != 1) 
     543                abort "You need to plot the unsmeared model first to create the coefficient table" 
     544        Endif 
     545         
    540546        coef_BinaryHS[2] = phi2 
    541547        coef_BinaryHS[3] = phi1 
     
    543549End 
    544550 
     551 
    545552//calculates number fractions of each population based on the  
    546553//coef_BinaryHS parameters 
     
    548555 
    549556        if(exists("coef_BinaryHS") != 1) 
    550                 Abort "You must plot the BHS model first to create the coefficient wave" 
     557                Abort "You must plot the unsmeared BHS model first to create the coefficient wave" 
    551558        endif 
    552559        Variable r1,r2,phi1,phi2,aa     //same notation as paper - r2 is LARGER 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/Fractal.ipf

    r168 r169  
    7777        Variable nden,phi,r0,Df,corr,s0,vpoly,i0,rg 
    7878         
    79         if(WaveExists(coef_fra)==0) 
    80                 abort "You need to plot the model first to create the coefficient table" 
     79        if(Exists("coef_fra")!=1) 
     80                abort "You need to plot the unsmeared model first to create the coefficient table" 
    8181        Endif 
    8282         
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/GaussSpheres.ipf

    r166 r169  
    219219        Variable nden,vpoly,Ravg,p,Rg,I0,Sv,phi 
    220220         
    221         if(WaveExists(coef_pgs)==0) 
    222                 abort "You need to plot the model first to create the coefficient table" 
     221        if(Exists("coef_pgs")!=1) 
     222                abort "You need to plot the unsmeared model first to create the coefficient table" 
    223223        Endif 
    224224        Ravg = coef_pgs[1]  // mean radius (A) 
     
    250250        variable pd,avg,zz,maxr 
    251251         
    252         if(WaveExists(coef_pgs)==0) 
    253                 abort "You need to plot the model first to create the coefficient table" 
     252        if(Exists("coef_pgs")!=1) 
     253                abort "You need to plot the unsmeared model first to create the coefficient table" 
    254254        Endif 
    255255        pd=coef_pgs[2] 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/LogNormalSphere.ipf

    r168 r169  
    238238        Variable nden,r3,rg,sv,i0,ravg,rpk 
    239239         
    240         if(Exists("coef_lns")==0) 
     240        if(Exists("coef_lns")!=1) 
    241241                abort "You need to plot the unsmeared model first to create the coefficient table" 
    242242        Endif 
     
    269269        variable sig,mu,maxr 
    270270         
    271         if(Exists("coef_lns")==0) 
     271        if(Exists("coef_lns")!=1) 
    272272                abort "You need to plot the unsmeared model first to create the coefficient table" 
    273273        Endif 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/SchulzSpheres.ipf

    r166 r169  
    230230        Variable nden,zz,zp1,zp2,zp3,zp4,zp5,zp6,zp7,zp8,vpoly,v2poly,rg,sv,i0 
    231231         
    232         if(WaveExists(coef_sch)==0) 
    233                 abort "You need to plot the model first to create the coefficient table" 
     232        if(Exists("coef_sch")!=1) 
     233                abort "You need to plot the unsmeared model first to create the coefficient table" 
    234234        Endif 
    235235         
     
    269269        variable pd,avg,zz,maxr 
    270270         
    271         if(WaveExists(coef_sch)==0) 
    272                 abort "You need to plot the model first to create the coefficient table" 
     271        if(Exists("coef_sch")!=1) 
     272                abort "You need to plot the unsmeared model first to create the coefficient table" 
    273273        Endif 
    274274        pd=coef_sch[2] 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/NewModels_2006/Vesicle_UL.ipf

    r166 r169  
    193193        Variable phi 
    194194         
    195         if(WaveExists(coef_vesicle)==0) 
    196                 abort "You need to plot the vesicle model first to create the coefficient table" 
     195        if(Exists("coef_vesicle")!=1) 
     196                abort "You need to plot the unsmeared vesicle model first to create the coefficient table" 
    197197        Endif 
    198198        totvol=4*pi/3*(coef_vesicle[1]+coef_vesicle[2])^3 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker/SANSModelPicker.ipf

    r132 r169  
    593593//      list += MacroList("LoadO*",sep,"KIND:1,NPARAMS:0")              //data loader 
    594594        list += "Load SANS or USANS Data;"              //use the wrapper above to get the right loader 
    595         list += "Reset Resolution Waves;"               // resets the resolution waves used for the calculations 
    596         list += "Freeze Model;"                                         // freeze a model to compare plots on the same graph 
     595//      list += "Reset Resolution Waves;"               // resets the resolution waves used for the calculations 
     596//      list += "Freeze Model;"                                         // freeze a model to compare plots on the same graph 
    597597        list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4")             //data writer 
    598598        list += "-"+sep 
Note: See TracChangeset for help on using the changeset viewer.