Changeset d6f5da6 in sasmodels
- Timestamp:
- Mar 29, 2016 8:48:51 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:
- 3a45c2c, 3c6d5bc
- Parents:
- ea75043
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/data.py
rea75043 rd6f5da6 41 41 Load data using a sasview loader. 42 42 """ 43 from sas. dataloader.loader import Loader43 from sas.sascalc.dataloader.loader import Loader 44 44 loader = Loader() 45 45 data = loader.load(filename) … … 424 424 plt.subplot(1, num_plots, 2) 425 425 qx, qy, Iqxy = Iq_calc 426 plt.pcolormesh(qx, qy , np.log10(Iqxy))426 plt.pcolormesh(qx, qy[qy>0], np.log10(Iqxy[qy>0,:])) 427 427 plt.xlabel("$q_x$/A$^{-1}$") 428 428 plt.xlabel("$q_y$/A$^{-1}$") 429 plt.xscale('log') 430 plt.yscale('log') 429 431 #plt.axis('equal') 430 432 -
sasmodels/resolution2d.py
rea75043 rd6f5da6 23 23 24 24 ## Defaults 25 N_SLIT_PERP = {'xhigh': 2000, 'high':1000, 'med':500, 'low':250}25 N_SLIT_PERP = {'xhigh':1000, 'high':500, 'med':200, 'low':50} 26 26 N_SLIT_PERP_DOC = ", ".join("%s=%d"%(name,value) for value,name in 27 sorted(( v,k) for k,v in N_SLIT_PERP.items()))27 sorted((2*v+1,k) for k,v in N_SLIT_PERP.items())) 28 28 29 29 class Pinhole2D(Resolution): … … 213 213 else: 214 214 qx_calc = resolution.pinhole_extend_q(q, qx_width, nsigma=3) 215 qy_calc = np.linspace(-qy_width, qy_width, N_SLIT_PERP[accuracy]*10) 215 qy_min, qy_max = np.log10(np.min(q)), np.log10(qy_width) 216 qy_calc = np.logspace(qy_min, qy_max, N_SLIT_PERP[accuracy]) 217 qy_calc = np.hstack((-qy_calc[::-1], 0, qy_calc)) 216 218 self.q_calc = [v.flatten() for v in np.meshgrid(qx_calc, qy_calc)] 217 219 self.qx_calc, self.qy_calc = qx_calc, qy_calc … … 229 231 230 232 def apply(self, theory): 231 Iq = np. sum(theory.reshape(self.ny, self.nx), axis=0)*self.dy233 Iq = np.trapz(theory.reshape(self.ny, self.nx), axis=0, x=self.qy_calc) 232 234 if self.weights is not None: 233 235 Iq = resolution.apply_resolution_matrix(self.weights, Iq)
Note: See TracChangeset
for help on using the changeset viewer.