Changes in / [a0ebc96:535fee6] in sasmodels


Ignore:
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • example/oriented_usans.py

    rea75043 r1cd24b4  
    1919    scale=0.08, background=0, 
    2020    sld=.291, sld_solvent=7.105, 
    21     r_polar=1800, r_polar_pd=0.222296, r_polar_pd_n=0, 
    22     r_equatorial=2600, r_equatorial_pd=0.28, r_equatorial_pd_n=0, 
     21    radius_polar=1800, radius_polar_pd=0.222296, radius_polar_pd_n=0, 
     22    radius_equatorial=2600, radius_equatorial_pd=0.28, radius_equatorial_pd_n=0, 
    2323    theta=60, theta_pd=0, theta_pd_n=0, 
    2424    phi=60, phi_pd=0, phi_pd_n=0, 
     
    2626 
    2727# SET THE FITTING PARAMETERS 
    28 model.r_polar.range(1000, 10000) 
    29 model.r_equatorial.range(1000, 10000) 
     28model.radius_polar.range(1000, 10000) 
     29model.radius_equatorial.range(1000, 10000) 
    3030model.theta.range(0, 360) 
    3131model.phi.range(0, 360) 
  • sasmodels/data.py

    ra769b54 r09e9e13  
    450450            if view is 'log': 
    451451                mtheory[mtheory <= 0] = masked 
    452             plt.plot(data.x, scale*mtheory, '-', hold=True) 
     452            plt.plot(data.x, scale*mtheory, '-') 
    453453            all_positive = all_positive and (mtheory > 0).all() 
    454454            some_present = some_present or (mtheory.count() > 0) 
     
    457457            plt.ylim(*limits) 
    458458 
    459         plt.xscale('linear' if not some_present or non_positive_x  else view) 
     459        plt.xscale('linear' if not some_present or non_positive_x 
     460                   else view if view is not None 
     461                   else 'log') 
    460462        plt.yscale('linear' 
    461463                   if view == 'q4' or not some_present or not all_positive 
    462                    else view) 
     464                   else view if view is not None 
     465                   else 'log') 
    463466        plt.xlabel("$q$/A$^{-1}$") 
    464467        plt.ylabel('$I(q)$') 
     468        title = ("data and model" if use_theory and use_data 
     469                 else "data" if use_data 
     470                 else "model") 
     471        plt.title(title) 
    465472 
    466473    if use_calc: 
     
    482489        if num_plots > 1: 
    483490            plt.subplot(1, num_plots, use_calc + 2) 
    484         plt.plot(data.x, mresid, '-') 
     491        plt.plot(data.x, mresid, '.') 
    485492        plt.xlabel("$q$/A$^{-1}$") 
    486493        plt.ylabel('residuals') 
    487         plt.xscale('linear' if not some_present or non_positive_x else view) 
     494        plt.xscale('linear') 
     495        plt.title('(model - Iq)/dIq') 
    488496 
    489497 
     
    512520        if theory is not None: 
    513521            if is_tof: 
    514                 plt.plot(data.x, np.log(theory)/(data.lam*data.lam), '-', hold=True) 
     522                plt.plot(data.x, np.log(theory)/(data.lam*data.lam), '-') 
    515523            else: 
    516                 plt.plot(data.x, theory, '-', hold=True) 
     524                plt.plot(data.x, theory, '-') 
    517525        if limits is not None: 
    518526            plt.ylim(*limits) 
  • sasmodels/models/onion.py

    r925ad6e rbccb40f  
    11r""" 
    22This model provides the form factor, $P(q)$, for a multi-shell sphere where 
    3 the scattering length density (SLD) of the each shell is described by an 
     3the scattering length density (SLD) of each shell is described by an 
    44exponential, linear, or constant function. The form factor is normalized by 
    55the volume of the sphere where the SLD is not identical to the SLD of the 
     
    142142 
    143143For $A = 0$, the exponential function has no dependence on the radius (so that 
    144 $\rho_\text{out}$ is ignored this case) and becomes flat. We set the constant 
     144$\rho_\text{out}$ is ignored in this case) and becomes flat. We set the constant 
    145145to $\rho_\text{in}$ for convenience, and thus the form factor contributed by 
    146146the shells is 
     
    346346            # flat shell 
    347347            z.append(z_current + thickness[k]) 
    348             rho.append(sld_out[k]) 
     348            rho.append(sld_in[k]) 
    349349        else: 
    350350            # exponential shell 
     
    357357                z.append(z_current+z_shell) 
    358358                rho.append(slope*exp(A[k]*z_shell/thickness[k]) + const) 
    359  
     359     
    360360    # add in the solvent 
    361361    z.append(z[-1]) 
Note: See TracChangeset for help on using the changeset viewer.