Changeset e6b97f5 in sasmodels
- Timestamp:
- Mar 18, 2016 1:06:12 PM (9 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 9ef9dd9
- Parents:
- 0b05c24 (diff), 9c77bcf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/genmodel.py
r044a9c1 r824465b 29 29 'q_max' : 1.0, 30 30 'nq' : 1000, 31 'nq2d' : 100 ,31 'nq2d' : 1000, 32 32 'vmin' : 1e-3, # floor for the 2D data results 33 33 'qx_max' : 0.5, 34 #'colormap' : 'gist_ncar', 35 'colormap' : 'jet', 34 36 } 35 37 … … 61 63 Iq2D = np.log(np.clip(Iq2D, opts['vmin'], np.inf)) 62 64 ax.imshow(Iq2D, interpolation='nearest', aspect=1, origin='lower', 63 extent=[-qx_max, qx_max, -qx_max, qx_max], cmap= pylab.cm.jet)65 extent=[-qx_max, qx_max, -qx_max, qx_max], cmap=opts['colormap']) 64 66 ax.set_xlabel(r'$Q_x \/(\AA^{-1})$') 65 67 ax.set_ylabel(r'$Q_y \/(\AA^{-1})$') 66 67 # im = self.subplot.imshow(output, interpolation='nearest',68 # origin='lower',69 # vmin=zmin_temp, vmax=self.zmax_2D,70 # cmap=self.cmap,71 # extent=(self.xmin_2D, self.xmax_2D,72 # self.ymin_2D, self.ymax_2D))73 74 def ice_cm():75 from matplotlib._cm import _Blues_data76 from matplotlib import colors77 from matplotlib import rcParams78 def from_white(segments):79 scale = 1.0/segments[0][1]80 return [(k, v*scale, w*scale) for k, v, w in segments]81 ice_data = dict((k,from_white(v)) for k,v in _Blues_data.items())82 ice = colors.LinearSegmentedColormap("ice", ice_data, rcParams['image.lut'])83 return ice84 85 68 86 69 # Generate image -
sasmodels/compare.py
rd6850fa raf92b73 539 539 try: 540 540 base_value, base_time = time_calculation(base, pars, Nbase) 541 print("%s t=%. 1f ms, intensity=%.0f"541 print("%s t=%.2f ms, intensity=%.0f" 542 542 % (base.engine, base_time, sum(base_value))) 543 543 except ImportError: … … 550 550 try: 551 551 comp_value, comp_time = time_calculation(comp, pars, Ncomp) 552 print("%s t=%. 1f ms, intensity=%.0f"552 print("%s t=%.2f ms, intensity=%.0f" 553 553 % (comp.engine, comp_time, sum(comp_value))) 554 554 except ImportError: … … 584 584 if Ncomp > 0: plt.subplot(131) 585 585 plot_theory(data, base_value, view=view, use_data=False, limits=limits) 586 plt.title("%s t=%. 1f ms"%(base.engine, base_time))586 plt.title("%s t=%.2f ms"%(base.engine, base_time)) 587 587 #cbar_title = "log I" 588 588 if Ncomp > 0: 589 589 if Nbase > 0: plt.subplot(132) 590 590 plot_theory(data, comp_value, view=view, use_data=False, limits=limits) 591 plt.title("%s t=%. 1f ms"%(comp.engine, comp_time))591 plt.title("%s t=%.2f ms"%(comp.engine, comp_time)) 592 592 #cbar_title = "log I" 593 593 if Ncomp > 0 and Nbase > 0: -
sasmodels/data.py
rc094758 r092cb3c 389 389 if view is 'log': 390 390 mdata[mdata <= 0] = masked 391 plt.errorbar(data.x /10, scale*mdata, yerr=data.dy, fmt='.')391 plt.errorbar(data.x, scale*mdata, yerr=data.dy, fmt='.') 392 392 all_positive = all_positive and (mdata > 0).all() 393 393 some_present = some_present or (mdata.count() > 0) … … 412 412 if view == 'q4' or not some_present or not all_positive 413 413 else view) 414 plt.xlabel("$q$/ nm$^{-1}$")414 plt.xlabel("$q$/A$^{-1}$") 415 415 plt.ylabel('$I(q)$') 416 416 … … 422 422 if num_plots > 1: 423 423 plt.subplot(1, num_plots, (use_data or use_theory) + 1) 424 plt.plot(data.x /10, mresid, '-')425 plt.xlabel("$q$/ nm$^{-1}$")424 plt.plot(data.x, mresid, '-') 425 plt.xlabel("$q$/A$^{-1}$") 426 426 plt.ylabel('residuals') 427 427 plt.xscale('linear' if not some_present else view) -
sasmodels/models/lib/j0_cephes.c
r95ce773 r0b05c24 52 52 /* Note: all coefficients satisfy the relative error criterion 53 53 * except YP, YQ which are designed for absolute error. */ 54 55 56 constant double PPJ0[8] = { 57 7.96936729297347051624E-4, 58 8.28352392107440799803E-2, 59 1.23953371646414299388E0, 60 5.44725003058768775090E0, 61 8.74716500199817011941E0, 62 5.30324038235394892183E0, 63 9.99999999999999997821E-1, 64 0.0 65 }; 66 67 constant double PQJ0[8] = { 68 9.24408810558863637013E-4, 69 8.56288474354474431428E-2, 70 1.25352743901058953537E0, 71 5.47097740330417105182E0, 72 8.76190883237069594232E0, 73 5.30605288235394617618E0, 74 1.00000000000000000218E0, 75 0.0 76 }; 77 78 constant double QPJ0[8] = { 79 -1.13663838898469149931E-2, 80 -1.28252718670509318512E0, 81 -1.95539544257735972385E1, 82 -9.32060152123768231369E1, 83 -1.77681167980488050595E2, 84 -1.47077505154951170175E2, 85 -5.14105326766599330220E1, 86 -6.05014350600728481186E0, 87 }; 88 89 constant double QQJ0[8] = { 90 /* 1.00000000000000000000E0,*/ 91 6.43178256118178023184E1, 92 8.56430025976980587198E2, 93 3.88240183605401609683E3, 94 7.24046774195652478189E3, 95 5.93072701187316984827E3, 96 2.06209331660327847417E3, 97 2.42005740240291393179E2, 98 }; 99 100 constant double YPJ0[8] = { 101 1.55924367855235737965E4, 102 -1.46639295903971606143E7, 103 5.43526477051876500413E9, 104 -9.82136065717911466409E11, 105 8.75906394395366999549E13, 106 -3.46628303384729719441E15, 107 4.42733268572569800351E16, 108 -1.84950800436986690637E16, 109 }; 110 111 112 constant double YQJ0[7] = { 113 /* 1.00000000000000000000E0,*/ 114 1.04128353664259848412E3, 115 6.26107330137134956842E5, 116 2.68919633393814121987E8, 117 8.64002487103935000337E10, 118 2.02979612750105546709E13, 119 3.17157752842975028269E15, 120 2.50596256172653059228E17, 121 }; 122 123 constant double RPJ0[8] = { 124 -4.79443220978201773821E9, 125 1.95617491946556577543E12, 126 -2.49248344360967716204E14, 127 9.70862251047306323952E15, 128 0.0, 129 0.0, 130 0.0, 131 0.0 132 }; 133 134 constant double RQJ0[8] = { 135 /* 1.00000000000000000000E0,*/ 136 4.99563147152651017219E2, 137 1.73785401676374683123E5, 138 4.84409658339962045305E7, 139 1.11855537045356834862E10, 140 2.11277520115489217587E12, 141 3.10518229857422583814E14, 142 3.18121955943204943306E16, 143 1.71086294081043136091E18, 144 }; 145 146 constant double MOJ0[8] = { 147 -6.838999669318810E-002, 148 1.864949361379502E-001, 149 -2.145007480346739E-001, 150 1.197549369473540E-001, 151 -3.560281861530129E-003, 152 -4.969382655296620E-002, 153 -3.355424622293709E-006, 154 7.978845717621440E-001 155 }; 156 157 constant double PHJ0[8] = { 158 3.242077816988247E+001, 159 -3.630592630518434E+001, 160 1.756221482109099E+001, 161 -4.974978466280903E+000, 162 1.001973420681837E+000, 163 -1.939906941791308E-001, 164 6.490598792654666E-002, 165 -1.249992184872738E-001 166 }; 167 168 constant double JPJ0[8] = { 169 -6.068350350393235E-008, 170 6.388945720783375E-006, 171 -3.969646342510940E-004, 172 1.332913422519003E-002, 173 -1.729150680240724E-001, 174 0.0, 175 0.0, 176 0.0 177 }; 54 178 55 179 double J0(double x) { -
sasmodels/models/lib/j1_cephes.c
r95ce773 r0b05c24 39 39 Copyright 1984, 1987, 1989, 2000 by Stephen L. Moshier 40 40 */ 41 42 constant double RPJ1[8] = { 43 -8.99971225705559398224E8, 44 4.52228297998194034323E11, 45 -7.27494245221818276015E13, 46 3.68295732863852883286E15, 47 0.0, 48 0.0, 49 0.0, 50 0.0 }; 51 52 constant double RQJ1[8] = { 53 6.20836478118054335476E2, 54 2.56987256757748830383E5, 55 8.35146791431949253037E7, 56 2.21511595479792499675E10, 57 4.74914122079991414898E12, 58 7.84369607876235854894E14, 59 8.95222336184627338078E16, 60 5.32278620332680085395E18 61 }; 62 63 constant double PPJ1[8] = { 64 7.62125616208173112003E-4, 65 7.31397056940917570436E-2, 66 1.12719608129684925192E0, 67 5.11207951146807644818E0, 68 8.42404590141772420927E0, 69 5.21451598682361504063E0, 70 1.00000000000000000254E0, 71 0.0} ; 72 73 74 constant double PQJ1[8] = { 75 5.71323128072548699714E-4, 76 6.88455908754495404082E-2, 77 1.10514232634061696926E0, 78 5.07386386128601488557E0, 79 8.39985554327604159757E0, 80 5.20982848682361821619E0, 81 9.99999999999999997461E-1, 82 0.0 }; 83 84 constant double QPJ1[8] = { 85 5.10862594750176621635E-2, 86 4.98213872951233449420E0, 87 7.58238284132545283818E1, 88 3.66779609360150777800E2, 89 7.10856304998926107277E2, 90 5.97489612400613639965E2, 91 2.11688757100572135698E2, 92 2.52070205858023719784E1 }; 93 94 constant double QQJ1[8] = { 95 7.42373277035675149943E1, 96 1.05644886038262816351E3, 97 4.98641058337653607651E3, 98 9.56231892404756170795E3, 99 7.99704160447350683650E3, 100 2.82619278517639096600E3, 101 3.36093607810698293419E2, 102 0.0 }; 103 104 constant double JPJ1[8] = { 105 -4.878788132172128E-009, 106 6.009061827883699E-007, 107 -4.541343896997497E-005, 108 1.937383947804541E-003, 109 -3.405537384615824E-002, 110 0.0, 111 0.0, 112 0.0 113 }; 114 115 constant double MO1J1[8] = { 116 6.913942741265801E-002, 117 -2.284801500053359E-001, 118 3.138238455499697E-001, 119 -2.102302420403875E-001, 120 5.435364690523026E-003, 121 1.493389585089498E-001, 122 4.976029650847191E-006, 123 7.978845453073848E-001 124 }; 125 126 constant double PH1J1[8] = { 127 -4.497014141919556E+001, 128 5.073465654089319E+001, 129 -2.485774108720340E+001, 130 7.222973196770240E+000, 131 -1.544842782180211E+000, 132 3.503787691653334E-001, 133 -1.637986776941202E-001, 134 3.749989509080821E-001 135 }; 41 136 42 137 double J1(double x) { -
sasmodels/models/lib/polevl.c
r95ce773 r0b05c24 51 51 */ 52 52 53 constant double RPJ1[8] = {54 -8.99971225705559398224E8,55 4.52228297998194034323E11,56 -7.27494245221818276015E13,57 3.68295732863852883286E15,58 0.0,59 0.0,60 0.0,61 0.0 };62 63 constant double RQJ1[8] = {64 6.20836478118054335476E2,65 2.56987256757748830383E5,66 8.35146791431949253037E7,67 2.21511595479792499675E10,68 4.74914122079991414898E12,69 7.84369607876235854894E14,70 8.95222336184627338078E16,71 5.32278620332680085395E1872 };73 74 constant double PPJ1[8] = {75 7.62125616208173112003E-4,76 7.31397056940917570436E-2,77 1.12719608129684925192E0,78 5.11207951146807644818E0,79 8.42404590141772420927E0,80 5.21451598682361504063E0,81 1.00000000000000000254E0,82 0.0} ;83 84 85 constant double PQJ1[8] = {86 5.71323128072548699714E-4,87 6.88455908754495404082E-2,88 1.10514232634061696926E0,89 5.07386386128601488557E0,90 8.39985554327604159757E0,91 5.20982848682361821619E0,92 9.99999999999999997461E-1,93 0.0 };94 95 constant double QPJ1[8] = {96 5.10862594750176621635E-2,97 4.98213872951233449420E0,98 7.58238284132545283818E1,99 3.66779609360150777800E2,100 7.10856304998926107277E2,101 5.97489612400613639965E2,102 2.11688757100572135698E2,103 2.52070205858023719784E1 };104 105 constant double QQJ1[8] = {106 7.42373277035675149943E1,107 1.05644886038262816351E3,108 4.98641058337653607651E3,109 9.56231892404756170795E3,110 7.99704160447350683650E3,111 2.82619278517639096600E3,112 3.36093607810698293419E2,113 0.0 };114 115 constant double JPJ1[8] = {116 -4.878788132172128E-009,117 6.009061827883699E-007,118 -4.541343896997497E-005,119 1.937383947804541E-003,120 -3.405537384615824E-002,121 0.0,122 0.0,123 0.0124 };125 126 constant double MO1J1[8] = {127 6.913942741265801E-002,128 -2.284801500053359E-001,129 3.138238455499697E-001,130 -2.102302420403875E-001,131 5.435364690523026E-003,132 1.493389585089498E-001,133 4.976029650847191E-006,134 7.978845453073848E-001135 };136 137 constant double PH1J1[8] = {138 -4.497014141919556E+001,139 5.073465654089319E+001,140 -2.485774108720340E+001,141 7.222973196770240E+000,142 -1.544842782180211E+000,143 3.503787691653334E-001,144 -1.637986776941202E-001,145 3.749989509080821E-001146 };147 148 constant double PPJ0[8] = {149 7.96936729297347051624E-4,150 8.28352392107440799803E-2,151 1.23953371646414299388E0,152 5.44725003058768775090E0,153 8.74716500199817011941E0,154 5.30324038235394892183E0,155 9.99999999999999997821E-1,156 0.0157 };158 159 constant double PQJ0[8] = {160 9.24408810558863637013E-4,161 8.56288474354474431428E-2,162 1.25352743901058953537E0,163 5.47097740330417105182E0,164 8.76190883237069594232E0,165 5.30605288235394617618E0,166 1.00000000000000000218E0,167 0.0168 };169 170 constant double QPJ0[8] = {171 -1.13663838898469149931E-2,172 -1.28252718670509318512E0,173 -1.95539544257735972385E1,174 -9.32060152123768231369E1,175 -1.77681167980488050595E2,176 -1.47077505154951170175E2,177 -5.14105326766599330220E1,178 -6.05014350600728481186E0,179 };180 181 constant double QQJ0[8] = {182 /* 1.00000000000000000000E0,*/183 6.43178256118178023184E1,184 8.56430025976980587198E2,185 3.88240183605401609683E3,186 7.24046774195652478189E3,187 5.93072701187316984827E3,188 2.06209331660327847417E3,189 2.42005740240291393179E2,190 };191 192 constant double YPJ0[8] = {193 1.55924367855235737965E4,194 -1.46639295903971606143E7,195 5.43526477051876500413E9,196 -9.82136065717911466409E11,197 8.75906394395366999549E13,198 -3.46628303384729719441E15,199 4.42733268572569800351E16,200 -1.84950800436986690637E16,201 };202 203 204 constant double YQJ0[7] = {205 /* 1.00000000000000000000E0,*/206 1.04128353664259848412E3,207 6.26107330137134956842E5,208 2.68919633393814121987E8,209 8.64002487103935000337E10,210 2.02979612750105546709E13,211 3.17157752842975028269E15,212 2.50596256172653059228E17,213 };214 215 constant double RPJ0[8] = {216 -4.79443220978201773821E9,217 1.95617491946556577543E12,218 -2.49248344360967716204E14,219 9.70862251047306323952E15,220 0.0,221 0.0,222 0.0,223 0.0224 };225 226 constant double RQJ0[8] = {227 /* 1.00000000000000000000E0,*/228 4.99563147152651017219E2,229 1.73785401676374683123E5,230 4.84409658339962045305E7,231 1.11855537045356834862E10,232 2.11277520115489217587E12,233 3.10518229857422583814E14,234 3.18121955943204943306E16,235 1.71086294081043136091E18,236 };237 238 constant double MOJ0[8] = {239 -6.838999669318810E-002,240 1.864949361379502E-001,241 -2.145007480346739E-001,242 1.197549369473540E-001,243 -3.560281861530129E-003,244 -4.969382655296620E-002,245 -3.355424622293709E-006,246 7.978845717621440E-001247 };248 249 constant double PHJ0[8] = {250 3.242077816988247E+001,251 -3.630592630518434E+001,252 1.756221482109099E+001,253 -4.974978466280903E+000,254 1.001973420681837E+000,255 -1.939906941791308E-001,256 6.490598792654666E-002,257 -1.249992184872738E-001258 };259 260 constant double JPJ0[8] = {261 -6.068350350393235E-008,262 6.388945720783375E-006,263 -3.969646342510940E-004,264 1.332913422519003E-002,265 -1.729150680240724E-001,266 0.0,267 0.0,268 0.0269 };270 271 53 double polevl( double x, constant double *coef, int N ) { 272 54 … … 280 62 281 63 return ans ; 282 283 64 } 284 65
Note: See TracChangeset
for help on using the changeset viewer.