Changeset a807206 in sasmodels for sasmodels/models/ellipsoid.py


Ignore:
Timestamp:
Sep 30, 2016 10:42:06 PM (8 years ago)
Author:
butler
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
caddb14, 5031ca3
Parents:
2222134
Message:

updating more parameter names addressing #649

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/ellipsoid.py

    r42356c8 ra807206  
    7474    calculated from our 2D model and the intensity from the NIST SANS 
    7575    analysis software. The parameters used were: *scale* = 1.0, 
    76     *r_polar* = 20 |Ang|, *r_equatorial* = 400 |Ang|, 
     76    *radius_polar* = 20 |Ang|, *radius_equatorial* = 400 |Ang|, 
    7777    *contrast* = 3e-6 |Ang^-2|, and *background* = 0.0 |cm^-1|. 
    7878 
     
    122122              ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", 
    123123               "Solvent scattering length density"], 
    124               ["r_polar", "Ang", 20, [0, inf], "volume", 
     124              ["radius_polar", "Ang", 20, [0, inf], "volume", 
    125125               "Polar radius"], 
    126               ["r_equatorial", "Ang", 400, [0, inf], "volume", 
     126              ["radius_equatorial", "Ang", 400, [0, inf], "volume", 
    127127               "Equatorial radius"], 
    128128              ["theta", "degrees", 60, [-inf, inf], "orientation", 
     
    134134source = ["lib/sph_j1c.c", "lib/gauss76.c", "ellipsoid.c"] 
    135135 
    136 def ER(r_polar, r_equatorial): 
     136def ER(radius_polar, radius_equatorial): 
    137137    import numpy as np 
    138138 
    139     ee = np.empty_like(r_polar) 
    140     idx = r_polar > r_equatorial 
    141     ee[idx] = (r_polar[idx] ** 2 - r_equatorial[idx] ** 2) / r_polar[idx] ** 2 
    142     idx = r_polar < r_equatorial 
    143     ee[idx] = (r_equatorial[idx] ** 2 - r_polar[idx] ** 2) / r_equatorial[idx] ** 2 
    144     idx = r_polar == r_equatorial 
    145     ee[idx] = 2 * r_polar[idx] 
    146     valid = (r_polar * r_equatorial != 0) 
     139    ee = np.empty_like(radius_polar) 
     140    idx = radius_polar > radius_equatorial 
     141    ee[idx] = (radius_polar[idx] ** 2 - radius_equatorial[idx] ** 2) / radius_polar[idx] ** 2 
     142    idx = radius_polar < radius_equatorial 
     143    ee[idx] = (radius_equatorial[idx] ** 2 - radius_polar[idx] ** 2) / radius_equatorial[idx] ** 2 
     144    idx = radius_polar == radius_equatorial 
     145    ee[idx] = 2 * radius_polar[idx] 
     146    valid = (radius_polar * radius_equatorial != 0) 
    147147    bd = 1.0 - ee[valid] 
    148148    e1 = np.sqrt(ee[valid]) 
     
    152152    delta = 0.75 * b1 * b2 
    153153 
    154     ddd = np.zeros_like(r_polar) 
    155     ddd[valid] = 2.0 * (delta + 1.0) * r_polar * r_equatorial ** 2 
     154    ddd = np.zeros_like(radius_polar) 
     155    ddd[valid] = 2.0 * (delta + 1.0) * radius_polar * radius_equatorial ** 2 
    156156    return 0.5 * ddd ** (1.0 / 3.0) 
    157157 
     
    159159demo = dict(scale=1, background=0, 
    160160            sld=6, sld_solvent=1, 
    161             r_polar=50, r_equatorial=30, 
     161            radius_polar=50, radius_equatorial=30, 
    162162            theta=30, phi=15, 
    163             r_polar_pd=.2, r_polar_pd_n=15, 
    164             r_equatorial_pd=.2, r_equatorial_pd_n=15, 
     163            radius_polar_pd=.2, radius_polar_pd_n=15, 
     164            radius_equatorial_pd=.2, radius_equatorial_pd_n=15, 
    165165            theta_pd=15, theta_pd_n=45, 
    166166            phi_pd=15, phi_pd_n=1) 
Note: See TracChangeset for help on using the changeset viewer.