Changes in / [5bc6d21:17a8c94] in sasmodels
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/guide/pd/polydispersity.rst
r92d330fd rf4ae8c4 23 23 average over the size distribution. 24 24 25 Each distribution is characterized by its center $\bar x$, its width $\sigma$, 26 the number of sigmas $N_\sigma$ to include from the tails, and the number of 27 points used to compute the average. The center of the distribution is set by the 28 value of the model parameter. Volume parameters have polydispersity *PD* 29 (not to be confused with a molecular weight distributions in polymer science) 30 leading to a size distribution of width $\text{PD} = \sigma / \bar x$, but 31 orientation parameters use an angular distributions of width $\sigma$. 32 $N_\sigma$ determines how far into the tails to evaluate the distribution, with 33 larger values of $N_\sigma$ required for heavier tailed distributions. 25 Each distribution is characterized by a center value $\bar x$ or 26 $x_\text{med}$, a width parameter $\sigma$ (note this is *not necessarily* 27 the standard deviation, so read the description carefully), the number of 28 sigmas $N_\sigma$ to include from the tails of the distribution, and the 29 number of points used to compute the average. The center of the distribution 30 is set by the value of the model parameter. 31 32 Volume parameters have polydispersity *PD* (not to be confused with a 33 molecular weight distributions in polymer science), but orientation parameters 34 use angular distributions of width $\sigma$. 35 36 $N_\sigma$ determines how far into the tails to evaluate the distribution, 37 with larger values of $N_\sigma$ required for heavier tailed distributions. 34 38 The scattering in general falls rapidly with $qr$ so the usual assumption 35 39 that $G(r - 3\sigma_r)$ is tiny and therefore $f(r - 3\sigma_r)G(r - 3\sigma_r)$ … … 44 48 The following distribution functions are provided: 45 49 50 * *Uniform Distribution* 46 51 * *Rectangular Distribution* 47 * *Uniform Distribution*48 52 * *Gaussian Distribution* 53 * *Boltzmann Distribution* 49 54 * *Lognormal Distribution* 50 55 * *Schulz Distribution* 51 56 * *Array Distribution* 52 * *Boltzmann Distribution*53 57 54 58 These are all implemented as *number-average* distributions. 59 60 Additional distributions are under consideration. 61 62 Suggested Applications 63 ^^^^^^^^^^^^^^^^^^^^^^ 64 65 If applying polydispersion to parameters describing particle sizes, use 66 the Lognormal or Schulz distributions. 67 68 If applying polydispersion to parameters describing interfacial thicknesses 69 or angular orientations, use the Gaussian or Boltzmann distributions. 70 71 The array distribution allows a user-defined distribution to be applied. 72 73 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 74 75 Uniform Distribution 76 ^^^^^^^^^^^^^^^^^^^^ 77 78 The Uniform Distribution is defined as 79 80 .. math:: 81 82 f(x) = \frac{1}{\text{Norm}} 83 \begin{cases} 84 1 & \text{for } |x - \bar x| \leq \sigma \\ 85 0 & \text{for } |x - \bar x| > \sigma 86 \end{cases} 87 88 where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the 89 distribution, $\sigma$ is the half-width, and *Norm* is a normalization 90 factor which is determined during the numerical calculation. 91 92 The polydispersity in sasmodels is given by 93 94 .. math:: \text{PD} = \sigma / \bar x 95 96 .. figure:: pd_uniform.jpg 97 98 Uniform distribution. 99 100 The value $N_\sigma$ is ignored for this distribution. 55 101 56 102 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 65 111 f(x) = \frac{1}{\text{Norm}} 66 112 \begin{cases} 67 1 & \text{for } |x - \bar x| \leq w \\68 0 & \text{for } |x - \bar x| > w113 1 & \text{for } |x - \bar x| \leq w \\ 114 0 & \text{for } |x - \bar x| > w 69 115 \end{cases} 70 116 71 where $\bar x$ is the mean of the distribution, $w$ is the half-width, and72 *Norm* is a normalization factor which is determined during the numerical 73 calculation.117 where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the 118 distribution, $w$ is the half-width, and *Norm* is a normalization 119 factor which is determined during the numerical calculation. 74 120 75 121 Note that the standard deviation and the half width $w$ are different! … … 79 125 .. math:: \sigma = w / \sqrt{3} 80 126 81 whilst the polydispersity i s127 whilst the polydispersity in sasmodels is given by 82 128 83 129 .. math:: \text{PD} = \sigma / \bar x … … 87 133 Rectangular distribution. 88 134 89 90 91 Uniform Distribution 92 ^^^^^^^^^^^^^^^^^^^^^^^^ 93 94 The Uniform Distribution is defined as 95 96 .. math:: 97 98 f(x) = \frac{1}{\text{Norm}} 99 \begin{cases} 100 1 & \text{for } |x - \bar x| \leq \sigma \\ 101 0 & \text{for } |x - \bar x| > \sigma 102 \end{cases} 103 104 where $\bar x$ is the mean of the distribution, $\sigma$ is the half-width, and 105 *Norm* is a normalization factor which is determined during the numerical 106 calculation. 107 108 Note that the polydispersity is given by 109 110 .. math:: \text{PD} = \sigma / \bar x 111 112 .. figure:: pd_uniform.jpg 113 114 Uniform distribution. 115 116 The value $N_\sigma$ is ignored for this distribution. 135 .. note:: The Rectangular Distribution is deprecated in favour of the 136 Uniform Distribution above and is described here for backwards 137 compatibility with earlier versions of SasView only. 117 138 118 139 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 126 147 127 148 f(x) = \frac{1}{\text{Norm}} 128 \exp\left(-\frac{(x - \bar x)^2}{2\sigma^2}\right) 129 130 where $\bar x$ is the mean of the distribution and *Norm* is a normalization 131 factor which is determined during the numerical calculation. 132 133 The polydispersity is 149 \exp\left(-\frac{(x - \bar x)^2}{2\sigma^2}\right) 150 151 where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the 152 distribution and *Norm* is a normalization factor which is determined 153 during the numerical calculation. 154 155 The polydispersity in sasmodels is given by 134 156 135 157 .. math:: \text{PD} = \sigma / \bar x … … 138 160 139 161 Normal distribution. 162 163 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 164 165 Boltzmann Distribution 166 ^^^^^^^^^^^^^^^^^^^^^^ 167 168 The Boltzmann Distribution is defined as 169 170 .. math:: 171 172 f(x) = \frac{1}{\text{Norm}} 173 \exp\left(-\frac{ | x - \bar x | }{\sigma}\right) 174 175 where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the 176 distribution and *Norm* is a normalization factor which is determined 177 during the numerical calculation. 178 179 The width is defined as 180 181 .. math:: \sigma=\frac{k T}{E} 182 183 which is the inverse Boltzmann factor, where $k$ is the Boltzmann constant, 184 $T$ the temperature in Kelvin and $E$ a characteristic energy per particle. 185 186 .. figure:: pd_boltzmann.jpg 187 188 Boltzmann distribution. 140 189 141 190 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 144 193 ^^^^^^^^^^^^^^^^^^^^^^ 145 194 195 The Lognormal Distribution describes a function of $x$ where $\ln (x)$ has 196 a normal distribution. The result is a distribution that is skewed towards 197 larger values of $x$. 198 146 199 The Lognormal Distribution is defined as 147 200 148 201 .. math:: 149 202 150 f(x) = \frac{1}{\text{Norm}} 151 \frac{1}{xp}\exp\left(-\frac{(\ln(x) - \mu)^2}{2p^2}\right) 152 153 where $\mu=\ln(x_\text{med})$ when $x_\text{med}$ is the median value of the 154 distribution, and *Norm* is a normalization factor which will be determined 155 during the numerical calculation. 156 157 The median value for the distribution will be the value given for the 158 respective size parameter, for example, *radius=60*. 159 160 The polydispersity is given by $\sigma$ 161 162 .. math:: \text{PD} = p 163 164 For the angular distribution 165 166 .. math:: p = \sigma / x_\text{med} 167 168 The mean value is given by $\bar x = \exp(\mu+ p^2/2)$. The peak value 169 is given by $\max x = \exp(\mu - p^2)$. 203 f(x) = \frac{1}{\text{Norm}}\frac{1}{x\sigma} 204 \exp\left(-\frac{1}{2} 205 \bigg(\frac{\ln(x) - \mu}{\sigma}\bigg)^2\right) 206 207 where *Norm* is a normalization factor which will be determined during 208 the numerical calculation, $\mu=\ln(x_\text{med})$ and $x_\text{med}$ 209 is the *median* value of the *lognormal* distribution, but $\sigma$ is 210 a parameter describing the width of the underlying *normal* distribution. 211 212 $x_\text{med}$ will be the value given for the respective size parameter 213 in sasmodels, for example, *radius=60*. 214 215 The polydispersity in sasmodels is given by 216 217 .. math:: \text{PD} = p = \sigma / x_\text{med} 218 219 The mean value of the distribution is given by $\bar x = \exp(\mu+ p^2/2)$ 220 and the peak value by $\max x = \exp(\mu - p^2)$. 221 222 The variance (the square of the standard deviation) of the *lognormal* 223 distribution is given by 224 225 .. math:: 226 227 \nu = [\exp({\sigma}^2) - 1] \exp({2\mu + \sigma^2}) 228 229 Note that larger values of PD might need a larger number of points 230 and $N_\sigma$. 170 231 171 232 .. figure:: pd_lognormal.jpg … … 173 234 Lognormal distribution. 174 235 175 This distribution function spreads more, and the peak shifts to the left, as 176 $p$ increases, so it requires higher values of $N_\sigma$ and more points 177 in the distribution. 236 For further information on the Lognormal distribution see: 237 http://en.wikipedia.org/wiki/Log-normal_distribution and 238 http://mathworld.wolfram.com/LogNormalDistribution.html 178 239 179 240 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 182 243 ^^^^^^^^^^^^^^^^^^^ 183 244 245 The Schulz (sometimes written Schultz) distribution is similar to the 246 Lognormal distribution, in that it is also skewed towards larger values of 247 $x$, but which has computational advantages over the Lognormal distribution. 248 184 249 The Schulz distribution is defined as 185 250 186 251 .. math:: 187 252 188 f(x) = \frac{1}{\text{Norm}} 189 (z+1)^{z+1}(x/\bar x)^z\frac{\exp[-(z+1)x/\bar x]}{\bar x\Gamma(z+1)} 190 191 where $\bar x$ is the mean of the distribution and *Norm* is a normalization 192 factor which is determined during the numerical calculation, and $z$ is a 193 measure of the width of the distribution such that 253 f(x) = \frac{1}{\text{Norm}} (z+1)^{z+1}(x/\bar x)^z 254 \frac{\exp[-(z+1)x/\bar x]}{\bar x\Gamma(z+1)} 255 256 where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the 257 distribution, *Norm* is a normalization factor which is determined 258 during the numerical calculation, and $z$ is a measure of the width 259 of the distribution such that 194 260 195 261 .. math:: z = (1-p^2) / p^2 196 262 197 The polydispersity is 198 199 .. math:: p = \sigma / \bar x 200 201 Note that larger values of PD might need larger number of points and $N_\sigma$. 202 For example, at PD=0.7 and radius=60 |Ang|, Npts>=160 and Nsigmas>=15 at least. 263 where $p$ is the polydispersity in sasmodels given by 264 265 .. math:: PD = p = \sigma / \bar x 266 267 and $\sigma$ is the RMS deviation from $\bar x$. 268 269 Note that larger values of PD might need a larger number of points 270 and $N_\sigma$. For example, for PD=0.7 with radius=60 |Ang|, at least 271 Npts>=160 and Nsigmas>=15 are required. 203 272 204 273 .. figure:: pd_schulz.jpg … … 207 276 208 277 For further information on the Schulz distribution see: 209 M Kotlarchyk & S-H Chen, *J Chem Phys*, (1983), 79, 2461. 278 M Kotlarchyk & S-H Chen, *J Chem Phys*, (1983), 79, 2461 and 279 M Kotlarchyk, RB Stephens, and JS Huang, *J Phys Chem*, (1988), 92, 1533 210 280 211 281 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 237 307 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 238 308 239 Boltzmann Distribution240 ^^^^^^^^^^^^^^^^^^^^^^241 242 The Boltzmann Distribution is defined as243 244 .. math::245 246 f(x) = \frac{1}{\text{Norm}}247 \exp\left(-\frac{ | x - \bar x | }{\sigma}\right)248 249 where $\bar x$ is the mean of the distribution and *Norm* is a normalization250 factor which is determined during the numerical calculation.251 The width is defined as252 253 .. math:: \sigma=\frac{k T}{E}254 255 which is the inverse Boltzmann factor,256 where $k$ is the Boltzmann constant, $T$ the temperature in Kelvin and $E$ a257 characteristic energy per particle.258 259 .. figure:: pd_boltzmann.jpg260 261 Boltzmann distribution.262 263 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ264 265 309 Note about DLS polydispersity 266 310 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ … … 273 317 related) except when the DLS polydispersity parameter is <0.13. 274 318 319 .. math:: 320 321 p_{DLS} = \sqrt(\nu / \bar x^2) 322 323 where $\nu$ is the variance of the distribution and $\bar x$ is the mean 324 value of $x$. 325 275 326 For more information see: 276 327 S King, C Washington & R Heenan, *Phys Chem Chem Phys*, (2005), 7, 143 … … 282 333 | 2015-05-01 Steve King 283 334 | 2017-05-08 Paul Kienzle 335 | 2018-03-20 Steve King -
example/SiO2_100pc_H2O_0pc_D2O.ses
r31c64d9 rb314f89 1 name SiO2 stober 2 sample SiO2 100pcH2O 3 collimation unknown 4 ID CPD 5 Date di 27 jan 2015 18:17:50 6 Method Offspec 7 Thickness [mm] 1 8 z-acceptance [nm^-1] 0.3 9 y-acceptance [nm^-1] 0.3 1 FileFormatVersion 1.0 2 DataFileTitle SiO2 stober 3 Sample SiO2 100pcH2O 4 collimation unknown 5 ID CPD 6 Date di 27 jan 2015 18:17:50 7 Method Offspec 8 Thickness 1 9 Thickness_unit mm 10 Theta_zmax 0.0100 11 Theta_zmax_unit radians 12 Theta_ymax 0.0100 13 Theta_ymax_unit radians 14 Orientation Z 15 SpinEchoLength_unit A 16 Depolarisation_unit A-2 cm-1 17 Wavelength_unit A 10 18 11 spin echo length [nm] error spin-echo length wavelength [nm] error wavelength Sample P Sample P -error 12 244.098 5 0.220907401 0.006627222 0.96321 0.0113507 0.029882023 29.882023 13 340.136 5 0.260768096 0.007823043 0.973305 0.0034846 0.085257531 85.257531 14 452.181 5 0.300665994 0.00901998 0.951588 0.00287498 0.140798634 140.798634 15 580.232 5 0.340587727 0.010217632 0.911935 0.00310965 0.196560502 196.560502 16 724.29 5 0.380526057 0.011415782 0.856129 0.00356166 0.252528125 252.528125 17 884.354 5 0.420476016 0.01261428 0.78817 0.0036651 0.308729274 308.729274 18 1060.42 5 0.460433709 0.013813011 0.719608 0.00386121 0.365037117 365.037117 19 1252.5 5 0.50039968 0.01501199 0.653424 0.00418035 0.421684677 421.684677 20 1460.58 5 0.540369504 0.016211085 0.603456 0.00472218 0.478564852 478.564852 21 1684.67 5 0.580344105 0.017410323 0.558174 0.00537231 0.535715521 535.715521 22 1924.77 5 0.620322561 0.018609677 0.532672 0.00617699 0.59324408 593.24408 23 2180.87 5 0.660302658 0.01980908 0.505018 0.00707792 0.650985498 650.985498 24 2452.98 5 0.700285542 0.021008566 0.475536 0.00829962 0.709203958 709.203958 25 2741.1 5 0.740270761 0.022208123 0.440819 0.00957178 0.767809943 767.809943 26 3045.22 5 0.780256676 0.0234077 0.397642 0.0111225 0.826762925 826.762925 27 3365.35 5 0.820244402 0.024607332 0.363717 0.0132055 0.886302296 886.302296 28 3701.48 5 0.860232527 0.025806976 0.302206 0.0158338 0.946236366 946.236366 29 4053.62 5 0.900222106 0.027006663 0.302188 0.0204351 1.006784115 1006.784115 30 4421.77 5 0.940212955 0.028206389 0.263252 0.0264158 1.067891213 1067.891213 31 4805.92 5 0.980203897 0.029406117 0.230149 0.0339972 1.129598722 1129.598722 32 5206.08 5 1.020195903 0.030605877 0.268749 0.0480167 1.192022694 1192.022694 33 5622.25 5 1.060188851 0.031805666 0.340439 0.0701945 1.255271282 1255.271282 34 6054.42 5 1.10018173 0.033005452 0.238197 0.0986631 1.319307134 1319.307134 35 6502.6 5 1.140175425 0.034205263 0.0985987 0.170273 1.384197821 1384.197821 36 6966.79 5 1.180169852 0.035405096 0.0814573 0.256765 1.448518618 1448.518618 19 BEGIN_DATA 20 SpinEchoLength Depolarisation Depolarisation_error Wavelength Wavelength_error SpinEchoLength_error Polarisation Polarisation_error 21 2440.98 -7.6810986e-3 2.4147998e-3 2.20907401 0.06627222 50 0.96321 0.0113507 22 3401.36 -3.9790857e-3 5.2649599e-4 2.60768096 0.07823043 50 0.973305 0.0034846 23 4521.81 -5.4892798e-3 3.3420831e-4 3.00665994 0.0901998 50 0.951588 0.00287498 24 5802.32 -7.9471175e-3 2.9396095e-4 3.40587727 0.10217632 50 0.911935 0.00310965 25 7242.9 -0.010727495 2.8730584e-4 3.80526057 0.11415782 50 0.856129 0.00356166 26 8843.54 -0.013463878 2.6301679e-4 4.20476016 0.1261428 50 0.78817 0.0036651 27 10604.2 -0.015521222 2.5310062e-4 4.60433709 0.13813011 50 0.719608 0.00386121 28 12525. -0.016993983 2.5549565e-4 5.0039968 0.1501199 50 0.653424 0.00418035 29 14605.8 -0.017297381 2.6798795e-4 5.40369504 0.16211085 50 0.603456 0.00472218 30 16846.7 -0.017312523 2.8577242e-4 5.80344105 0.17410323 50 0.558174 0.00537231 31 19247.7 -0.016368225 3.0135741e-4 6.20322561 0.18609677 50 0.532672 0.00617699 32 21808.7 -0.015668849 3.2144946e-4 6.60302658 0.1980908 50 0.505018 0.00707792 33 24529.8 -0.015157278 3.5589713e-4 7.00285542 0.21008566 50 0.475536 0.00829962 34 27411. -0.014947440 3.9623352e-4 7.40270761 0.22208123 50 0.440819 0.00957178 35 30452.2 -0.015147872 4.5944674e-4 7.80256676 0.234077 50 0.397642 0.0111225 36 33653.5 -0.015032370 5.3964070e-4 8.20244402 0.24607332 50 0.363717 0.0132055 37 37014.8 -0.016170897 7.0802787e-4 8.60232527 0.25806976 50 0.302206 0.0158338 38 40536.2 -0.014766858 8.3444978e-4 9.00222106 0.27006663 50 0.302188 0.0204351 39 44217.7 -0.015097771 1.1351144e-3 9.40212955 0.28206389 50 0.263252 0.0264158 40 48059.2 -0.015289642 1.5374507e-3 9.80203897 0.29406117 50 0.230149 0.0339972 41 52060.8 -0.012624691 1.7166363e-3 10.20195903 0.30605877 50 0.268749 0.0480167 42 56222.5 -9.5864674e-3 1.8344138e-3 10.60188851 0.31805666 50 0.340439 0.0701945 43 60544.2 -0.011852755 3.4220757e-3 11.0018173 0.33005452 50 0.238197 0.0986631 44 65026. -0.017820748 0.013284073 11.40175425 0.34205263 50 0.0985987 0.170273 45 69667.9 -0.018004557 0.022631679 11.80169852 0.35405096 50 0.0814573 0.256765 -
example/core_shell.ses
r5be92e8 re0721e7 1 name se009051.dat 2 sample "SiO2 pH=6 & NiO pH=10, nanosized, in D2O, Sine ++ only." 3 collimation "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. " 4 ID CPD 5 Date di 27 jan 2015 18:17:50 6 Method sine one element scan 7 Thickness [mm] 2 8 z-acceptance [nm^-1] 0.3 9 y-acceptance [nm^-1] 0.3 1 FileFormatVersion 1.0 2 DataFileTitle se009051.dat 3 Sample "SiO2 pH=6 & NiO pH=10, nanosized, in D2O, Sine ++ only." 4 collimation "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. " 5 ID CPD 6 Date di 27 jan 2015 18:17:50 7 Method sine one element scan 8 Thickness 10 9 Thickness_unit mm 10 Theta_zmax 0.0168 11 Theta_zmax_unit radians 12 Theta_ymax 0.0168 13 Theta_ymax_unit radians 14 Orientation Z 15 SpinEchoLength_unit A 16 Depolarisation_unit A-2 cm-1 17 Wavelength_unit A 10 18 11 spin echo length [um] error spin-echo length wavelength [nm] error wavelength Sample 5 Sample 5 -error 12 26 5 0.161245 0.01 0.996315 0.00528445 0.161245 26 13 28.08 5 0.167571 0.01 0.995937 0.00522962 0.167571 28.08 14 30.3264 5 0.174145 0.01 0.995039 0.00371164 0.174145 30.3264 15 32.7525 5 0.180977 0.01 0.99448 0.00381089 0.180977 32.7525 16 35.3727 5 0.188076 0.01 0.992143 0.00319011 0.188076 35.3727 17 38.2025 5 0.195455 0.01 0.991403 0.0032496 0.195455 38.2025 18 41.2587 5 0.203122 0.01 0.990106 0.002978 0.203122 41.2587 19 44.5594 5 0.211091 0.01 0.98857 0.00297338 0.211091 44.5594 20 48.1242 5 0.219372 0.01 0.986236 0.00286669 0.219372 48.1242 21 51.9741 5 0.227978 0.01 0.982739 0.00283988 0.227978 51.9741 22 56.132 5 0.236922 0.01 0.979995 0.00287147 0.236922 56.132 23 60.6226 5 0.246217 0.01 0.976516 0.00290667 0.246217 60.6226 24 65.4724 5 0.255876 0.01 0.971858 0.00300969 0.255876 65.4724 25 70.7102 5 0.265914 0.01 0.967518 0.00310597 0.265914 70.7102 26 76.367 5 0.276346 0.01 0.963198 0.00310409 0.276346 76.367 27 82.4764 5 0.287187 0.01 0.957071 0.00306271 0.287187 82.4764 28 89.0745 5 0.298454 0.01 0.952784 0.00299587 0.298454 89.0745 29 96.2005 5 0.310162 0.01 0.947462 0.0029896 0.310162 96.2005 30 103.897 5 0.322331 0.01 0.941226 0.00300217 0.322331 103.897 31 112.208 5 0.334975 0.01 0.936151 0.00305677 0.334975 112.208 32 121.185 5 0.348116 0.01 0.930884 0.00307969 0.348116 121.185 33 130.88 5 0.361773 0.01 0.927992 0.00316999 0.361773 130.88 34 141.35 5 0.375965 0.01 0.926511 0.00326096 0.375965 141.35 35 152.658 5 0.390715 0.01 0.925098 0.00340349 0.390715 152.658 36 164.871 5 0.406043 0.01 0.924369 0.0035662 0.406043 164.871 37 178.06 5 0.421972 0.01 0.925632 0.00372489 0.421972 178.06 38 192.305 5 0.438526 0.01 0.922762 0.00390394 0.438526 192.305 39 207.69 5 0.45573 0.01 0.918753 0.00412162 0.45573 207.69 40 224.305 5 0.473608 0.01 0.90663 0.0043316 0.473608 224.305 41 242.249 5 0.492188 0.01 0.893251 0.00454417 0.492188 242.249 42 261.629 5 0.511497 0.01 0.878299 0.00473364 0.511497 261.629 43 282.559 5 0.531563 0.01 0.867266 0.00497459 0.531563 282.559 44 305.164 5 0.552417 0.01 0.859537 0.00521977 0.552417 305.164 45 329.577 5 0.574088 0.01 0.855935 0.0055573 0.574088 329.577 46 355.943 5 0.59661 0.01 0.851389 0.00581848 0.59661 355.943 47 384.419 5 0.620015 0.01 0.836311 0.00620483 0.620015 384.419 48 415.172 5 0.644338 0.01 0.821362 0.00668373 0.644338 415.172 49 448.386 5 0.669616 0.01 0.803833 0.0071725 0.669616 448.386 50 484.257 5 0.695886 0.01 0.792211 0.00786449 0.695886 484.257 51 522.998 5 0.723186 0.01 0.787407 0.00860688 0.723186 522.998 52 564.838 5 0.751557 0.01 0.765977 0.00938856 0.751557 564.838 53 610.025 5 0.781041 0.01 0.746618 0.0101567 0.781041 610.025 54 658.827 5 0.811682 0.01 0.734672 0.0110357 0.811682 658.827 55 711.533 5 0.843524 0.01 0.720351 0.0118912 0.843524 711.533 56 768.455 5 0.876616 0.01 0.692587 0.0130927 0.876616 768.455 57 829.932 5 0.911006 0.01 0.674767 0.0137763 0.911006 829.932 58 896.326 5 0.946745 0.01 0.664497 0.0148902 0.946745 896.326 59 968.032 5 0.983886 0.01 0.634464 0.0158459 0.983886 968.032 60 1045.47 5 1.02248 0.01 0.604792 0.0166925 1.02248 1045.47 61 1129.11 5 1.0626 0.01 0.591534 0.0179667 1.0626 1129.11 62 1219.44 5 1.10428 0.01 0.582625 0.0198223 1.10428 1219.44 63 1317 5 1.14761 0.01 0.549232 0.0217725 1.14761 1317 64 1422.36 5 1.19263 0.01 0.53863 0.024516 1.19263 1422.36 65 1536.15 5 1.23942 0.01 0.521353 0.0281108 1.23942 1536.15 66 1659.04 5 1.28804 0.01 0.460045 0.0314452 1.28804 1659.04 67 1791.76 5 1.33857 0.01 0.411185 0.0366899 1.33857 1791.76 68 1930.34 5 1.38937 0.01 0.414685 0.0478689 1.38937 1930.34 19 BEGIN_DATA 20 SpinEchoLength SpinEchoLength_error Wavelength Wavelength_Error Polarisation Polarisation_error Depolarisation Depolarisation_error 21 298.82023 50 2.095 0.1 0.997817556 0.00887342 -4.9779370e-5 2.0261512e-4 22 852.57531 50 2.095 0.1 1.0026184 0.009572307 5.9579929e-5 2.1752686e-4 23 1407.9863 50 2.095 0.1 0.996013172 0.012119508 -9.1017859e-5 2.7723742e-4 24 1965.6050 50 2.095 0.1 0.991752656 0.011651473 -1.8868750e-4 2.6767598e-4 25 2525.2813 50 2.095 0.1 0.995429571 0.012193294 -1.0437182e-4 2.7908883e-4 26 3087.2927 50 2.095 0.1 0.995119819 0.009621277 -1.1146275e-4 2.2028721e-4 27 3650.3712 50 2.095 0.1 0.997497767 0.012518842 -5.7082583e-5 2.8594610e-4 28 4216.8468 50 2.095 0.1 0.994733865 0.010585926 -1.2030120e-4 2.4246770e-4 29 4785.6485 50 2.095 0.1 0.992696275 0.010677724 -1.6701950e-4 2.4507231e-4 30 5357.1552 50 2.095 0.1 0.994534294 0.012909556 -1.2487278e-4 2.9574914e-4 31 5932.4408 50 2.095 0.1 0.986412268 0.014651894 -3.1170682e-4 3.3842875e-4 32 6509.8550 50 2.095 0.1 0.988788566 0.015736468 -2.5688520e-4 3.6260666e-4 33 7092.0396 50 2.095 0.1 0.989501168 0.013611615 -2.4047103e-4 3.1341898e-4 34 7678.0994 50 2.095 0.1 0.99203933 0.016501891 -1.8210252e-4 3.7899787e-4 35 8267.6293 50 2.095 0.1 0.994062723 0.010276207 -1.3567871e-4 2.3553259e-4 36 8863.0230 50 2.095 0.1 0.979647192 0.011089421 -4.6850452e-4 2.5791174e-4 37 9462.3637 50 2.095 0.1 0.97982075 0.013168527 -4.6446835e-4 3.0621222e-4 38 10067.841 50 2.095 0.1 0.977927712 0.014362819 -5.0853039e-4 3.3463000e-4 39 10678.912 50 2.095 0.1 0.978351462 0.013239476 -4.9865985e-4 3.0832436e-4 40 11295.987 50 2.095 0.1 0.981246471 0.013896898 -4.3133968e-4 3.2267975e-4 41 11920.227 50 2.095 0.1 0.978275164 0.013747481 -5.0043677e-4 3.2017989e-4 42 12552.713 50 2.095 0.1 0.976818842 0.013487944 -5.3437989e-4 3.1460359e-4 43 13193.071 50 2.095 0.1 0.981546068 0.011972943 -4.2438423e-4 2.7792152e-4 44 13841.978 50 2.095 0.1 0.96445854 0.013357572 -8.2452102e-4 3.1555561e-4 45 14500.513 50 2.095 0.1 0.972756158 0.014756189 -6.2933879e-4 3.4562263e-4 46 15169.786 50 2.095 0.1 0.971010184 0.014210504 -6.7027011e-4 3.3343996e-4 47 15850.446 50 2.095 0.1 0.975009829 0.013648839 -5.7661387e-4 3.1894710e-4 48 16543.562 50 2.095 0.1 0.969575209 0.014454336 -7.0396574e-4 3.3966327e-4 49 17249.754 50 2.095 0.1 0.959907267 0.012806944 -9.3229353e-4 3.0398222e-4 50 17969.627 50 2.095 0.1 0.96219203 0.011845496 -8.7812744e-4 2.8049391e-4 51 18706.130 50 2.095 0.1 0.960157966 0.011721155 -9.2634378e-4 2.7813758e-4 52 19459.212 50 2.095 0.1 0.95089937 0.009967287 -1.1471121e-3 2.3882201e-4 53 20230.984 50 2.095 0.1 0.955584642 0.01104368 -1.0351259e-3 2.6331561e-4 54 21021.899 50 2.095 0.1 0.950786938 0.011651582 -1.1498062e-3 2.7921171e-4 55 21835.345 50 2.095 0.1 0.951403607 0.008784149 -1.1350335e-3 2.1036178e-4 56 22671.730 50 2.095 0.1 0.94561823 0.009392383 -1.2740040e-3 2.2630383e-4 57 23533.930 50 2.095 0.1 0.945882787 0.009468264 -1.2676305e-3 2.2806833e-4 58 24423.504 50 2.095 0.1 0.939583158 0.009164239 -1.4198814e-3 2.2222511e-4 59 25343.343 50 2.095 0.1 0.93731257 0.008621568 -1.4750079e-3 2.0957224e-4 60 26294.734 50 2.095 0.1 0.936639557 0.010408821 -1.4913733e-3 2.5319842e-4 61 27282.004 50 2.095 0.1 0.932091884 0.007112674 -1.6022666e-3 1.7386258e-4 62 28307.499 50 2.095 0.1 0.933852763 0.009200431 -1.5592642e-3 2.2447176e-4 63 29373.630 50 2.095 0.1 0.930283437 0.01022719 -1.6465153e-3 2.5047996e-4 64 30485.110 50 2.095 0.1 0.930121334 0.007055747 -1.6504858e-3 1.7283645e-4 65 31645.899 50 2.095 0.1 0.925944326 0.0078917 -1.7530356e-3 1.9418588e-4 66 32858.438 50 2.095 0.1 0.92351759 0.005522582 -1.8128270e-3 1.3624763e-4 67 34128.058 50 2.095 0.1 0.918228311 0.006917328 -1.9436940e-3 1.7164045e-4 68 35460.168 50 2.095 0.1 0.908621563 0.006852313 -2.1833230e-3 1.7182490e-4 69 36858.762 50 2.095 0.1 0.919087792 0.006995961 -1.9223776e-3 1.7342924e-4 70 38331.748 50 2.095 0.1 0.910132214 0.006107336 -2.1454742e-3 1.5289007e-4 71 39882.345 50 2.095 0.1 0.904491462 0.007078101 -2.2871233e-3 1.7829708e-4 72 41519.404 50 2.095 0.1 0.90056919 0.005934428 -2.3861400e-3 1.5013907e-4 73 43249.023 50 2.095 0.1 0.903155701 0.006249069 -2.3207959e-3 1.5764661e-4 74 45079.637 50 2.095 0.1 0.894919827 0.006196232 -2.5295172e-3 1.5775222e-4 75 47019.670 50 2.095 0.1 0.896358908 0.007324999 -2.4929085e-3 1.8619052e-4 76 49077.851 50 2.095 0.1 0.88807923 0.004530465 -2.7043436e-3 1.1623128e-4 77 51264.711 50 2.095 0.1 0.886649039 0.008924412 -2.7410654e-3 2.2932944e-4 78 53590.598 50 2.095 0.1 0.882051947 0.006055081 -2.8595036e-3 1.5640756e-4 79 56067.403 50 2.095 0.1 0.882573371 0.005727419 -2.8460388e-3 1.4785638e-4 80 58709.036 50 2.095 0.1 0.876289825 0.006062306 -3.0088321e-3 1.5762389e-4 81 61527.362 50 2.095 0.1 0.877318199 0.005307783 -2.9821094e-3 1.3784403e-4 82 64538.932 50 2.095 0.1 0.873610284 0.006918104 -3.0786086e-3 1.8042690e-4 83 67758.354 50 2.095 0.1 0.865954455 0.005625863 -3.2791557e-3 1.4802192e-4 84 71205.306 50 2.095 0.1 0.868037308 0.008662141 -3.2244196e-3 2.2736248e-4 85 74897.359 50 2.095 0.1 0.86676404 0.005761209 -3.2578647e-3 1.5144143e-4 86 78855.560 50 2.095 0.1 0.85655072 0.005731411 -3.5279304e-3 1.5245456e-4 87 83102.902 50 2.095 0.1 0.857936274 0.006954572 -3.4911046e-3 1.8469168e-4 88 87663.154 50 2.095 0.1 0.85520525 0.006559622 -3.5637478e-3 1.7475934e-4 89 92562.717 50 2.095 0.1 0.849739829 0.008907377 -3.7098230e-3 2.3883381e-4 90 97830.316 50 2.095 0.1 0.841487161 0.006547659 -3.9321836e-3 1.7728439e-4 91 103497.14 50 2.095 0.1 0.84801051 0.007574866 -3.7562386e-3 2.0351933e-4 92 109596.79 50 2.095 0.1 0.843342861 0.006411993 -3.8819940e-3 1.7322909e-4 93 116165.97 50 2.095 0.1 0.837488454 0.008141353 -4.0407107e-3 2.2148775e-4 94 123244.47 50 2.095 0.1 0.839214922 0.009987535 -3.9937900e-3 2.7115465e-4 95 130874.72 50 2.095 0.1 0.834336972 0.011467406 -4.1266093e-3 3.1315233e-4 96 139102.96 50 2.095 0.1 0.828775634 0.012483365 -4.2789870e-3 3.4318369e-4 97 147980.51 50 2.095 0.1 0.823088812 0.016035848 -4.4358638e-3 4.4389186e-4 98 157560.98 50 2.095 0.1 0.824329178 0.014838138 -4.4015548e-3 4.1011975e-4 99 167904.68 50 2.095 0.1 0.82023172 0.015286187 -4.5150892e-3 4.2461424e-4 100 179076.29 50 2.095 0.1 0.827559752 0.012612741 -4.3124376e-3 3.4724985e-4 -
example/se008724_01.ses
r42ade62 rb314f89 1 DataFileTitle Polystyrene of Markus Strobl, Full Sine, ++ only 2 Sample Polystyrene 2 um in 53% H2O, 47% D2O 3 Settings D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast 4 Operator CPD 5 Date ma 7 jul 2014 18:54:43 6 ScanType sine one element scan 7 Thickness [mm] 2 8 Q_zmax [\AA^-1] 0.05 9 Q_ymax [\AA^-1] 0.05 10 11 spin echo length [nm] error SEL wavelength [nm] error wavelength polarisation error pol 12 49.778 2.4889 0.211 0.01055 0.99782 0.0044367 13 63.041 3.152 0.211 0.01055 1.0026 0.0047862 14 76.487 3.8244 0.211 0.01055 0.99601 0.0060598 15 89.847 4.4924 0.211 0.01055 0.99175 0.0058257 16 103.41 5.1705 0.211 0.01055 0.99543 0.0060966 17 116.95 5.8475 0.211 0.01055 0.99512 0.0048106 18 130.61 6.5303 0.211 0.01055 0.9975 0.0062594 19 144.37 7.2184 0.211 0.01055 0.99473 0.005293 20 158.2 7.9102 0.211 0.01055 0.9927 0.0053389 21 172.12 8.6062 0.211 0.01055 0.99453 0.0064548 22 186.17 9.3087 0.211 0.01055 0.98641 0.0073259 23 200.28 10.014 0.211 0.01055 0.98879 0.0078682 24 214.46 10.723 0.211 0.01055 0.9895 0.0068058 25 228.73 11.436 0.211 0.01055 0.99204 0.0082509 26 243.12 12.156 0.211 0.01055 0.99406 0.0051381 27 257.55 12.878 0.211 0.01055 0.97965 0.0055447 28 272.22 13.611 0.211 0.01055 0.97982 0.0065843 29 286.9 14.345 0.211 0.01055 0.97793 0.0071814 30 301.73 15.087 0.211 0.01055 0.97835 0.0066197 31 316.75 15.838 0.211 0.01055 0.98125 0.0069484 32 331.82 16.591 0.211 0.01055 0.97828 0.0068737 33 347.16 17.358 0.211 0.01055 0.97682 0.006744 34 362.45 18.122 0.211 0.01055 0.98155 0.0059865 35 378.09 18.904 0.211 0.01055 0.96446 0.0066788 36 393.74 19.687 0.211 0.01055 0.97276 0.0073781 37 409.61 20.481 0.211 0.01055 0.97101 0.0071053 38 425.55 21.278 0.211 0.01055 0.97501 0.0068244 39 441.91 22.096 0.211 0.01055 0.96958 0.0072272 40 458.12 22.906 0.211 0.01055 0.95991 0.0064035 41 474.77 23.739 0.211 0.01055 0.96219 0.0059227 42 491.52 24.576 0.211 0.01055 0.96016 0.0058606 43 508.51 25.426 0.211 0.01055 0.9509 0.0049836 44 525.68 26.284 0.211 0.01055 0.95558 0.0055218 45 543.08 27.154 0.211 0.01055 0.95079 0.0058258 46 560.74 28.037 0.211 0.01055 0.9514 0.0043921 47 578.69 28.935 0.211 0.01055 0.94562 0.0046962 48 596.75 29.838 0.211 0.01055 0.94588 0.0047341 49 615.17 30.758 0.211 0.01055 0.93958 0.0045821 50 633.77 31.688 0.211 0.01055 0.93731 0.0043108 51 652.82 32.641 0.211 0.01055 0.93664 0.0052044 52 672.04 33.602 0.211 0.01055 0.93209 0.0035563 53 691.57 34.578 0.211 0.01055 0.93385 0.0046002 54 711.48 35.574 0.211 0.01055 0.93028 0.0051136 55 731.67 36.583 0.211 0.01055 0.93012 0.0035279 56 752.17 37.608 0.211 0.01055 0.92594 0.0039458 57 773.1 38.655 0.211 0.01055 0.92352 0.0027613 58 794.42 39.721 0.211 0.01055 0.91823 0.0034587 59 816.14 40.807 0.211 0.01055 0.90862 0.0034262 60 838.19 41.91 0.211 0.01055 0.91909 0.003498 61 860.69 43.034 0.211 0.01055 0.91013 0.0030537 62 883.74 44.187 0.211 0.01055 0.90449 0.0035391 63 907.04 45.352 0.211 0.01055 0.90057 0.0029672 64 930.95 46.547 0.211 0.01055 0.90316 0.0031245 65 955.38 47.769 0.211 0.01055 0.89492 0.0030981 66 980.25 49.013 0.211 0.01055 0.89636 0.0036625 67 1005.7 50.284 0.211 0.01055 0.88808 0.0022652 68 1031.7 51.586 0.211 0.01055 0.88665 0.0044622 69 1058.3 52.914 0.211 0.01055 0.88205 0.0030275 70 1085.5 54.276 0.211 0.01055 0.88257 0.0028637 71 1113.4 55.669 0.211 0.01055 0.87629 0.0030312 72 1141.9 57.093 0.211 0.01055 0.87732 0.0026539 73 1171 58.55 0.211 0.01055 0.87361 0.0034591 74 1201 60.052 0.211 0.01055 0.86595 0.0028129 75 1231.6 61.582 0.211 0.01055 0.86804 0.0043311 76 1263 63.151 0.211 0.01055 0.86676 0.0028806 77 1295.2 64.762 0.211 0.01055 0.85655 0.0028657 78 1328.4 66.419 0.211 0.01055 0.85794 0.0034773 79 1362.3 68.113 0.211 0.01055 0.85521 0.0032798 80 1397.1 69.854 0.211 0.01055 0.84974 0.0044537 81 1432.9 71.644 0.211 0.01055 0.84149 0.0032738 82 1469.7 73.487 0.211 0.01055 0.84801 0.0037874 83 1507.5 75.376 0.211 0.01055 0.84334 0.003206 84 1546.4 77.318 0.211 0.01055 0.83749 0.0040707 85 1586.4 79.322 0.211 0.01055 0.83921 0.0049938 86 1627.6 81.381 0.211 0.01055 0.83434 0.0057337 87 1669.9 83.497 0.211 0.01055 0.82878 0.0062417 88 1713.6 85.678 0.211 0.01055 0.82309 0.0080179 89 1758.5 87.927 0.211 0.01055 0.82433 0.0074191 90 1804.8 90.239 0.211 0.01055 0.82023 0.0076431 91 1852.5 92.627 0.211 0.01055 0.82756 0.0063064 92 1901.7 95.087 0.211 0.01055 0.82584 0.0052944 93 1952.4 97.622 0.211 0.01055 0.82799 0.0050662 94 2004.8 100.24 0.211 0.01055 0.82345 0.0043127 95 2058.8 102.94 0.211 0.01055 0.82296 0.0038 96 2114.5 105.72 0.211 0.01055 0.81987 0.0034072 97 2172 108.6 0.211 0.01055 0.82021 0.0036752 98 2231.4 111.57 0.211 0.01055 0.82765 0.0028851 99 2292.8 114.64 0.211 0.01055 0.82664 0.0038942 100 2356.2 117.81 0.211 0.01055 0.82702 0.0047371 101 2421.8 121.09 0.211 0.01055 0.81593 0.0043772 102 2489.6 124.48 0.211 0.01055 0.8251 0.0028026 103 2559.5 127.98 0.211 0.01055 0.8292 0.0024574 104 2631.9 131.59 0.211 0.01055 0.82626 0.0036198 105 2706.8 135.34 0.211 0.01055 0.8208 0.0032314 106 2784.3 139.22 0.211 0.01055 0.81959 0.0042731 107 2864.5 143.23 0.211 0.01055 0.82653 0.002699 108 2947.5 147.38 0.211 0.01055 0.82401 0.0036726 109 3033.5 151.67 0.211 0.01055 0.82361 0.0048224 110 3122.4 156.12 0.211 0.01055 0.82358 0.0041221 111 3214.5 160.73 0.211 0.01055 0.82187 0.0028807 112 3310.1 165.5 0.211 0.01055 0.82644 0.003516 113 3409 170.45 0.211 0.01055 0.82355 0.0021166 114 3511.4 175.57 0.211 0.01055 0.82513 0.0033911 115 3617.6 180.88 0.211 0.01055 0.82802 0.0015342 116 3727.6 186.38 0.211 0.01055 0.82663 0.0029222 117 3841.7 192.08 0.211 0.01055 0.82026 0.0020755 118 3960 198 0.211 0.01055 0.83079 0.0026394 119 4082.7 204.13 0.211 0.01055 0.82665 0.0027466 120 4209.9 210.5 0.211 0.01055 0.82774 0.0025199 121 4341.9 217.09 0.211 0.01055 0.83489 0.0030619 122 4478.7 223.94 0.211 0.01055 0.81987 0.0020988 123 4620.8 231.04 0.211 0.01055 0.8253 0.0023899 124 4768.2 238.41 0.211 0.01055 0.82653 0.0022851 125 4921.1 246.06 0.211 0.01055 0.82442 0.003383 126 5079.8 253.99 0.211 0.01055 0.82827 0.0015979 127 5244.7 262.23 0.211 0.01055 0.82494 0.0031129 128 5415.7 270.79 0.211 0.01055 0.82183 0.0030149 129 5593.3 279.67 0.211 0.01055 0.83217 0.0046976 130 5777.8 288.89 0.211 0.01055 0.82227 0.005574 131 5969.3 298.46 0.211 0.01055 0.82338 0.0025569 1 FileFormatVersion 1.0 2 DataFileTitle Polystyrene of Markus Strobl, Full Sine, ++ only 3 Sample Polystyrene 2 um in 53% H2O, 47% D2O 4 Settings D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast 5 Operator CPD 6 Date ma 7 jul 2014 18:54:43 7 ScanType sine one element scan 8 Thickness 2 9 Thickness_unit mm 10 Theta_zmax 0.0168 11 Theta_zmax_unit radians 12 Theta_ymax 0.0168 13 Theta_ymax_unit radians 14 Orientation Z 15 SpinEchoLength_unit A 16 Depolarisation_unit A-2 cm-1 17 Wavelength_unit A 18 19 BEGIN_DATA 20 SpinEchoLength Depolarisation Depolarisation_error Wavelength Wavelength_error SpinEchoLength_error Polarisation Polarisation_error 21 497.78 -2.4509553e-4 4.9935908e-4 2.11 0.1055 24.889 0.99782 0.0044367 22 630.41 2.9161810e-4 5.3612769e-4 2.11 0.1055 31.52 1.0026 0.0047862 23 764.87 -4.4899949e-4 6.8328154e-4 2.11 0.1055 38.244 0.99601 0.0060598 24 898.47 -9.3037214e-4 6.5970686e-4 2.11 0.1055 44.924 0.99175 0.0058257 25 1034.1 -5.1441728e-4 6.8783151e-4 2.11 0.1055 51.705 0.99543 0.0060966 26 1169.5 -5.4939760e-4 5.4291131e-4 2.11 0.1055 58.475 0.99512 0.0048106 27 1306.1 -2.8111792e-4 7.0473347e-4 2.11 0.1055 65.303 0.9975 0.0062594 28 1443.7 -5.9342057e-4 5.9758787e-4 2.11 0.1055 72.184 0.99473 0.005293 29 1582. -8.2284488e-4 6.0400267e-4 2.11 0.1055 79.102 0.9927 0.0053389 30 1721.2 -6.1600315e-4 7.2890343e-4 2.11 0.1055 86.062 0.99453 0.0064548 31 1861.7 -1.5367118e-3 8.3408174e-4 2.11 0.1055 93.087 0.98641 0.0073259 32 2002.8 -1.2660661e-3 8.9366844e-4 2.11 0.1055 100.14 0.98879 0.0078682 33 2144.6 -1.1854534e-3 7.7244662e-4 2.11 0.1055 107.23 0.9895 0.0068058 34 2287.3 -8.9753711e-4 9.3406529e-4 2.11 0.1055 114.36 0.99204 0.0082509 35 2431.2 -6.6909009e-4 5.8049041e-4 2.11 0.1055 121.56 0.99406 0.0051381 36 2575.5 -2.3090130e-3 6.3564144e-4 2.11 0.1055 128.78 0.97965 0.0055447 37 2722.2 -2.2895260e-3 7.5468967e-4 2.11 0.1055 136.11 0.97982 0.0065843 38 2869. -2.5063662e-3 8.2471984e-4 2.11 0.1055 143.45 0.97793 0.0071814 39 3017.3 -2.4581433e-3 7.5988724e-4 2.11 0.1055 150.87 0.97835 0.0066197 40 3167.5 -2.1257395e-3 7.9526201e-4 2.11 0.1055 158.38 0.98125 0.0069484 41 3318.2 -2.4661790e-3 7.8910082e-4 2.11 0.1055 165.91 0.97828 0.0068737 42 3471.6 -2.6339122e-3 7.7536843e-4 2.11 0.1055 173.58 0.97682 0.006744 43 3624.5 -2.0914090e-3 6.8496070e-4 2.11 0.1055 181.22 0.98155 0.0059865 44 3780.9 -4.0640282e-3 7.7771292e-4 2.11 0.1055 189.04 0.96446 0.0066788 45 3937.4 -3.1016697e-3 8.5181234e-4 2.11 0.1055 196.87 0.97276 0.0073781 46 4096.1 -3.3038917e-3 8.2179560e-4 2.11 0.1055 204.81 0.97101 0.0071053 47 4255.5 -2.8422039e-3 7.8606869e-4 2.11 0.1055 212.78 0.97501 0.0068244 48 4419.1 -3.4694067e-3 8.3712733e-4 2.11 0.1055 220.96 0.96958 0.0072272 49 4581.2 -4.5951067e-3 7.4919003e-4 2.11 0.1055 229.06 0.95991 0.0064035 50 4747.7 -4.3286699e-3 6.9129591e-4 2.11 0.1055 237.39 0.96219 0.0059227 51 4915.2 -4.5658612e-3 6.8549385e-4 2.11 0.1055 245.76 0.96016 0.0058606 52 5085.1 -5.6542277e-3 5.8859074e-4 2.11 0.1055 254.26 0.9509 0.0049836 53 5256.8 -5.1028496e-3 6.4896117e-4 2.11 0.1055 262.84 0.95558 0.0055218 54 5430.8 -5.6672201e-3 6.8813882e-4 2.11 0.1055 271.54 0.95079 0.0058258 55 5607.4 -5.5951905e-3 5.1845870e-4 2.11 0.1055 280.37 0.9514 0.0043921 56 5786.9 -6.2795627e-3 5.5774416e-4 2.11 0.1055 289.35 0.94562 0.0046962 57 5967.5 -6.2486880e-3 5.6209080e-4 2.11 0.1055 298.38 0.94588 0.0047341 58 6151.7 -6.9992040e-3 5.4769136e-4 2.11 0.1055 307.58 0.93958 0.0045821 59 6337.7 -7.2708619e-3 5.1651117e-4 2.11 0.1055 316.88 0.93731 0.0043108 60 6528.2 -7.3511686e-3 6.2402654e-4 2.11 0.1055 326.41 0.93664 0.0052044 61 6720.4 -7.8980596e-3 4.2849488e-4 2.11 0.1055 336.02 0.93209 0.0035563 62 6915.7 -7.6861990e-3 5.5322868e-4 2.11 0.1055 345.78 0.93385 0.0046002 63 7114.8 -8.1163566e-3 6.1733111e-4 2.11 0.1055 355.74 0.93028 0.0051136 64 7316.7 -8.1356741e-3 4.2597330e-4 2.11 0.1055 365.83 0.93012 0.0035279 65 7521.7 -8.6415221e-3 4.7858305e-4 2.11 0.1055 376.08 0.92594 0.0039458 66 7731. -8.9354263e-3 3.3579357e-4 2.11 0.1055 386.55 0.92352 0.0027613 67 7944.2 -9.5805772e-3 4.2302546e-4 2.11 0.1055 397.21 0.91823 0.0034587 68 8161.4 -0.010762148 4.2348254e-4 2.11 0.1055 408.07 0.90862 0.0034262 69 8381.9 -9.4754418e-3 4.2743183e-4 2.11 0.1055 419.1 0.91909 0.003498 70 8606.9 -0.010575665 3.7681487e-4 2.11 0.1055 430.34 0.91013 0.0030537 71 8837.4 -0.011273784 4.3943451e-4 2.11 0.1055 441.87 0.90449 0.0035391 72 9070.4 -0.011761571 3.7002787e-4 2.11 0.1055 453.52 0.90057 0.0029672 73 9309.5 -0.011439046 3.8852675e-4 2.11 0.1055 465.47 0.90316 0.0031245 74 9553.8 -0.012468380 3.8879110e-4 2.11 0.1055 477.69 0.89492 0.0030981 75 9802.5 -0.012287815 4.5888119e-4 2.11 0.1055 490.13 0.89636 0.0036625 76 10057. -0.013330052 2.8645708e-4 2.11 0.1055 502.84 0.88808 0.0022652 77 10317. -0.013511036 5.6519968e-4 2.11 0.1055 515.86 0.88665 0.0044622 78 10583. -0.014095206 3.8547484e-4 2.11 0.1055 529.14 0.88205 0.0030275 79 10855. -0.014029017 3.6440427e-4 2.11 0.1055 542.76 0.88257 0.0028637 80 11134. -0.014831000 3.8848283e-4 2.11 0.1055 556.69 0.87629 0.0030312 81 11419. -0.014699072 3.3972822e-4 2.11 0.1055 570.93 0.87732 0.0026539 82 11710 -0.015174999 4.4468309e-4 2.11 0.1055 585.5 0.87361 0.0034591 83 12010 -0.016164070 3.6480986e-4 2.11 0.1055 600.52 0.86595 0.0028129 84 12316 -0.015893340 5.6035541e-4 2.11 0.1055 615.82 0.86804 0.0043311 85 12630 -0.016059068 3.7324087e-4 2.11 0.1055 631.51 0.86676 0.0028806 86 12952. -0.017389837 3.7573625e-4 2.11 0.1055 647.62 0.85655 0.0028657 87 13284. -0.017207735 4.5518751e-4 2.11 0.1055 664.19 0.85794 0.0034773 88 13623. -0.017565669 4.3070477e-4 2.11 0.1055 681.13 0.85521 0.0032798 89 13971. -0.018286298 5.8862675e-4 2.11 0.1055 698.54 0.84974 0.0044537 90 14329. -0.019381994 4.3692639e-4 2.11 0.1055 716.44 0.84149 0.0032738 91 14697. -0.018515178 5.0158587e-4 2.11 0.1055 734.87 0.84801 0.0037874 92 15075. -0.019135361 4.2693908e-4 2.11 0.1055 753.76 0.84334 0.003206 93 15464. -0.019917113 5.4587670e-4 2.11 0.1055 773.18 0.83749 0.0040707 94 15864. -0.019686699 6.6829096e-4 2.11 0.1055 793.22 0.83921 0.0049938 95 16276. -0.020340321 7.7178617e-4 2.11 0.1055 813.81 0.83434 0.0057337 96 16699. -0.021091231 8.4580203e-4 2.11 0.1055 834.97 0.82878 0.0062417 97 17136. -0.021864932 1.0940027e-3 2.11 0.1055 856.78 0.82309 0.0080179 98 17585. -0.021695868 1.0107767e-3 2.11 0.1055 879.27 0.82433 0.0074191 99 18048. -0.022255844 1.0464994e-3 2.11 0.1055 902.39 0.82023 0.0076431 100 18525. -0.021256673 8.5582923e-4 2.11 0.1055 926.27 0.82756 0.0063064 101 19017. -0.021490334 7.1998911e-4 2.11 0.1055 950.87 0.82584 0.0052944 102 19524. -0.021198334 6.8716706e-4 2.11 0.1055 976.22 0.82799 0.0050662 103 20048. -0.021815823 5.8818928e-4 2.11 0.1055 1002.4 0.82345 0.0043127 104 20588. -0.021882671 5.1857307e-4 2.11 0.1055 1029.4 0.82296 0.0038 105 21145. -0.022305147 4.6672141e-4 2.11 0.1055 1057.2 0.81987 0.0034072 106 21720 -0.022258583 5.0322361e-4 2.11 0.1055 1086. 0.82021 0.0036752 107 22314. -0.021244460 3.9148871e-4 2.11 0.1055 1115.7 0.82765 0.0028851 108 22928. -0.021381594 5.2906244e-4 2.11 0.1055 1146.4 0.82664 0.0038942 109 23562. -0.021329979 6.4328235e-4 2.11 0.1055 1178.1 0.82702 0.0047371 110 24218. -0.022846153 6.0248825e-4 2.11 0.1055 1210.9 0.81593 0.0043772 111 24896. -0.021591012 3.8146933e-4 2.11 0.1055 1244.8 0.8251 0.0028026 112 25595. -0.021034332 3.3282938e-4 2.11 0.1055 1279.8 0.8292 0.0024574 113 26319. -0.021433232 4.9200888e-4 2.11 0.1055 1315.9 0.82626 0.0036198 114 27068. -0.022177827 4.4213864e-4 2.11 0.1055 1353.4 0.8208 0.0032314 115 27843. -0.022343508 5.8553317e-4 2.11 0.1055 1392.2 0.81959 0.0042731 116 28645. -0.021396539 3.6673246e-4 2.11 0.1055 1432.3 0.82653 0.002699 117 29475. -0.021739473 5.0054859e-4 2.11 0.1055 1473.8 0.82401 0.0036726 118 30335. -0.021794003 6.5757715e-4 2.11 0.1055 1516.7 0.82361 0.0048224 119 31224. -0.021798094 5.6210549e-4 2.11 0.1055 1561.2 0.82358 0.0041221 120 32145. -0.022031519 3.9364070e-4 2.11 0.1055 1607.3 0.82187 0.0028807 121 33101. -0.021408769 4.7779613e-4 2.11 0.1055 1655. 0.82644 0.003516 122 34090 -0.021802185 2.8863827e-4 2.11 0.1055 1704.5 0.82355 0.0021166 123 35114. -0.021586929 4.6155484e-4 2.11 0.1055 1755.7 0.82513 0.0033911 124 36176. -0.021194265 2.0808762e-4 2.11 0.1055 1808.8 0.82802 0.0015342 125 37276. -0.021382952 3.9701221e-4 2.11 0.1055 1863.8 0.82663 0.0029222 126 38417. -0.022251737 2.8416874e-4 2.11 0.1055 1920.8 0.82026 0.0020755 127 39600 -0.020819189 3.5679523e-4 2.11 0.1055 1980.0 0.83079 0.0026394 128 40827. -0.021380235 3.7314604e-4 2.11 0.1055 2041.3 0.82665 0.0027466 129 42099. -0.021232248 3.4189634e-4 2.11 0.1055 2105. 0.82774 0.0025199 130 43419. -0.020266312 4.1187633e-4 2.11 0.1055 2170.9 0.83489 0.0030619 131 44787. -0.022305147 2.8749557e-4 2.11 0.1055 2239.4 0.81987 0.0020988 132 46208. -0.021563793 3.2521680e-4 2.11 0.1055 2310.4 0.8253 0.0023899 133 47682. -0.021396539 3.1049291e-4 2.11 0.1055 2384.1 0.82653 0.0022851 134 49211. -0.021683607 4.6084892e-4 2.11 0.1055 2460.6 0.82442 0.003383 135 50798. -0.021160361 2.1666201e-4 2.11 0.1055 2539.9 0.82827 0.0015979 136 52447. -0.021612792 4.2378726e-4 2.11 0.1055 2622.3 0.82494 0.0031129 137 54157. -0.022036985 4.1199886e-4 2.11 0.1055 2707.9 0.82183 0.0030149 138 55933. -0.020632795 6.3397053e-4 2.11 0.1055 2796.7 0.83217 0.0046976 139 57778. -0.021976873 7.6130313e-4 2.11 0.1055 2888.9 0.82227 0.005574 140 59693. -0.021825370 3.4875346e-4 2.11 0.1055 2984.6 0.82338 0.0025569 -
example/se008731_01_40pcorr.ses
r2f8ee5f rb314f89 1 DataFileTitle "Polystyrene of Markus Strobl, Full Sine, ++ only " 2 Sample "Polystyrene 2 um in 53% H2O, 47% D2O " 3 Settings "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast " 4 Operator CPD 5 Date do 10 jul 2014 16:37:30 6 ScanType sine one element scan 7 Thickness [cm] 2.00E-01 8 Q_zmax [\A^-1] 0.05 9 Q_ymax [\A^-1] 0.05 10 11 spin echo length [A] Depolarisation [A-2 cm-1] error depol [A-2 cm-1] error SEL [A] wavelength [A] error wavelength [A] polarisation error pol 12 391.56 0.0041929 0.0036894 19.578 2.11 0.1055 1.0037 0.0032974 13 1564 -0.0046571 0.0038185 78.2 2.11 0.1055 0.99586 0.003386 14 2735.6 -0.017007 0.0038132 136.78 2.11 0.1055 0.98497 0.0033444 15 3907.9 -0.033462 0.0035068 195.39 2.11 0.1055 0.97064 0.0030309 16 5080.2 -0.047483 0.0038208 254.01 2.11 0.1055 0.9586 0.0032613 17 6251.8 -0.070375 0.00376 312.59 2.11 0.1055 0.93926 0.0031446 18 7423.2 -0.092217 0.0037927 371.16 2.11 0.1055 0.92117 0.0031108 19 8595.5 -0.10238 0.004006 429.77 2.11 0.1055 0.91287 0.0032562 20 9767.7 -0.12672 0.0038534 488.39 2.11 0.1055 0.8933 0.0030651 21 10940 -0.1374 0.004243 546.98 2.11 0.1055 0.88484 0.003343 22 12112 -0.16072 0.0045837 605.58 2.11 0.1055 0.86666 0.0035372 23 13284 -0.16623 0.0045613 664.2 2.11 0.1055 0.86242 0.0035027 24 14456 -0.18468 0.0044918 722.79 2.11 0.1055 0.84837 0.0033931 25 15628 -0.19143 0.0048967 781.38 2.11 0.1055 0.84328 0.0036768 26 16800 -0.20029 0.0045421 840.02 2.11 0.1055 0.83666 0.0033837 27 17971 -0.19798 0.0046642 898.56 2.11 0.1055 0.83838 0.0034819 28 19143 -0.21442 0.0047052 957.17 2.11 0.1055 0.82619 0.0034614 29 20316 -0.20885 0.0044931 1015.8 2.11 0.1055 0.8303 0.0033218 30 21488 -0.21393 0.0049186 1074.4 2.11 0.1055 0.82655 0.00362 31 22660 -0.20685 0.004423 1133 2.11 0.1055 0.83179 0.0032758 32 23832 -0.20802 0.0046979 1191.6 2.11 0.1055 0.83092 0.0034758 33 25003 -0.19848 0.0045953 1250.2 2.11 0.1055 0.838 0.0034289 34 26175 -0.21117 0.0044567 1308.8 2.11 0.1055 0.82859 0.0032881 35 27347 -0.21283 0.004137 1367.4 2.11 0.1055 0.82736 0.0030477 36 28520 -0.2042 0.0044587 1426 2.11 0.1055 0.83375 0.0033101 37 29692 -0.2112 0.0042852 1484.6 2.11 0.1055 0.82857 0.0031615 38 30864 -0.20319 0.0043483 1543.2 2.11 0.1055 0.8345 0.003231 39 32036 -0.20752 0.0044297 1601.8 2.11 0.1055 0.83129 0.0032788 40 33207 -0.20654 0.0043188 1660.4 2.11 0.1055 0.83201 0.0031995 41 34380 -0.20126 0.0046375 1719 2.11 0.1055 0.83593 0.0034518 42 35551 -0.20924 0.0042871 1777.6 2.11 0.1055 0.83001 0.0031684 43 36724 -0.21323 0.0045471 1836.2 2.11 0.1055 0.82707 0.0033487 44 37895 -0.21324 0.0045354 1894.7 2.11 0.1055 0.82706 0.00334 45 39067 -0.19905 0.0044141 1953.4 2.11 0.1055 0.83758 0.003292 46 40239 -0.1991 0.0047441 2012 2.11 0.1055 0.83754 0.003538 47 41411 -0.20359 0.0050136 2070.5 2.11 0.1055 0.8342 0.003724 48 42583 -0.21032 0.0049474 2129.1 2.11 0.1055 0.82922 0.0036529 49 43755 -0.20689 0.0048203 2187.8 2.11 0.1055 0.83176 0.00357 50 44927 -0.21075 0.0052337 2246.4 2.11 0.1055 0.8289 0.0038628 51 46099 -0.19956 0.0047827 2304.9 2.11 0.1055 0.8372 0.0035653 1 FileFormatVersion 1.0 2 DataFileTitle Polystyrene of Markus Strobl, Full Sine, ++ only 3 Sample Polystyrene 2 um in 53% H2O, 47% D2O 4 Settings "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast " 5 Operator CPD 6 Date do 10 jul 2014 16:37:30 7 ScanType sine one element scan 8 Thickness 2 9 Thickness_unit mm 10 Theta_zmax 0.0168 11 Theta_zmax_unit radians 12 Theta_ymax 0.0168 13 Theta_ymax_unit radians 14 Orientation Z 15 SpinEchoLength_unit A 16 Depolarisation_unit A-2 cm-1 17 Wavelength_unit A 18 19 BEGIN_DATA 20 SpinEchoLength Depolarisation Depolarisation_error Polarisation Polarisation_error SpinEchoLength_error Wavelength Wavelength_error 21 391.56 0.0041929 0.0036894 1.0037 0.0032974 19.578 2.11 0.1055 22 1564 -0.0046571 0.0038185 0.99586 0.003386 78.2 2.11 0.1055 23 2735.6 -0.017007 0.0038132 0.98497 0.0033444 136.78 2.11 0.1055 24 3907.9 -0.033462 0.0035068 0.97064 0.0030309 195.39 2.11 0.1055 25 5080.2 -0.047483 0.0038208 0.9586 0.0032613 254.01 2.11 0.1055 26 6251.8 -0.070375 0.00376 0.93926 0.0031446 312.59 2.11 0.1055 27 7423.2 -0.092217 0.0037927 0.92117 0.0031108 371.16 2.11 0.1055 28 8595.5 -0.10238 0.004006 0.91287 0.0032562 429.77 2.11 0.1055 29 9767.7 -0.12672 0.0038534 0.8933 0.0030651 488.39 2.11 0.1055 30 10940 -0.1374 0.004243 0.88484 0.003343 546.98 2.11 0.1055 31 12112 -0.16072 0.0045837 0.86666 0.0035372 605.58 2.11 0.1055 32 13284 -0.16623 0.0045613 0.86242 0.0035027 664.2 2.11 0.1055 33 14456 -0.18468 0.0044918 0.84837 0.0033931 722.79 2.11 0.1055 34 15628 -0.19143 0.0048967 0.84328 0.0036768 781.38 2.11 0.1055 35 16800 -0.20029 0.0045421 0.83666 0.0033837 840.02 2.11 0.1055 36 17971 -0.19798 0.0046642 0.83838 0.0034819 898.56 2.11 0.1055 37 19143 -0.21442 0.0047052 0.82619 0.0034614 957.17 2.11 0.1055 38 20316 -0.20885 0.0044931 0.8303 0.0033218 1015.8 2.11 0.1055 39 21488 -0.21393 0.0049186 0.82655 0.00362 1074.4 2.11 0.1055 40 22660 -0.20685 0.004423 0.83179 0.0032758 1133 2.11 0.1055 41 23832 -0.20802 0.0046979 0.83092 0.0034758 1191.6 2.11 0.1055 42 25003 -0.19848 0.0045953 0.838 0.0034289 1250.2 2.11 0.1055 43 26175 -0.21117 0.0044567 0.82859 0.0032881 1308.8 2.11 0.1055 44 27347 -0.21283 0.004137 0.82736 0.0030477 1367.4 2.11 0.1055 45 28520 -0.2042 0.0044587 0.83375 0.0033101 1426 2.11 0.1055 46 29692 -0.2112 0.0042852 0.82857 0.0031615 1484.6 2.11 0.1055 47 30864 -0.20319 0.0043483 0.8345 0.003231 1543.2 2.11 0.1055 48 32036 -0.20752 0.0044297 0.83129 0.0032788 1601.8 2.11 0.1055 49 33207 -0.20654 0.0043188 0.83201 0.0031995 1660.4 2.11 0.1055 50 34380 -0.20126 0.0046375 0.83593 0.0034518 1719 2.11 0.1055 51 35551 -0.20924 0.0042871 0.83001 0.0031684 1777.6 2.11 0.1055 52 36724 -0.21323 0.0045471 0.82707 0.0033487 1836.2 2.11 0.1055 53 37895 -0.21324 0.0045354 0.82706 0.00334 1894.7 2.11 0.1055 54 39067 -0.19905 0.0044141 0.83758 0.003292 1953.4 2.11 0.1055 55 40239 -0.1991 0.0047441 0.83754 0.003538 2012 2.11 0.1055 56 41411 -0.20359 0.0050136 0.8342 0.003724 2070.5 2.11 0.1055 57 42583 -0.21032 0.0049474 0.82922 0.0036529 2129.1 2.11 0.1055 58 43755 -0.20689 0.0048203 0.83176 0.00357 2187.8 2.11 0.1055 59 44927 -0.21075 0.0052337 0.8289 0.0038628 2246.4 2.11 0.1055 60 46099 -0.19956 0.0047827 0.8372 0.0035653 2304.9 2.11 0.1055 -
example/sphere.ses
ra98958b re0721e7 1 name se009051.dat 2 sample "SiO2 pH=6 & NiO pH=10, nanosized, in D2O, Sine ++ only." 3 collimation "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. " 4 ID CPD 5 Date di 27 jan 2015 18:17:50 6 Method sine one element scan 7 Thickness [mm] 10 8 z-acceptance [nm^-1] 0.3 9 y-acceptance [nm^-1] 0.3 1 FileFormatVersion 1.0 2 DataFileTitle se009051.dat 3 Sample "SiO2 pH=6 & NiO pH=10, nanosized, in D2O, Sine ++ only." 4 collimation "D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. " 5 ID CPD 6 Date di 27 jan 2015 18:17:50 7 Method sine one element scan 8 Thickness 10 9 Thickness_unit mm 10 Theta_zmax 0.0168 11 Theta_zmax_unit radians 12 Theta_ymax 0.0168 13 Theta_ymax_unit radians 14 Orientation Z 15 SpinEchoLength_unit A 16 Depolarisation_unit A-2 cm-1 17 Wavelength_unit A 10 18 11 spin echo length [um] error spin-echo length wavelength [nm] error wavelength Sample 5 Sample 5 -error 12 29.882023 5 0.2095 0.01 0.997817556 0.00887342 0.029882023 29.882023 13 85.257531 5 0.2095 0.01 1.0026184 0.009572307 0.085257531 85.257531 14 140.798634 5 0.2095 0.01 0.996013172 0.012119508 0.140798634 140.798634 15 196.560502 5 0.2095 0.01 0.991752656 0.011651473 0.196560502 196.560502 16 252.528125 5 0.2095 0.01 0.995429571 0.012193294 0.252528125 252.528125 17 308.729274 5 0.2095 0.01 0.995119819 0.009621277 0.308729274 308.729274 18 365.037117 5 0.2095 0.01 0.997497767 0.012518842 0.365037117 365.037117 19 421.684677 5 0.2095 0.01 0.994733865 0.010585926 0.421684677 421.684677 20 478.564852 5 0.2095 0.01 0.992696275 0.010677724 0.478564852 478.564852 21 535.715521 5 0.2095 0.01 0.994534294 0.012909556 0.535715521 535.715521 22 593.24408 5 0.2095 0.01 0.986412268 0.014651894 0.59324408 593.24408 23 650.985498 5 0.2095 0.01 0.988788566 0.015736468 0.650985498 650.985498 24 709.203958 5 0.2095 0.01 0.989501168 0.013611615 0.709203958 709.203958 25 767.809943 5 0.2095 0.01 0.99203933 0.016501891 0.767809943 767.809943 26 826.762925 5 0.2095 0.01 0.994062723 0.010276207 0.826762925 826.762925 27 886.302296 5 0.2095 0.01 0.979647192 0.011089421 0.886302296 886.302296 28 946.236366 5 0.2095 0.01 0.97982075 0.013168527 0.946236366 946.236366 29 1006.784115 5 0.2095 0.01 0.977927712 0.014362819 1.006784115 1006.784115 30 1067.891213 5 0.2095 0.01 0.978351462 0.013239476 1.067891213 1067.891213 31 1129.598722 5 0.2095 0.01 0.981246471 0.013896898 1.129598722 1129.598722 32 1192.022694 5 0.2095 0.01 0.978275164 0.013747481 1.192022694 1192.022694 33 1255.271282 5 0.2095 0.01 0.976818842 0.013487944 1.255271282 1255.271282 34 1319.307134 5 0.2095 0.01 0.981546068 0.011972943 1.319307134 1319.307134 35 1384.197821 5 0.2095 0.01 0.96445854 0.013357572 1.384197821 1384.197821 36 1450.051342 5 0.2095 0.01 0.972756158 0.014756189 1.450051342 1450.051342 37 1516.978619 5 0.2095 0.01 0.971010184 0.014210504 1.516978619 1516.978619 38 1585.044577 5 0.2095 0.01 0.975009829 0.013648839 1.585044577 1585.044577 39 1654.356194 5 0.2095 0.01 0.969575209 0.014454336 1.654356194 1654.356194 40 1724.97535 5 0.2095 0.01 0.959907267 0.012806944 1.72497535 1724.97535 41 1796.962718 5 0.2095 0.01 0.96219203 0.011845496 1.796962718 1796.962718 42 1870.613025 5 0.2095 0.01 0.960157966 0.011721155 1.870613025 1870.613025 43 1945.921163 5 0.2095 0.01 0.95089937 0.009967287 1.945921163 1945.921163 44 2023.09841 5 0.2095 0.01 0.955584642 0.01104368 2.02309841 2023.09841 45 2102.189874 5 0.2095 0.01 0.950786938 0.011651582 2.102189874 2102.189874 46 2183.534527 5 0.2095 0.01 0.951403607 0.008784149 2.183534527 2183.534527 47 2267.173021 5 0.2095 0.01 0.94561823 0.009392383 2.267173021 2267.173021 48 2353.393035 5 0.2095 0.01 0.945882787 0.009468264 2.353393035 2353.393035 49 2442.350387 5 0.2095 0.01 0.939583158 0.009164239 2.442350387 2442.350387 50 2534.334343 5 0.2095 0.01 0.93731257 0.008621568 2.534334343 2534.334343 51 2629.473374 5 0.2095 0.01 0.936639557 0.010408821 2.629473374 2629.473374 52 2728.20036 5 0.2095 0.01 0.932091884 0.007112674 2.72820036 2728.20036 53 2830.74992 5 0.2095 0.01 0.933852763 0.009200431 2.83074992 2830.74992 54 2937.363026 5 0.2095 0.01 0.930283437 0.01022719 2.937363026 2937.363026 55 3048.510973 5 0.2095 0.01 0.930121334 0.007055747 3.048510973 3048.510973 56 3164.589926 5 0.2095 0.01 0.925944326 0.0078917 3.164589926 3164.589926 57 3285.843756 5 0.2095 0.01 0.92351759 0.005522582 3.285843756 3285.843756 58 3412.805801 5 0.2095 0.01 0.918228311 0.006917328 3.412805801 3412.805801 59 3546.016792 5 0.2095 0.01 0.908621563 0.006852313 3.546016792 3546.016792 60 3685.876213 5 0.2095 0.01 0.919087792 0.006995961 3.685876213 3685.876213 61 3833.174832 5 0.2095 0.01 0.910132214 0.006107336 3.833174832 3833.174832 62 3988.234456 5 0.2095 0.01 0.904491462 0.007078101 3.988234456 3988.234456 63 4151.940408 5 0.2095 0.01 0.90056919 0.005934428 4.151940408 4151.940408 64 4324.902332 5 0.2095 0.01 0.903155701 0.006249069 4.324902332 4324.902332 65 4507.963711 5 0.2095 0.01 0.894919827 0.006196232 4.507963711 4507.963711 66 4701.967049 5 0.2095 0.01 0.896358908 0.007324999 4.701967049 4701.967049 67 4907.785127 5 0.2095 0.01 0.88807923 0.004530465 4.907785127 4907.785127 68 5126.471149 5 0.2095 0.01 0.886649039 0.008924412 5.126471149 5126.471149 69 5359.059759 5 0.2095 0.01 0.882051947 0.006055081 5.359059759 5359.059759 70 5606.740304 5 0.2095 0.01 0.882573371 0.005727419 5.606740304 5606.740304 71 5870.903592 5 0.2095 0.01 0.876289825 0.006062306 5.870903592 5870.903592 72 6152.736235 5 0.2095 0.01 0.877318199 0.005307783 6.152736235 6152.736235 73 6453.893169 5 0.2095 0.01 0.873610284 0.006918104 6.453893169 6453.893169 74 6775.835415 5 0.2095 0.01 0.865954455 0.005625863 6.775835415 6775.835415 75 7120.530581 5 0.2095 0.01 0.868037308 0.008662141 7.120530581 7120.530581 76 7489.735939 5 0.2095 0.01 0.86676404 0.005761209 7.489735939 7489.735939 77 7885.556041 5 0.2095 0.01 0.85655072 0.005731411 7.885556041 7885.556041 78 8310.290162 5 0.2095 0.01 0.857936274 0.006954572 8.310290162 8310.290162 79 8766.315359 5 0.2095 0.01 0.85520525 0.006559622 8.766315359 8766.315359 80 9256.271706 5 0.2095 0.01 0.849739829 0.008907377 9.256271706 9256.271706 81 9783.031577 5 0.2095 0.01 0.841487161 0.006547659 9.783031577 9783.031577 82 10349.71409 5 0.2095 0.01 0.84801051 0.007574866 10.34971409 10349.71409 83 10959.67923 5 0.2095 0.01 0.843342861 0.006411993 10.95967923 10959.67923 84 11616.5969 5 0.2095 0.01 0.837488454 0.008141353 11.6165969 11616.5969 85 12324.44664 5 0.2095 0.01 0.839214922 0.009987535 12.32444664 12324.44664 86 13087.4723 5 0.2095 0.01 0.834336972 0.011467406 13.0874723 13087.4723 87 13910.29604 5 0.2095 0.01 0.828775634 0.012483365 13.91029604 13910.29604 88 14798.05061 5 0.2095 0.01 0.823088812 0.016035848 14.79805061 14798.05061 89 15756.09817 5 0.2095 0.01 0.824329178 0.014838138 15.75609817 15756.09817 90 16790.46783 5 0.2095 0.01 0.82023172 0.015286187 16.79046783 16790.46783 91 17907.62866 5 0.2095 0.01 0.827559752 0.012612741 17.90762866 17907.62866 19 BEGIN_DATA 20 SpinEchoLength SpinEchoLength_error Wavelength Wavelength_Error Polarisation Polarisation_error Depolarisation Depolarisation_error 21 298.82023 50 2.095 0.1 0.997817556 0.00887342 -4.9779370e-5 2.0261512e-4 22 852.57531 50 2.095 0.1 1.0026184 0.009572307 5.9579929e-5 2.1752686e-4 23 1407.9863 50 2.095 0.1 0.996013172 0.012119508 -9.1017859e-5 2.7723742e-4 24 1965.6050 50 2.095 0.1 0.991752656 0.011651473 -1.8868750e-4 2.6767598e-4 25 2525.2813 50 2.095 0.1 0.995429571 0.012193294 -1.0437182e-4 2.7908883e-4 26 3087.2927 50 2.095 0.1 0.995119819 0.009621277 -1.1146275e-4 2.2028721e-4 27 3650.3712 50 2.095 0.1 0.997497767 0.012518842 -5.7082583e-5 2.8594610e-4 28 4216.8468 50 2.095 0.1 0.994733865 0.010585926 -1.2030120e-4 2.4246770e-4 29 4785.6485 50 2.095 0.1 0.992696275 0.010677724 -1.6701950e-4 2.4507231e-4 30 5357.1552 50 2.095 0.1 0.994534294 0.012909556 -1.2487278e-4 2.9574914e-4 31 5932.4408 50 2.095 0.1 0.986412268 0.014651894 -3.1170682e-4 3.3842875e-4 32 6509.8550 50 2.095 0.1 0.988788566 0.015736468 -2.5688520e-4 3.6260666e-4 33 7092.0396 50 2.095 0.1 0.989501168 0.013611615 -2.4047103e-4 3.1341898e-4 34 7678.0994 50 2.095 0.1 0.99203933 0.016501891 -1.8210252e-4 3.7899787e-4 35 8267.6293 50 2.095 0.1 0.994062723 0.010276207 -1.3567871e-4 2.3553259e-4 36 8863.0230 50 2.095 0.1 0.979647192 0.011089421 -4.6850452e-4 2.5791174e-4 37 9462.3637 50 2.095 0.1 0.97982075 0.013168527 -4.6446835e-4 3.0621222e-4 38 10067.841 50 2.095 0.1 0.977927712 0.014362819 -5.0853039e-4 3.3463000e-4 39 10678.912 50 2.095 0.1 0.978351462 0.013239476 -4.9865985e-4 3.0832436e-4 40 11295.987 50 2.095 0.1 0.981246471 0.013896898 -4.3133968e-4 3.2267975e-4 41 11920.227 50 2.095 0.1 0.978275164 0.013747481 -5.0043677e-4 3.2017989e-4 42 12552.713 50 2.095 0.1 0.976818842 0.013487944 -5.3437989e-4 3.1460359e-4 43 13193.071 50 2.095 0.1 0.981546068 0.011972943 -4.2438423e-4 2.7792152e-4 44 13841.978 50 2.095 0.1 0.96445854 0.013357572 -8.2452102e-4 3.1555561e-4 45 14500.513 50 2.095 0.1 0.972756158 0.014756189 -6.2933879e-4 3.4562263e-4 46 15169.786 50 2.095 0.1 0.971010184 0.014210504 -6.7027011e-4 3.3343996e-4 47 15850.446 50 2.095 0.1 0.975009829 0.013648839 -5.7661387e-4 3.1894710e-4 48 16543.562 50 2.095 0.1 0.969575209 0.014454336 -7.0396574e-4 3.3966327e-4 49 17249.754 50 2.095 0.1 0.959907267 0.012806944 -9.3229353e-4 3.0398222e-4 50 17969.627 50 2.095 0.1 0.96219203 0.011845496 -8.7812744e-4 2.8049391e-4 51 18706.130 50 2.095 0.1 0.960157966 0.011721155 -9.2634378e-4 2.7813758e-4 52 19459.212 50 2.095 0.1 0.95089937 0.009967287 -1.1471121e-3 2.3882201e-4 53 20230.984 50 2.095 0.1 0.955584642 0.01104368 -1.0351259e-3 2.6331561e-4 54 21021.899 50 2.095 0.1 0.950786938 0.011651582 -1.1498062e-3 2.7921171e-4 55 21835.345 50 2.095 0.1 0.951403607 0.008784149 -1.1350335e-3 2.1036178e-4 56 22671.730 50 2.095 0.1 0.94561823 0.009392383 -1.2740040e-3 2.2630383e-4 57 23533.930 50 2.095 0.1 0.945882787 0.009468264 -1.2676305e-3 2.2806833e-4 58 24423.504 50 2.095 0.1 0.939583158 0.009164239 -1.4198814e-3 2.2222511e-4 59 25343.343 50 2.095 0.1 0.93731257 0.008621568 -1.4750079e-3 2.0957224e-4 60 26294.734 50 2.095 0.1 0.936639557 0.010408821 -1.4913733e-3 2.5319842e-4 61 27282.004 50 2.095 0.1 0.932091884 0.007112674 -1.6022666e-3 1.7386258e-4 62 28307.499 50 2.095 0.1 0.933852763 0.009200431 -1.5592642e-3 2.2447176e-4 63 29373.630 50 2.095 0.1 0.930283437 0.01022719 -1.6465153e-3 2.5047996e-4 64 30485.110 50 2.095 0.1 0.930121334 0.007055747 -1.6504858e-3 1.7283645e-4 65 31645.899 50 2.095 0.1 0.925944326 0.0078917 -1.7530356e-3 1.9418588e-4 66 32858.438 50 2.095 0.1 0.92351759 0.005522582 -1.8128270e-3 1.3624763e-4 67 34128.058 50 2.095 0.1 0.918228311 0.006917328 -1.9436940e-3 1.7164045e-4 68 35460.168 50 2.095 0.1 0.908621563 0.006852313 -2.1833230e-3 1.7182490e-4 69 36858.762 50 2.095 0.1 0.919087792 0.006995961 -1.9223776e-3 1.7342924e-4 70 38331.748 50 2.095 0.1 0.910132214 0.006107336 -2.1454742e-3 1.5289007e-4 71 39882.345 50 2.095 0.1 0.904491462 0.007078101 -2.2871233e-3 1.7829708e-4 72 41519.404 50 2.095 0.1 0.90056919 0.005934428 -2.3861400e-3 1.5013907e-4 73 43249.023 50 2.095 0.1 0.903155701 0.006249069 -2.3207959e-3 1.5764661e-4 74 45079.637 50 2.095 0.1 0.894919827 0.006196232 -2.5295172e-3 1.5775222e-4 75 47019.670 50 2.095 0.1 0.896358908 0.007324999 -2.4929085e-3 1.8619052e-4 76 49077.851 50 2.095 0.1 0.88807923 0.004530465 -2.7043436e-3 1.1623128e-4 77 51264.711 50 2.095 0.1 0.886649039 0.008924412 -2.7410654e-3 2.2932944e-4 78 53590.598 50 2.095 0.1 0.882051947 0.006055081 -2.8595036e-3 1.5640756e-4 79 56067.403 50 2.095 0.1 0.882573371 0.005727419 -2.8460388e-3 1.4785638e-4 80 58709.036 50 2.095 0.1 0.876289825 0.006062306 -3.0088321e-3 1.5762389e-4 81 61527.362 50 2.095 0.1 0.877318199 0.005307783 -2.9821094e-3 1.3784403e-4 82 64538.932 50 2.095 0.1 0.873610284 0.006918104 -3.0786086e-3 1.8042690e-4 83 67758.354 50 2.095 0.1 0.865954455 0.005625863 -3.2791557e-3 1.4802192e-4 84 71205.306 50 2.095 0.1 0.868037308 0.008662141 -3.2244196e-3 2.2736248e-4 85 74897.359 50 2.095 0.1 0.86676404 0.005761209 -3.2578647e-3 1.5144143e-4 86 78855.560 50 2.095 0.1 0.85655072 0.005731411 -3.5279304e-3 1.5245456e-4 87 83102.902 50 2.095 0.1 0.857936274 0.006954572 -3.4911046e-3 1.8469168e-4 88 87663.154 50 2.095 0.1 0.85520525 0.006559622 -3.5637478e-3 1.7475934e-4 89 92562.717 50 2.095 0.1 0.849739829 0.008907377 -3.7098230e-3 2.3883381e-4 90 97830.316 50 2.095 0.1 0.841487161 0.006547659 -3.9321836e-3 1.7728439e-4 91 103497.14 50 2.095 0.1 0.84801051 0.007574866 -3.7562386e-3 2.0351933e-4 92 109596.79 50 2.095 0.1 0.843342861 0.006411993 -3.8819940e-3 1.7322909e-4 93 116165.97 50 2.095 0.1 0.837488454 0.008141353 -4.0407107e-3 2.2148775e-4 94 123244.47 50 2.095 0.1 0.839214922 0.009987535 -3.9937900e-3 2.7115465e-4 95 130874.72 50 2.095 0.1 0.834336972 0.011467406 -4.1266093e-3 3.1315233e-4 96 139102.96 50 2.095 0.1 0.828775634 0.012483365 -4.2789870e-3 3.4318369e-4 97 147980.51 50 2.095 0.1 0.823088812 0.016035848 -4.4358638e-3 4.4389186e-4 98 157560.98 50 2.095 0.1 0.824329178 0.014838138 -4.4015548e-3 4.1011975e-4 99 167904.68 50 2.095 0.1 0.82023172 0.015286187 -4.5150892e-3 4.2461424e-4 100 179076.29 50 2.095 0.1 0.827559752 0.012612741 -4.3124376e-3 3.4724985e-4 -
sasmodels/compare.py
r3221de0 rd86f0fc 718 718 model = core.build_model(model_info, dtype=dtype, platform="ocl") 719 719 calculator = DirectModel(data, model, cutoff=cutoff) 720 engine_type = calculator._model.__class__.__name__.replace('Model', '').upper()720 engine_type = calculator._model.__class__.__name__.replace('Model', '').upper() 721 721 bits = calculator._model.dtype.itemsize*8 722 722 precision = "fast" if getattr(calculator._model, 'fast', False) else str(bits) … … 1491 1491 vmin, vmax = limits 1492 1492 self.limits = vmax*1e-7, 1.3*vmax 1493 import pylab; pylab.clf() 1493 import pylab 1494 pylab.clf() 1494 1495 plot_models(self.opts, result, limits=self.limits) 1495 1496 -
sasmodels/data.py
rf549e37 rd86f0fc 706 706 else: 707 707 vmin_scaled, vmax_scaled = vmin, vmax 708 nx, ny = len(data.x_bins), len(data.y_bins)708 #nx, ny = len(data.x_bins), len(data.y_bins) 709 709 x_bins, y_bins, image = _build_matrix(data, plottable) 710 710 plt.imshow(image, … … 772 772 if loop >= max_loop: # this protects never-ending loop 773 773 break 774 image = _fillup_pixels( self,image=image, weights=weights)774 image = _fillup_pixels(image=image, weights=weights) 775 775 loop += 1 776 776 … … 817 817 return x_bins, y_bins 818 818 819 def _fillup_pixels( self,image=None, weights=None):819 def _fillup_pixels(image=None, weights=None): 820 820 """ 821 821 Fill z values of the empty cells of 2d image matrix -
sasmodels/generate.py
r6cbdcd4 rd86f0fc 169 169 170 170 import sys 171 from os.path import abspath, dirname, join as joinpath, exists, getmtime 171 from os import environ 172 from os.path import abspath, dirname, join as joinpath, exists, getmtime, sep 172 173 import re 173 174 import string … … 289 290 import loops. 290 291 """ 291 if (info.source and any(lib.startswith('lib/gauss') for lib in info.source)): 292 import os.path 292 if info.source and any(lib.startswith('lib/gauss') for lib in info.source): 293 293 from .gengauss import gengauss 294 path = os.path.join(MODEL_PATH, "lib", "gauss%d.c"%n)295 if not os.path.exists(path):294 path = joinpath(MODEL_PATH, "lib", "gauss%d.c"%n) 295 if not exists(path): 296 296 gengauss(n, path) 297 297 info.source = ["lib/gauss%d.c"%n if lib.startswith('lib/gauss') 298 298 else lib for lib in info.source] 299 299 300 300 def format_units(units): … … 320 320 for w, h in zip(column_widths, PARTABLE_HEADERS)] 321 321 322 sep= " ".join("="*w for w in column_widths)322 underbar = " ".join("="*w for w in column_widths) 323 323 lines = [ 324 sep,324 underbar, 325 325 " ".join("%-*s" % (w, h) 326 326 for w, h in zip(column_widths, PARTABLE_HEADERS)), 327 sep,327 underbar, 328 328 ] 329 329 for p in pars: … … 334 334 "%*g" % (column_widths[3], p.default), 335 335 ])) 336 lines.append( sep)336 lines.append(underbar) 337 337 return "\n".join(lines) 338 338 … … 612 612 """ 613 613 spaces = " "*depth 614 sep= "\n" + spaces615 return spaces + sep.join(s.split("\n"))614 interline_separator = "\n" + spaces 615 return spaces + interline_separator.join(s.split("\n")) 616 616 617 617 … … 619 619 def load_template(filename): 620 620 # type: (str) -> str 621 """ 622 Load template file from sasmodels resource directory. 623 """ 621 624 path = joinpath(DATA_PATH, filename) 622 625 mtime = getmtime(path) … … 900 903 kernel_module = load_custom_kernel_module(model_name) 901 904 else: 902 from sasmodels import models 903 __import__('sasmodels.models.'+model_name) 904 kernel_module = getattr(models, model_name, None) 905 try: 906 from sasmodels import models 907 __import__('sasmodels.models.'+model_name) 908 kernel_module = getattr(models, model_name, None) 909 except ImportError: 910 # If the model isn't a built in model, try the plugin directory 911 plugin_path = environ.get('SAS_MODELPATH', None) 912 if plugin_path is not None: 913 file_name = model_name.split(sep)[-1] 914 model_name = plugin_path + sep + file_name + ".py" 915 kernel_module = load_custom_kernel_module(model_name) 916 else: 917 raise 905 918 return kernel_module 906 919 -
sasmodels/guyou.py
r0d5a655 rb3703f5 31 31 # 32 32 # 2017-11-01 Paul Kienzle 33 # * converted to python, using degrees rather than radians 33 # * converted to python, with degrees rather than radians 34 """ 35 Convert between latitude-longitude and Guyou map coordinates. 36 """ 37 34 38 from __future__ import division, print_function 35 39 36 40 import numpy as np 37 from numpy import sqrt, pi, tan, cos, sin, log, exp, arctan2 as atan2, sign, radians, degrees 41 from numpy import sqrt, pi, tan, cos, sin, sign, radians, degrees 42 from numpy import sinh, arctan as atan 43 44 # scipy version of special functions 45 from scipy.special import ellipj as ellipticJ, ellipkinc as ellipticF 38 46 39 47 _ = """ … … 59 67 """ 60 68 61 # scipy version of special functions62 from scipy.special import ellipj as ellipticJ, ellipkinc as ellipticF63 from numpy import sinh, sign, arctan as atan64 65 69 def ellipticJi(u, v, m): 66 70 scalar = np.isscalar(u) and np.isscalar(v) and np.isscalar(m) 67 71 u, v, m = np.broadcast_arrays(u, v, m) 68 result = np.empty_like([u, u,u], 'D')69 real = v==070 imag = u==072 result = np.empty_like([u, u, u], 'D') 73 real = (v == 0) 74 imag = (u == 0) 71 75 mixed = ~(real|imag) 72 76 result[:, real] = _ellipticJi_real(u[real], m[real]) 73 77 result[:, imag] = _ellipticJi_imag(v[imag], m[imag]) 74 78 result[:, mixed] = _ellipticJi(u[mixed], v[mixed], m[mixed]) 75 return result[0, :] if scalar else result79 return result[0, :] if scalar else result 76 80 77 81 def _ellipticJi_real(u, m): … … 104 108 result = np.empty_like(phi, 'D') 105 109 index = (phi == 0) 106 result[index] = ellipticF(atan(sinh(abs(phi[index]))), 1-m[index]) * sign(psi[index]) 110 result[index] = ellipticF(atan(sinh(abs(phi[index]))), 111 1-m[index]) * sign(psi[index]) 107 112 result[~index] = ellipticFi(phi[~index], psi[~index], m[~index]) 108 113 return result.reshape(1)[0] if scalar else result … … 117 122 cotlambda2 = (-b + sqrt(b * b - 4 * c)) / 2 118 123 re = ellipticF(atan(1 / sqrt(cotlambda2)), m) * sign(phi) 119 im = ellipticF(atan(sqrt(np.maximum(0,(cotlambda2 / cotphi2 - 1) / m))), 1 - m) * sign(psi) 124 im = ellipticF(atan(sqrt(np.maximum(0, (cotlambda2 / cotphi2 - 1) / m))), 125 1 - m) * sign(psi) 120 126 return re + 1j*im 121 127 122 sqrt2 = sqrt(2)128 SQRT2 = sqrt(2) 123 129 124 130 # [PAK] renamed k_ => cos_u, k => sin_u, k*k => sinsq_u to avoid k,K confusion … … 127 133 # K = 3.165103454447431823666270142140819753058976299237578486994... 128 134 def guyou(lam, phi): 135 """Transform from (latitude, longitude) to point (x, y)""" 129 136 # [PAK] wrap into [-pi/2, pi/2] radians 130 137 x, y = np.asarray(lam), np.asarray(phi) … … 135 142 136 143 # Compute constant K 137 cos_u = ( sqrt2 - 1) / (sqrt2 + 1)144 cos_u = (SQRT2 - 1) / (SQRT2 + 1) 138 145 sinsq_u = 1 - cos_u**2 139 146 K = ellipticF(pi/2, sinsq_u) … … 144 151 at = atan(r * (cos(lam) - 1j*sin(lam))) 145 152 t = ellipticFi(at.real, at.imag, sinsq_u) 146 x, y = (-t.imag, sign(phi + (phi ==0))*(0.5 * K - t.real))153 x, y = (-t.imag, sign(phi + (phi == 0))*(0.5 * K - t.real)) 147 154 148 155 # [PAK] convert to degrees, and return to original tile … … 150 157 151 158 def guyou_invert(x, y): 159 """Transform from point (x, y) on plot to (latitude, longitude)""" 152 160 # [PAK] wrap into [-pi/2, pi/2] radians 153 161 x, y = np.asarray(x), np.asarray(y) … … 158 166 159 167 # compute constant K 160 cos_u = ( sqrt2 - 1) / (sqrt2 + 1)168 cos_u = (SQRT2 - 1) / (SQRT2 + 1) 161 169 sinsq_u = 1 - cos_u**2 162 170 K = ellipticF(pi/2, sinsq_u) … … 174 182 175 183 def plot_grid(): 184 """Plot the latitude-longitude grid for Guyou transform""" 176 185 import matplotlib.pyplot as plt 177 186 from numpy import linspace … … 186 195 plt.plot(x, y, 'g') 187 196 188 for long in range(-limit, limit+1, step):189 x, y = guyou(scale*long , scale*long_line)197 for longitude in range(-limit, limit+1, step): 198 x, y = guyou(scale*longitude, scale*long_line) 190 199 plt.plot(x, y, 'b') 191 200 #plt.xlabel('longitude') 192 201 plt.ylabel('latitude') 202 plt.title('forward transform') 193 203 194 204 plt.subplot(212) … … 202 212 plt.xlabel('longitude') 203 213 plt.ylabel('latitude') 214 plt.title('inverse transform') 215 216 def main(): 217 """Show the Guyou transformation""" 218 plot_grid() 219 import matplotlib.pyplot as plt 220 plt.show() 204 221 205 222 if __name__ == "__main__": 206 plot_grid() 207 import matplotlib.pyplot as plt; plt.show() 208 223 main() 209 224 210 225 _ = """ -
sasmodels/jitter.py
r199bd07 rb3703f5 8 8 from __future__ import division, print_function 9 9 10 import sys, os11 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))12 13 10 import argparse 14 11 … … 19 16 20 17 import matplotlib.pyplot as plt 21 from matplotlib.widgets import Slider, CheckButtons 22 from matplotlib import cm 18 from matplotlib.widgets import Slider 23 19 import numpy as np 24 20 from numpy import pi, cos, sin, sqrt, exp, degrees, radians 25 21 26 def draw_beam(ax , view=(0, 0)):22 def draw_beam(axes, view=(0, 0)): 27 23 """ 28 24 Draw the beam going from source at (0, 0, 1) to detector at (0, 0, -1) 29 25 """ 30 #ax .plot([0,0],[0,0],[1,-1])31 #ax .scatter([0]*100,[0]*100,np.linspace(1, -1, 100), alpha=0.8)26 #axes.plot([0,0],[0,0],[1,-1]) 27 #axes.scatter([0]*100,[0]*100,np.linspace(1, -1, 100), alpha=0.8) 32 28 33 29 steps = 25 … … 46 42 x, y, z = [v.reshape(shape) for v in points] 47 43 48 ax .plot_surface(x, y, z, rstride=4, cstride=4, color='y', alpha=0.5)49 50 def draw_ellipsoid(ax , size, view, jitter, steps=25, alpha=1):44 axes.plot_surface(x, y, z, rstride=4, cstride=4, color='y', alpha=0.5) 45 46 def draw_ellipsoid(axes, size, view, jitter, steps=25, alpha=1): 51 47 """Draw an ellipsoid.""" 52 a, b,c = size48 a, b, c = size 53 49 u = np.linspace(0, 2 * np.pi, steps) 54 50 v = np.linspace(0, np.pi, steps) … … 58 54 x, y, z = transform_xyz(view, jitter, x, y, z) 59 55 60 ax .plot_surface(x, y, z, rstride=4, cstride=4, color='w', alpha=alpha)61 62 draw_labels(ax , view, jitter, [63 ('c+', [ 0, 0, c], [ 1, 0,0]),64 ('c-', [ 0, 0,-c], [ 0, 0,-1]),65 ('a+', [ a, 0, 0], [ 0, 0,1]),66 ('a-', [-a, 0, 0], [ 0, 0,-1]),67 ('b+', [ 0, b, 0], [-1, 0,0]),68 ('b-', [ 0,-b, 0], [-1, 0,0]),56 axes.plot_surface(x, y, z, rstride=4, cstride=4, color='w', alpha=alpha) 57 58 draw_labels(axes, view, jitter, [ 59 ('c+', [+0, +0, +c], [+1, +0, +0]), 60 ('c-', [+0, +0, -c], [+0, +0, -1]), 61 ('a+', [+a, +0, +0], [+0, +0, +1]), 62 ('a-', [-a, +0, +0], [+0, +0, -1]), 63 ('b+', [+0, +b, +0], [-1, +0, +0]), 64 ('b-', [+0, -b, +0], [-1, +0, +0]), 69 65 ]) 70 66 71 def draw_sc(ax, size, view, jitter, steps=None, alpha=1): 67 def draw_sc(axes, size, view, jitter, steps=None, alpha=1): 68 """Draw points for simple cubic paracrystal""" 72 69 atoms = _build_sc() 73 _draw_crystal(ax, size, view, jitter, atoms=atoms) 74 75 def draw_fcc(ax, size, view, jitter, steps=None, alpha=1): 70 _draw_crystal(axes, size, view, jitter, atoms=atoms) 71 72 def draw_fcc(axes, size, view, jitter, steps=None, alpha=1): 73 """Draw points for face-centered cubic paracrystal""" 76 74 # Build the simple cubic crystal 77 75 atoms = _build_sc() … … 85 83 # y and z planes can be generated by substituting x for y and z respectively 86 84 atoms.extend(zip(x+y+z, y+z+x, z+x+y)) 87 _draw_crystal(ax, size, view, jitter, atoms=atoms) 88 89 def draw_bcc(ax, size, view, jitter, steps=None, alpha=1): 85 _draw_crystal(axes, size, view, jitter, atoms=atoms) 86 87 def draw_bcc(axes, size, view, jitter, steps=None, alpha=1): 88 """Draw points for body-centered cubic paracrystal""" 90 89 # Build the simple cubic crystal 91 90 atoms = _build_sc() … … 98 97 ) 99 98 atoms.extend(zip(x, y, z)) 100 _draw_crystal(ax , size, view, jitter, atoms=atoms)101 102 def _draw_crystal(ax , size, view, jitter, steps=None, alpha=1, atoms=None):99 _draw_crystal(axes, size, view, jitter, atoms=atoms) 100 101 def _draw_crystal(axes, size, view, jitter, atoms=None): 103 102 atoms, size = np.asarray(atoms, 'd').T, np.asarray(size, 'd') 104 103 x, y, z = atoms*size[:, None] 105 104 x, y, z = transform_xyz(view, jitter, x, y, z) 106 ax .scatter([x[0]], [y[0]], [z[0]], c='yellow', marker='o')107 ax .scatter(x[1:], y[1:], z[1:], c='r', marker='o')105 axes.scatter([x[0]], [y[0]], [z[0]], c='yellow', marker='o') 106 axes.scatter(x[1:], y[1:], z[1:], c='r', marker='o') 108 107 109 108 def _build_sc(): … … 124 123 return atoms 125 124 126 def draw_parallelepiped(ax , size, view, jitter, steps=None, alpha=1):125 def draw_parallelepiped(axes, size, view, jitter, steps=None, alpha=1): 127 126 """Draw a parallelepiped.""" 128 127 a, b, c = size 129 x = a*np.array([ 1,-1, 1,-1, 1,-1, 1,-1])130 y = b*np.array([ 1, 1,-1,-1, 1, 1,-1,-1])131 z = c*np.array([ 1, 1, 1, 1,-1,-1,-1,-1])128 x = a*np.array([+1, -1, +1, -1, +1, -1, +1, -1]) 129 y = b*np.array([+1, +1, -1, -1, +1, +1, -1, -1]) 130 z = c*np.array([+1, +1, +1, +1, -1, -1, -1, -1]) 132 131 tri = np.array([ 133 132 # counter clockwise triangles 134 133 # z: up/down, x: right/left, y: front/back 135 [0, 1,2], [3,2,1], # top face136 [6, 5,4], [5,6,7], # bottom face137 [0, 2,6], [6,4,0], # right face138 [1, 5,7], [7,3,1], # left face139 [2, 3,6], [7,6,3], # front face140 [4, 1,0], [5,1,4], # back face134 [0, 1, 2], [3, 2, 1], # top face 135 [6, 5, 4], [5, 6, 7], # bottom face 136 [0, 2, 6], [6, 4, 0], # right face 137 [1, 5, 7], [7, 3, 1], # left face 138 [2, 3, 6], [7, 6, 3], # front face 139 [4, 1, 0], [5, 1, 4], # back face 141 140 ]) 142 141 143 142 x, y, z = transform_xyz(view, jitter, x, y, z) 144 ax .plot_trisurf(x, y, triangles=tri, Z=z, color='w', alpha=alpha)143 axes.plot_trisurf(x, y, triangles=tri, Z=z, color='w', alpha=alpha) 145 144 146 145 # Draw pink face on box. … … 149 148 # rotate that face. 150 149 if 1: 151 x = a*np.array([ 1,-1, 1,-1, 1,-1, 1,-1])152 y = b*np.array([ 1, 1,-1,-1, 1, 1,-1,-1])153 z = c*np.array([ 1, 1, 1, 1,-1,-1,-1,-1])150 x = a*np.array([+1, -1, +1, -1, +1, -1, +1, -1]) 151 y = b*np.array([+1, +1, -1, -1, +1, +1, -1, -1]) 152 z = c*np.array([+1, +1, +1, +1, -1, -1, -1, -1]) 154 153 x, y, z = transform_xyz(view, jitter, x, y, abs(z)+0.001) 155 ax .plot_trisurf(x, y, triangles=tri, Z=z, color=[1,0.6,0.6], alpha=alpha)156 157 draw_labels(ax , view, jitter, [158 ('c+', [ 0, 0, c], [ 1, 0,0]),159 ('c-', [ 0, 0,-c], [ 0, 0,-1]),160 ('a+', [ a, 0, 0], [ 0, 0,1]),161 ('a-', [-a, 0, 0], [ 0, 0,-1]),162 ('b+', [ 0, b, 0], [-1, 0,0]),163 ('b-', [ 0,-b, 0], [-1, 0,0]),154 axes.plot_trisurf(x, y, triangles=tri, Z=z, color=[1, 0.6, 0.6], alpha=alpha) 155 156 draw_labels(axes, view, jitter, [ 157 ('c+', [+0, +0, +c], [+1, +0, +0]), 158 ('c-', [+0, +0, -c], [+0, +0, -1]), 159 ('a+', [+a, +0, +0], [+0, +0, +1]), 160 ('a-', [-a, +0, +0], [+0, +0, -1]), 161 ('b+', [+0, +b, +0], [-1, +0, +0]), 162 ('b-', [+0, -b, +0], [-1, +0, +0]), 164 163 ]) 165 164 166 def draw_sphere(ax , radius=10., steps=100):165 def draw_sphere(axes, radius=10., steps=100): 167 166 """Draw a sphere""" 168 167 u = np.linspace(0, 2 * np.pi, steps) … … 172 171 y = radius * np.outer(np.sin(u), np.sin(v)) 173 172 z = radius * np.outer(np.ones(np.size(u)), np.cos(v)) 174 ax .plot_surface(x, y, z, rstride=4, cstride=4, color='w')175 176 def draw_jitter(ax , view, jitter, dist='gaussian', size=(0.1, 0.4, 1.0),173 axes.plot_surface(x, y, z, rstride=4, cstride=4, color='w') 174 175 def draw_jitter(axes, view, jitter, dist='gaussian', size=(0.1, 0.4, 1.0), 177 176 draw_shape=draw_parallelepiped): 178 177 """ … … 187 186 cloud = [ 188 187 [-1, -1, -1], 189 [-1, -1, 190 [-1, -1, 191 [-1, 192 [-1, 0,0],193 [-1, 0,1],194 [-1, 195 [-1, 1,0],196 [-1, 1,1],197 [ 198 [ 0, -1,0],199 [ 0, -1,1],200 [ 0,0, -1],201 [ 0, 0,0],202 [ 0, 0,1],203 [ 0,1, -1],204 [ 0, 1,0],205 [ 0, 1,1],206 [ 207 [ 1, -1,0],208 [ 1, -1,1],209 [ 1,0, -1],210 [ 1, 0,0],211 [ 1, 0,1],212 [ 1,1, -1],213 [ 1, 1,0],214 [ 1, 1,1],188 [-1, -1, +0], 189 [-1, -1, +1], 190 [-1, +0, -1], 191 [-1, +0, +0], 192 [-1, +0, +1], 193 [-1, +1, -1], 194 [-1, +1, +0], 195 [-1, +1, +1], 196 [+0, -1, -1], 197 [+0, -1, +0], 198 [+0, -1, +1], 199 [+0, +0, -1], 200 [+0, +0, +0], 201 [+0, +0, +1], 202 [+0, +1, -1], 203 [+0, +1, +0], 204 [+0, +1, +1], 205 [+1, -1, -1], 206 [+1, -1, +0], 207 [+1, -1, +1], 208 [+1, +0, -1], 209 [+1, +0, +0], 210 [+1, +0, +1], 211 [+1, +1, -1], 212 [+1, +1, +0], 213 [+1, +1, +1], 215 214 ] 216 215 dtheta, dphi, dpsi = jitter … … 221 220 if dpsi == 0: 222 221 cloud = [v for v in cloud if v[2] == 0] 223 draw_shape(ax , size, view, [0, 0, 0], steps=100, alpha=0.8)222 draw_shape(axes, size, view, [0, 0, 0], steps=100, alpha=0.8) 224 223 scale = {'gaussian':1, 'rectangle':1/sqrt(3), 'uniform':1/3}[dist] 225 224 for point in cloud: 226 225 delta = [scale*dtheta*point[0], scale*dphi*point[1], scale*dpsi*point[2]] 227 draw_shape(ax , size, view, delta, alpha=0.8)226 draw_shape(axes, size, view, delta, alpha=0.8) 228 227 for v in 'xyz': 229 228 a, b, c = size 230 lim = np.sqrt(a**2 +b**2+c**2)231 getattr(ax , 'set_'+v+'lim')([-lim, lim])232 getattr(ax , v+'axis').label.set_text(v)229 lim = np.sqrt(a**2 + b**2 + c**2) 230 getattr(axes, 'set_'+v+'lim')([-lim, lim]) 231 getattr(axes, v+'axis').label.set_text(v) 233 232 234 233 PROJECTIONS = [ … … 238 237 'azimuthal_equal_area', 239 238 ] 240 def draw_mesh(ax , view, jitter, radius=1.2, n=11, dist='gaussian',239 def draw_mesh(axes, view, jitter, radius=1.2, n=11, dist='gaussian', 241 240 projection='equirectangular'): 242 241 """ … … 297 296 Should allow free movement in theta, but phi is distorted. 298 297 """ 299 theta, phi, psi = view 300 dtheta, dphi, dpsi = jitter 301 302 t = np.linspace(-1, 1, n) 303 weights = np.ones_like(t) 298 # TODO: try Kent distribution instead of a gaussian warped by projection 299 300 dist_x = np.linspace(-1, 1, n) 301 weights = np.ones_like(dist_x) 304 302 if dist == 'gaussian': 305 t*= 3306 weights = exp(-0.5* t**2)303 dist_x *= 3 304 weights = exp(-0.5*dist_x**2) 307 305 elif dist == 'rectangle': 308 306 # Note: uses sasmodels ridiculous definition of rectangle width 309 t*= sqrt(3)307 dist_x *= sqrt(3) 310 308 elif dist == 'uniform': 311 309 pass … … 314 312 315 313 if projection == 'equirectangular': #define PROJECTION 1 316 def rotate(theta_i, phi_j):314 def _rotate(theta_i, phi_j): 317 315 return Rx(phi_j)*Ry(theta_i) 318 def weight(theta_i, phi_j, wi, wj):319 return w i*wj*abs(cos(radians(theta_i)))316 def _weight(theta_i, phi_j, w_i, w_j): 317 return w_i*w_j*abs(cos(radians(theta_i))) 320 318 elif projection == 'sinusoidal': #define PROJECTION 2 321 def rotate(theta_i, phi_j):319 def _rotate(theta_i, phi_j): 322 320 latitude = theta_i 323 321 scale = cos(radians(latitude)) … … 325 323 #print("(%+7.2f, %+7.2f) => (%+7.2f, %+7.2f)"%(theta_i, phi_j, latitude, longitude)) 326 324 return Rx(longitude)*Ry(latitude) 327 def weight(theta_i, phi_j, wi, wj):325 def _weight(theta_i, phi_j, w_i, w_j): 328 326 latitude = theta_i 329 327 scale = cos(radians(latitude)) 330 w= 1 if abs(phi_j) < abs(scale)*180 else 0331 return w*wi*wj328 active = 1 if abs(phi_j) < abs(scale)*180 else 0 329 return active*w_i*w_j 332 330 elif projection == 'guyou': #define PROJECTION 3 (eventually?) 333 def rotate(theta_i, phi_j):334 from guyou import guyou_invert331 def _rotate(theta_i, phi_j): 332 from .guyou import guyou_invert 335 333 #latitude, longitude = guyou_invert([theta_i], [phi_j]) 336 334 longitude, latitude = guyou_invert([phi_j], [theta_i]) 337 335 return Rx(longitude[0])*Ry(latitude[0]) 338 def weight(theta_i, phi_j, wi, wj):339 return w i*wj336 def _weight(theta_i, phi_j, w_i, w_j): 337 return w_i*w_j 340 338 elif projection == 'azimuthal_equidistance': # Note: Rz Ry, not Rx Ry 341 def rotate(theta_i, phi_j):339 def _rotate(theta_i, phi_j): 342 340 latitude = sqrt(theta_i**2 + phi_j**2) 343 341 longitude = degrees(np.arctan2(phi_j, theta_i)) 344 342 #print("(%+7.2f, %+7.2f) => (%+7.2f, %+7.2f)"%(theta_i, phi_j, latitude, longitude)) 345 343 return Rz(longitude)*Ry(latitude) 346 def weight(theta_i, phi_j, wi, wj):344 def _weight(theta_i, phi_j, w_i, w_j): 347 345 # Weighting for each point comes from the integral: 348 346 # \int\int I(q, lat, log) sin(lat) dlat dlog … … 374 372 # the entire sphere, and treats theta and phi identically. 375 373 latitude = sqrt(theta_i**2 + phi_j**2) 376 w = sin(radians(latitude))/latitude if latitude != 0 else 1377 return w *wi*wj if latitude < 180 else 0374 weight = sin(radians(latitude))/latitude if latitude != 0 else 1 375 return weight*w_i*w_j if latitude < 180 else 0 378 376 elif projection == 'azimuthal_equal_area': 379 def rotate(theta_i, phi_j):380 R= min(1, sqrt(theta_i**2 + phi_j**2)/180)381 latitude = 180-degrees(2*np.arccos( R))377 def _rotate(theta_i, phi_j): 378 radius = min(1, sqrt(theta_i**2 + phi_j**2)/180) 379 latitude = 180-degrees(2*np.arccos(radius)) 382 380 longitude = degrees(np.arctan2(phi_j, theta_i)) 383 381 #print("(%+7.2f, %+7.2f) => (%+7.2f, %+7.2f)"%(theta_i, phi_j, latitude, longitude)) 384 382 return Rz(longitude)*Ry(latitude) 385 def weight(theta_i, phi_j, wi, wj):383 def _weight(theta_i, phi_j, w_i, w_j): 386 384 latitude = sqrt(theta_i**2 + phi_j**2) 387 w = sin(radians(latitude))/latitude if latitude != 0 else 1388 return w *wi*wj if latitude < 180 else 0385 weight = sin(radians(latitude))/latitude if latitude != 0 else 1 386 return weight*w_i*w_j if latitude < 180 else 0 389 387 else: 390 388 raise ValueError("unknown projection %r"%projection) 391 389 392 390 # mesh in theta, phi formed by rotating z 391 dtheta, dphi, dpsi = jitter 393 392 z = np.matrix([[0], [0], [radius]]) 394 points = np.hstack([rotate(theta_i, phi_j)*z 395 for theta_i in dtheta*t 396 for phi_j in dphi*t]) 397 # select just the active points (i.e., those with phi < 180 398 w = np.array([weight(theta_i, phi_j, wi, wj) 399 for wi, theta_i in zip(weights, dtheta*t) 400 for wj, phi_j in zip(weights, dphi*t)]) 401 #print(max(w), min(w), min(w[w>0])) 402 points = points[:, w>0] 403 w = w[w>0] 404 w /= max(w) 405 406 if 0: # Kent distribution 407 points = np.hstack([Rx(phi_j)*Ry(theta_i)*z for theta_i in 30*t for phi_j in 60*t]) 408 xp, yp, zp = [np.array(v).flatten() for v in points] 409 kappa = max(1e6, radians(dtheta)/(2*pi)) 410 beta = 1/max(1e-6, radians(dphi)/(2*pi))/kappa 411 w = exp(kappa*zp) #+ beta*(xp**2 + yp**2) 412 print(kappa, dtheta, radians(dtheta), min(w), max(w), sum(w)) 413 #w /= abs(cos(radians( 414 #w /= sum(w) 393 points = np.hstack([_rotate(theta_i, phi_j)*z 394 for theta_i in dtheta*dist_x 395 for phi_j in dphi*dist_x]) 396 dist_w = np.array([_weight(theta_i, phi_j, w_i, w_j) 397 for w_i, theta_i in zip(weights, dtheta*dist_x) 398 for w_j, phi_j in zip(weights, dphi*dist_x)]) 399 #print(max(dist_w), min(dist_w), min(dist_w[dist_w > 0])) 400 points = points[:, dist_w > 0] 401 dist_w = dist_w[dist_w > 0] 402 dist_w /= max(dist_w) 415 403 416 404 # rotate relative to beam … … 419 407 x, y, z = [np.array(v).flatten() for v in points] 420 408 #plt.figure(2); plt.clf(); plt.hist(z, bins=np.linspace(-1, 1, 51)) 421 ax .scatter(x, y, z, c=w, marker='o', vmin=0., vmax=1.)422 423 def draw_labels(ax , view, jitter, text):409 axes.scatter(x, y, z, c=dist_w, marker='o', vmin=0., vmax=1.) 410 411 def draw_labels(axes, view, jitter, text): 424 412 """ 425 413 Draw text at a particular location. … … 435 423 for label, p, zdir in zip(labels, zip(px, py, pz), zip(dx, dy, dz)): 436 424 zdir = np.asarray(zdir).flatten() 437 ax .text(p[0], p[1], p[2], label, zdir=zdir)425 axes.text(p[0], p[1], p[2], label, zdir=zdir) 438 426 439 427 # Definition of rotation matrices comes from wikipedia: … … 441 429 def Rx(angle): 442 430 """Construct a matrix to rotate points about *x* by *angle* degrees.""" 443 a = radians(angle)444 R= [[1, 0, 0],445 [0, +cos(a), -sin(a)],446 [0, +sin(a), +cos(a)]]447 return np.matrix( R)431 angle = radians(angle) 432 rot = [[1, 0, 0], 433 [0, +cos(angle), -sin(angle)], 434 [0, +sin(angle), +cos(angle)]] 435 return np.matrix(rot) 448 436 449 437 def Ry(angle): 450 438 """Construct a matrix to rotate points about *y* by *angle* degrees.""" 451 a = radians(angle)452 R = [[+cos(a), 0, +sin(a)],453 [0, 1, 0],454 [-sin(a), 0, +cos(a)]]455 return np.matrix( R)439 angle = radians(angle) 440 rot = [[+cos(angle), 0, +sin(angle)], 441 [0, 1, 0], 442 [-sin(angle), 0, +cos(angle)]] 443 return np.matrix(rot) 456 444 457 445 def Rz(angle): 458 446 """Construct a matrix to rotate points about *z* by *angle* degrees.""" 459 a = radians(angle)460 R = [[+cos(a), -sin(a), 0],461 [+sin(a), +cos(a), 0],462 [0, 0, 1]]463 return np.matrix( R)447 angle = radians(angle) 448 rot = [[+cos(angle), -sin(angle), 0], 449 [+sin(angle), +cos(angle), 0], 450 [0, 0, 1]] 451 return np.matrix(rot) 464 452 465 453 def transform_xyz(view, jitter, x, y, z): … … 469 457 x, y, z = [np.asarray(v) for v in (x, y, z)] 470 458 shape = x.shape 471 points = np.matrix([x.flatten(), y.flatten(),z.flatten()])459 points = np.matrix([x.flatten(), y.flatten(), z.flatten()]) 472 460 points = apply_jitter(jitter, points) 473 461 points = orient_relative_to_beam(view, points) … … 526 514 return data[offset], data[-1] 527 515 528 def draw_scattering(calculator, ax , view, jitter, dist='gaussian'):516 def draw_scattering(calculator, axes, view, jitter, dist='gaussian'): 529 517 """ 530 518 Plot the scattering for the particular view. 531 519 532 *calculator* is returned from :func:`build_model`. *ax * are the 3D axes520 *calculator* is returned from :func:`build_model`. *axes* are the 3D axes 533 521 on which the data will be plotted. *view* and *jitter* are the current 534 522 orientation and orientation dispersity. *dist* is one of the sasmodels … … 543 531 theta, phi, psi = view 544 532 theta_pd, phi_pd, psi_pd = [scale*v for v in jitter] 545 theta_pd_n, phi_pd_n, psi_pd_n = PD_N_TABLE[(theta_pd >0, phi_pd>0, psi_pd>0)]533 theta_pd_n, phi_pd_n, psi_pd_n = PD_N_TABLE[(theta_pd > 0, phi_pd > 0, psi_pd > 0)] 546 534 ## increase pd_n for testing jitter integration rather than simple viz 547 535 #theta_pd_n, phi_pd_n, psi_pd_n = [5*v for v in (theta_pd_n, phi_pd_n, psi_pd_n)] … … 571 559 if 0: 572 560 level = np.asarray(255*(Iqxy - vmin)/(vmax - vmin), 'i') 573 level[level <0] = 0561 level[level < 0] = 0 574 562 colors = plt.get_cmap()(level) 575 ax .plot_surface(qx, qy, -1.1, rstride=1, cstride=1, facecolors=colors)563 axes.plot_surface(qx, qy, -1.1, rstride=1, cstride=1, facecolors=colors) 576 564 elif 1: 577 ax .contourf(qx/qx.max(), qy/qy.max(), Iqxy, zdir='z', offset=-1.1,578 levels=np.linspace(vmin, vmax, 24))565 axes.contourf(qx/qx.max(), qy/qy.max(), Iqxy, zdir='z', offset=-1.1, 566 levels=np.linspace(vmin, vmax, 24)) 579 567 else: 580 ax .pcolormesh(qx, qy, Iqxy)568 axes.pcolormesh(qx, qy, Iqxy) 581 569 582 570 def build_model(model_name, n=150, qmax=0.5, **pars): … … 595 583 for details. 596 584 """ 597 from sasmodels.core import load_model_info, build_model 585 from sasmodels.core import load_model_info, build_model as build_sasmodel 598 586 from sasmodels.data import empty_data2D 599 587 from sasmodels.direct_model import DirectModel 600 588 601 589 model_info = load_model_info(model_name) 602 model = build_ model(model_info) #, dtype='double!')590 model = build_sasmodel(model_info) #, dtype='double!') 603 591 q = np.linspace(-qmax, qmax, n) 604 592 data = empty_data2D(q, q) … … 618 606 return calculator 619 607 620 def select_calculator(model_name, n=150, size=(10, 40,100)):608 def select_calculator(model_name, n=150, size=(10, 40, 100)): 621 609 """ 622 610 Create a model calculator for the given shape. … … 641 629 radius = 0.5*c 642 630 calculator = build_model('sc_paracrystal', n=n, dnn=dnn, 643 644 631 d_factor=d_factor, radius=(1-d_factor)*radius, 632 background=0) 645 633 elif model_name == 'fcc_paracrystal': 646 634 a = b = c … … 650 638 radius = sqrt(2)/4 * c 651 639 calculator = build_model('fcc_paracrystal', n=n, dnn=dnn, 652 653 640 d_factor=d_factor, radius=(1-d_factor)*radius, 641 background=0) 654 642 elif model_name == 'bcc_paracrystal': 655 643 a = b = c … … 659 647 radius = sqrt(3)/2 * c 660 648 calculator = build_model('bcc_paracrystal', n=n, dnn=dnn, 661 662 649 d_factor=d_factor, radius=(1-d_factor)*radius, 650 background=0) 663 651 elif model_name == 'cylinder': 664 652 calculator = build_model('cylinder', n=n, qmax=0.3, radius=b, length=c) … … 685 673 'cylinder', 686 674 'fcc_paracrystal', 'bcc_paracrystal', 'sc_paracrystal', 687 675 ] 688 676 689 677 DRAW_SHAPES = { … … 751 739 plt.gcf().canvas.set_window_title(projection) 752 740 #gs = gridspec.GridSpec(2,1,height_ratios=[4,1]) 753 #ax = plt.subplot(gs[0], projection='3d')754 ax = plt.axes([0.0, 0.2, 1.0, 0.8], projection='3d')741 #axes = plt.subplot(gs[0], projection='3d') 742 axes = plt.axes([0.0, 0.2, 1.0, 0.8], projection='3d') 755 743 try: # CRUFT: not all versions of matplotlib accept 'square' 3d projection 756 ax .axis('square')744 axes.axis('square') 757 745 except Exception: 758 746 pass … … 761 749 762 750 ## add control widgets to plot 763 ax theta= plt.axes([0.1, 0.15, 0.45, 0.04], axisbg=axcolor)764 ax phi = plt.axes([0.1, 0.1, 0.45, 0.04], axisbg=axcolor)765 ax psi = plt.axes([0.1, 0.05, 0.45, 0.04], axisbg=axcolor)766 stheta = Slider(ax theta, 'Theta', -90, 90, valinit=theta)767 sphi = Slider(ax phi, 'Phi', -180, 180, valinit=phi)768 spsi = Slider(ax psi, 'Psi', -180, 180, valinit=psi)769 770 ax dtheta= plt.axes([0.75, 0.15, 0.15, 0.04], axisbg=axcolor)771 ax dphi = plt.axes([0.75, 0.1, 0.15, 0.04], axisbg=axcolor)772 ax dpsi= plt.axes([0.75, 0.05, 0.15, 0.04], axisbg=axcolor)751 axes_theta = plt.axes([0.1, 0.15, 0.45, 0.04], axisbg=axcolor) 752 axes_phi = plt.axes([0.1, 0.1, 0.45, 0.04], axisbg=axcolor) 753 axes_psi = plt.axes([0.1, 0.05, 0.45, 0.04], axisbg=axcolor) 754 stheta = Slider(axes_theta, 'Theta', -90, 90, valinit=theta) 755 sphi = Slider(axes_phi, 'Phi', -180, 180, valinit=phi) 756 spsi = Slider(axes_psi, 'Psi', -180, 180, valinit=psi) 757 758 axes_dtheta = plt.axes([0.75, 0.15, 0.15, 0.04], axisbg=axcolor) 759 axes_dphi = plt.axes([0.75, 0.1, 0.15, 0.04], axisbg=axcolor) 760 axes_dpsi = plt.axes([0.75, 0.05, 0.15, 0.04], axisbg=axcolor) 773 761 # Note: using ridiculous definition of rectangle distribution, whose width 774 762 # in sasmodels is sqrt(3) times the given width. Divide by sqrt(3) to keep 775 763 # the maximum width to 90. 776 764 dlimit = DIST_LIMITS[dist] 777 sdtheta = Slider(ax dtheta, 'dTheta', 0, 2*dlimit, valinit=dtheta)778 sdphi = Slider(ax dphi, 'dPhi', 0, 2*dlimit, valinit=dphi)779 sdpsi = Slider(ax dpsi, 'dPsi', 0, 2*dlimit, valinit=dpsi)765 sdtheta = Slider(axes_dtheta, 'dTheta', 0, 2*dlimit, valinit=dtheta) 766 sdphi = Slider(axes_dphi, 'dPhi', 0, 2*dlimit, valinit=dphi) 767 sdpsi = Slider(axes_dpsi, 'dPsi', 0, 2*dlimit, valinit=dpsi) 780 768 781 769 … … 788 776 limit = [0, 0, 0.5, 5][dims] 789 777 jitter = [0 if v < limit else v for v in jitter] 790 ax .cla()791 draw_beam(ax , (0, 0))792 draw_jitter(ax , view, jitter, dist=dist, size=size, draw_shape=draw_shape)793 #draw_jitter(ax , view, (0,0,0))794 draw_mesh(ax , view, jitter, dist=dist, n=mesh, projection=projection)795 draw_scattering(calculator, ax , view, jitter, dist=dist)778 axes.cla() 779 draw_beam(axes, (0, 0)) 780 draw_jitter(axes, view, jitter, dist=dist, size=size, draw_shape=draw_shape) 781 #draw_jitter(axes, view, (0,0,0)) 782 draw_mesh(axes, view, jitter, dist=dist, n=mesh, projection=projection) 783 draw_scattering(calculator, axes, view, jitter, dist=dist) 796 784 plt.gcf().canvas.draw() 797 785 798 786 ## bind control widgets to view updater 799 stheta.on_changed(lambda v: update(v, 'theta'))787 stheta.on_changed(lambda v: update(v, 'theta')) 800 788 sphi.on_changed(lambda v: update(v, 'phi')) 801 789 spsi.on_changed(lambda v: update(v, 'psi')) … … 815 803 formatter_class=argparse.ArgumentDefaultsHelpFormatter, 816 804 ) 817 parser.add_argument('-p', '--projection', choices=PROJECTIONS, default=PROJECTIONS[0], help='coordinate projection') 818 parser.add_argument('-s', '--size', type=str, default='10,40,100', help='a,b,c lengths') 819 parser.add_argument('-d', '--distribution', choices=DISTRIBUTIONS, default=DISTRIBUTIONS[0], help='jitter distribution') 820 parser.add_argument('-m', '--mesh', type=int, default=30, help='#points in theta-phi mesh') 821 parser.add_argument('shape', choices=SHAPES, nargs='?', default=SHAPES[0], help='oriented shape') 805 parser.add_argument('-p', '--projection', choices=PROJECTIONS, 806 default=PROJECTIONS[0], 807 help='coordinate projection') 808 parser.add_argument('-s', '--size', type=str, default='10,40,100', 809 help='a,b,c lengths') 810 parser.add_argument('-d', '--distribution', choices=DISTRIBUTIONS, 811 default=DISTRIBUTIONS[0], 812 help='jitter distribution') 813 parser.add_argument('-m', '--mesh', type=int, default=30, 814 help='#points in theta-phi mesh') 815 parser.add_argument('shape', choices=SHAPES, nargs='?', default=SHAPES[0], 816 help='oriented shape') 822 817 opts = parser.parse_args() 823 818 size = tuple(int(v) for v in opts.size.split(',')) -
sasmodels/kernel_iq.c
raadec17 rd86f0fc 173 173 // Apply the rotation matrix returned from qac_rotation to the point (qx,qy), 174 174 // returning R*[qx,qy]' = [qa,qc]' 175 static double175 static void 176 176 qac_apply( 177 177 QACRotation *rotation, … … 246 246 // Apply the rotation matrix returned from qabc_rotation to the point (qx,qy), 247 247 // returning R*[qx,qy]' = [qa,qb,qc]' 248 static double248 static void 249 249 qabc_apply( 250 250 QABCRotation *rotation, -
sasmodels/kernelcl.py
r6cbdcd4 rd86f0fc 151 151 if not HAVE_OPENCL: 152 152 raise RuntimeError("OpenCL startup failed with ***" 153 + OPENCL_ERROR + "***; using C compiler instead")153 + OPENCL_ERROR + "***; using C compiler instead") 154 154 reset_environment() 155 155 if ENV is None: -
sasmodels/models/core_shell_cylinder.c
r108e70e rd86f0fc 48 48 49 49 50 double Iqac(double qab, double qc, 50 static double 51 Iqac(double qab, double qc, 51 52 double core_sld, 52 53 double shell_sld, -
sasmodels/models/hollow_rectangular_prism.c
r108e70e rd86f0fc 1 double form_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness); 2 double Iq(double q, double sld, double solvent_sld, double length_a, 3 double b2a_ratio, double c2a_ratio, double thickness); 4 5 double form_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 1 static double 2 form_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 6 3 { 7 4 double length_b = length_a * b2a_ratio; … … 16 13 } 17 14 18 double Iq(double q, 15 static double 16 Iq(double q, 19 17 double sld, 20 18 double solvent_sld, … … 85 83 } 86 84 87 double Iqabc(double qa, double qb, double qc, 85 static double 86 Iqabc(double qa, double qb, double qc, 88 87 double sld, 89 88 double solvent_sld, -
sasmodels/models/hollow_rectangular_prism_thin_walls.c
r74768cb rd86f0fc 1 double form_volume(double length_a, double b2a_ratio, double c2a_ratio); 2 double Iq(double q, double sld, double solvent_sld, double length_a, 3 double b2a_ratio, double c2a_ratio); 4 5 double form_volume(double length_a, double b2a_ratio, double c2a_ratio) 1 static double 2 form_volume(double length_a, double b2a_ratio, double c2a_ratio) 6 3 { 7 4 double length_b = length_a * b2a_ratio; … … 11 8 } 12 9 13 double Iq(double q, 10 static double 11 Iq(double q, 14 12 double sld, 15 13 double solvent_sld, -
sasmodels/models/rectangular_prism.c
r108e70e rd86f0fc 1 double form_volume(double length_a, double b2a_ratio, double c2a_ratio); 2 double Iq(double q, double sld, double solvent_sld, double length_a, 3 double b2a_ratio, double c2a_ratio); 4 5 double form_volume(double length_a, double b2a_ratio, double c2a_ratio) 1 static double 2 form_volume(double length_a, double b2a_ratio, double c2a_ratio) 6 3 { 7 4 return length_a * (length_a*b2a_ratio) * (length_a*c2a_ratio); 8 5 } 9 6 10 double Iq(double q, 7 static double 8 Iq(double q, 11 9 double sld, 12 10 double solvent_sld, … … 71 69 72 70 73 double Iqabc(double qa, double qb, double qc, 71 static double 72 Iqabc(double qa, double qb, double qc, 74 73 double sld, 75 74 double solvent_sld, -
sasmodels/multiscat.py
r49d1f8b8 rb3703f5 73 73 import argparse 74 74 import time 75 import os.path76 75 77 76 import numpy as np … … 81 80 from sasmodels import core 82 81 from sasmodels import compare 83 from sasmodels import resolution2d84 82 from sasmodels.resolution import Resolution, bin_edges 85 from sasmodels.data import empty_data1D, empty_data2D, plot_data86 83 from sasmodels.direct_model import call_kernel 87 84 import sasmodels.kernelcl … … 106 103 USE_FAST = True # OpenCL faster, less accurate math 107 104 108 class NumpyCalculator: 105 class ICalculator: 106 """ 107 Multiple scattering calculator 108 """ 109 def fft(self, Iq): 110 """ 111 Compute the forward FFT for an image, real -> complex. 112 """ 113 raise NotImplementedError() 114 115 def ifft(self, Iq): 116 """ 117 Compute the inverse FFT for an image, complex -> complex. 118 """ 119 raise NotImplementedError() 120 121 def mulitple_scattering(self, Iq): 122 r""" 123 Compute multiple scattering for I(q) given scattering probability p. 124 125 Given a probability p of scattering with the thickness, the expected 126 number of scattering events, $\lambda$ is $-\log(1 - p)$, giving a 127 Poisson weighted sum of single, double, triple, etc. scattering patterns. 128 The number of patterns used is based on coverage (default 99%). 129 """ 130 raise NotImplementedError() 131 132 class NumpyCalculator(ICalculator): 133 """ 134 Multiple scattering calculator using numpy fft. 135 """ 109 136 def __init__(self, dims=None, dtype=PRECISION): 110 137 self.dtype = dtype 111 138 self.complex_dtype = np.dtype('F') if dtype == np.dtype('f') else np.dtype('D') 112 pass113 139 114 140 def fft(self, Iq): … … 127 153 128 154 def multiple_scattering(self, Iq, p, coverage=0.99): 129 r"""130 Compute multiple scattering for I(q) given scattering probability p.131 132 Given a probability p of scattering with the thickness, the expected133 number of scattering events, $\lambda$ is $-\log(1 - p)$, giving a134 Poisson weighted sum of single, double, triple, etc. scattering patterns.135 The number of patterns used is based on coverage (default 99%).136 """137 155 #t0 = time.time() 138 156 coeffs = scattering_coeffs(p, coverage) … … 140 158 scale = np.sum(Iq) 141 159 frame = _forward_shift(Iq/scale, dtype=self.dtype) 142 F= np.fft.fft2(frame)143 F_convolved = F * np.polyval(poly, F)144 frame = np.fft.ifft2( F_convolved)160 fourier_frame = np.fft.fft2(frame) 161 convolved = fourier_frame * np.polyval(poly, fourier_frame) 162 frame = np.fft.ifft2(convolved) 145 163 result = scale * _inverse_shift(frame.real, dtype=self.dtype) 146 164 #print("numpy multiscat time", time.time()-t0) … … 173 191 """ 174 192 175 class OpenclCalculator(NumpyCalculator): 193 class OpenclCalculator(ICalculator): 194 """ 195 Multiple scattering calculator using OpenCL via pyfft. 196 """ 176 197 polyval1f = None 177 198 polyval1d = None … … 180 201 context = env.get_context(dtype) 181 202 if dtype == np.dtype('f'): 182 if self.polyval1f is None:203 if OpenclCalculator.polyval1f is None: 183 204 program = sasmodels.kernelcl.compile_model( 184 205 context, POLYVAL1_KERNEL, dtype, fast=USE_FAST) … … 187 208 self.dtype = dtype 188 209 self.complex_dtype = np.dtype('F') 189 self.polyval1 = self.polyval1f210 self.polyval1 = OpenclCalculator.polyval1f 190 211 else: 191 if self.polyval1d is None:212 if OpenclCalculator.polyval1d is None: 192 213 program = sasmodels.kernelcl.compile_model( 193 214 context, POLYVAL1_KERNEL, dtype, fast=False) … … 196 217 self.dtype = dtype 197 218 self.complex_type = np.dtype('D') 198 self.polyval1 = self.polyval1d219 self.polyval1 = OpenclCalculator.polyval1d 199 220 self.queue = env.get_queue(dtype) 200 221 self.plan = pyfft.cl.Plan(dims, queue=self.queue) … … 229 250 gpu_poly = cl_array.to_device(self.queue, poly) 230 251 self.plan.execute(gpu_data.data) 231 degree, n= poly.shape[0], frame.shape[0]*frame.shape[1]252 degree, data_size= poly.shape[0], frame.shape[0]*frame.shape[1] 232 253 self.polyval1( 233 self.queue, [ n], None,234 np.int32(degree), gpu_poly.data, np.int32( n), gpu_data.data)254 self.queue, [data_size], None, 255 np.int32(degree), gpu_poly.data, np.int32(data_size), gpu_data.data) 235 256 self.plan.execute(gpu_data.data, inverse=True) 236 257 frame = gpu_data.get() … … 251 272 """ 252 273 if transform is None: 253 n x, ny = Iq.shape254 transform = Calculator(dims=(n x*2, ny*2), dtype=dtype)274 n_x, n_y = Iq.shape 275 transform = Calculator(dims=(n_x*2, n_y*2), dtype=dtype) 255 276 scale = np.sum(Iq) 256 277 frame = _forward_shift(Iq/scale, dtype=dtype) … … 261 282 262 283 def scattering_coeffs(p, coverage=0.99): 284 r""" 285 Return the coefficients of the scattering powers for transmission 286 probability *p*. This is just the corresponding values for the 287 Poisson distribution for $\lambda = -\ln(1-p)$ such that 288 $\sum_{k = 0 \ldots n} P(k; \lambda)$ is larger than *coverage*. 289 """ 263 290 L = -np.log(1-p) 264 291 num_scatter = truncated_poisson_invcdf(coverage, L) … … 266 293 return coeffs 267 294 268 def truncated_poisson_invcdf( p, L):295 def truncated_poisson_invcdf(coverage, L): 269 296 r""" 270 Return smallest k such that cdf(k; L) > pfrom the truncated Poisson297 Return smallest k such that cdf(k; L) > coverage from the truncated Poisson 271 298 probability excluding k=0 272 299 """ … … 275 302 pmf = -np.exp(-L) / np.expm1(-L) 276 303 k = 0 277 while cdf < p:304 while cdf < coverage: 278 305 k += 1 279 306 pmf *= L/k … … 305 332 306 333 class MultipleScattering(Resolution): 334 r""" 335 Compute multiple scattering using Fourier convolution. 336 337 The fourier steps are determined by *qmax*, the maximum $q$ value 338 desired, *nq* the number of $q$ steps and *window*, the amount 339 of padding around the circular convolution. The $q$ spacing 340 will be $\Delta q = 2 q_\mathrm{max} w / n_q$. If *nq* is not 341 given it will use $n_q = 2^k$ such that $\Delta q < q_\mathrm{min}$. 342 343 *probability* is related to the expected number of scattering 344 events in the sample $\lambda$ as $p = 1 = e^{-\lambda}$. As a 345 hack to allow probability to be a fitted parameter, the "value" 346 can be a function that takes no parameters and returns the current 347 value of the probability. *coverage* determines how many scattering 348 steps to consider. The default is 0.99, which sets $n$ such that 349 $1 \ldots n$ covers 99% of the Poisson probability mass function. 350 351 *is2d* is True then 2D scattering is used, otherwise it accepts 352 and returns 1D scattering. 353 354 *resolution* is the resolution function to apply after multiple 355 scattering. If present, then the resolution $q$ vectors will provide 356 default values for *qmin*, *qmax* and *nq*. 357 """ 307 358 def __init__(self, qmin=None, qmax=None, nq=None, window=2, 308 359 probability=None, coverage=0.99, 309 360 is2d=False, resolution=None, 310 361 dtype=PRECISION): 311 r"""312 Compute multiple scattering using Fourier convolution.313 314 The fourier steps are determined by *qmax*, the maximum $q$ value315 desired, *nq* the number of $q$ steps and *window*, the amount316 of padding around the circular convolution. The $q$ spacing317 will be $\Delta q = 2 q_\mathrm{max} w / n_q$. If *nq* is not318 given it will use $n_q = 2^k$ such that $\Delta q < q_\mathrm{min}$.319 320 *probability* is related to the expected number of scattering321 events in the sample $\lambda$ as $p = 1 = e^{-\lambda}$. As a322 hack to allow probability to be a fitted parameter, the "value"323 can be a function that takes no parameters and returns the current324 value of the probability. *coverage* determines how many scattering325 steps to consider. The default is 0.99, which sets $n$ such that326 $1 \ldots n$ covers 99% of the Poisson probability mass function.327 328 *is2d* is True then 2D scattering is used, otherwise it accepts329 and returns 1D scattering.330 331 *resolution* is the resolution function to apply after multiple332 scattering. If present, then the resolution $q$ vectors will provide333 default values for *qmin*, *qmax* and *nq*.334 """335 362 # Infer qmin, qmax from instrument resolution calculator, if present 336 363 if resolution is not None: … … 424 451 # Prepare the multiple scattering calculator (either numpy or OpenCL) 425 452 self.transform = Calculator((2*nq, 2*nq), dtype=dtype) 453 454 # Iq and Iqxy will be set during apply 455 self.Iq = None # type: np.ndarray 456 self.Iqxy = None # type: np.ndarray 426 457 427 458 def apply(self, theory): … … 471 502 472 503 def radial_profile(self, Iqxy): 504 """ 505 Compute that radial profile for the given Iqxy grid. The grid should 506 be defined as for 507 """ 473 508 # circular average, no anti-aliasing 474 509 Iq = np.histogram(self._radius, bins=self._edges, weights=Iqxy)[0]/self._norm … … 478 513 def annular_average(qxy, Iqxy, qbins): 479 514 """ 480 Compute annular average of points at 515 Compute annular average of points in *Iqxy* at *qbins*. The $q_x$, $q_y$ 516 coordinates for *Iqxy* are given in *qxy*. 481 517 """ 482 518 qxy, Iqxy = qxy.flatten(), Iqxy.flatten() … … 513 549 def parse_pars(model, opts): 514 550 # type: (ModelInfo, argparse.Namespace) -> Dict[str, float] 551 """ 552 Parse par=val arguments from the command line. 553 """ 515 554 516 555 seed = np.random.randint(1000000) if opts.random and opts.seed < 0 else opts.seed … … 526 565 'is2d': opts.is2d, 527 566 } 528 pars, pars2 = compare.parse_pars(compare_opts) 567 # Note: sascomp allows comparison on a pair of models, so ignore the second. 568 pars, _ = compare.parse_pars(compare_opts) 529 569 return pars 530 570 … … 535 575 formatter_class=argparse.ArgumentDefaultsHelpFormatter, 536 576 ) 537 parser.add_argument('-p', '--probability', type=float, default=0.1, help="scattering probability") 538 parser.add_argument('-n', '--nq', type=int, default=1024, help='number of mesh points') 539 parser.add_argument('-q', '--qmax', type=float, default=0.5, help='max q') 540 parser.add_argument('-w', '--window', type=float, default=2.0, help='q calc = q max * window') 541 parser.add_argument('-2', '--2d', dest='is2d', action='store_true', help='oriented sample') 542 parser.add_argument('-s', '--seed', default=-1, help='random pars with given seed') 543 parser.add_argument('-r', '--random', action='store_true', help='random pars with random seed') 544 parser.add_argument('-o', '--outfile', type=str, default="", help='random pars with random seed') 545 parser.add_argument('model', type=str, help='sas model name such as cylinder') 546 parser.add_argument('pars', type=str, nargs='*', help='model parameters such as radius=30') 577 parser.add_argument('-p', '--probability', type=float, default=0.1, 578 help="scattering probability") 579 parser.add_argument('-n', '--nq', type=int, default=1024, 580 help='number of mesh points') 581 parser.add_argument('-q', '--qmax', type=float, default=0.5, 582 help='max q') 583 parser.add_argument('-w', '--window', type=float, default=2.0, 584 help='q calc = q max * window') 585 parser.add_argument('-2', '--2d', dest='is2d', action='store_true', 586 help='oriented sample') 587 parser.add_argument('-s', '--seed', default=-1, 588 help='random pars with given seed') 589 parser.add_argument('-r', '--random', action='store_true', 590 help='random pars with random seed') 591 parser.add_argument('-o', '--outfile', type=str, default="", 592 help='random pars with random seed') 593 parser.add_argument('model', type=str, 594 help='sas model name such as cylinder') 595 parser.add_argument('pars', type=str, nargs='*', 596 help='model parameters such as radius=30') 547 597 opts = parser.parse_args() 548 598 assert opts.nq%2 == 0, "require even # points" … … 592 642 plotxy((res._q_steps, res._q_steps), res.Iqxy+background) 593 643 pylab.title("total scattering for p=%g" % probability) 644 if res.resolution is not None: 645 pylab.figure() 646 plotxy((res._q_steps, res._q_steps), result) 647 pylab.title("total scattering with resolution") 594 648 else: 595 649 q = res._q … … 609 663 # Plot 1D pattern for partial scattering 610 664 pylab.loglog(q, res.Iq+background, label="total for p=%g"%probability) 665 if res.resolution is not None: 666 pylab.loglog(q, result, label="total with dQ") 611 667 #new_annulus = annular_average(res._radius, res.Iqxy, res._edges) 612 668 #pylab.loglog(q, new_annulus+background, label="new total for p=%g"%probability)
Note: See TracChangeset
for help on using the changeset viewer.