Changeset 40a87fa in sasmodels for sasmodels/models/polymer_excl_volume.py
- Timestamp:
- Aug 8, 2016 11:24:11 AM (8 years ago)
- 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:
- 2472141
- Parents:
- 2d65d51
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/polymer_excl_volume.py
r2c74c11 r40a87fa 106 106 107 107 # pylint: disable=bad-whitespace, line-too-long 108 # ["name", "units", default, [lower, upper], "type", "description"], 109 parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"], 110 ["porod_exp", "", 3.0, [-inf, inf], "", "Porod exponent"], 111 ] 108 # ["name", "units", default, [lower, upper], "type", "description"], 109 parameters = [ 110 ["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"], 111 ["porod_exp", "", 3.0, [-inf, inf], "", "Porod exponent"], 112 ] 112 113 # pylint: enable=bad-whitespace, line-too-long 113 114 … … 120 121 :return: Calculated intensity 121 122 """ 122 u = (q*rg)**2 * (2.0/porod_exp + 1.0) * (2.0/porod_exp + 2.0)/6.0123 usub = (q*rg)**2 * (2.0/porod_exp + 1.0) * (2.0/porod_exp + 2.0)/6.0 123 124 with errstate(divide='ignore', invalid='ignore'): 124 upow = power(u , -0.5*porod_exp)125 iq= (porod_exp*upow *126 (gamma(0.5*porod_exp)*gammainc(0.5*porod_exp, u) -127 upow*gamma(porod_exp)*gammainc(porod_exp, u)))128 iq[q <= 0] = 1.0125 upow = power(usub, -0.5*porod_exp) 126 result= (porod_exp*upow * 127 (gamma(0.5*porod_exp)*gammainc(0.5*porod_exp, usub) - 128 upow*gamma(porod_exp)*gammainc(porod_exp, usub))) 129 result[q <= 0] = 1.0 129 130 130 return iq131 return result 131 132 132 133 Iq.vectorized = True # Iq accepts an array of q values 133 134 134 135 135 tests = [
Note: See TracChangeset
for help on using the changeset viewer.