Changeset d6f5da6 in sasmodels


Ignore:
Timestamp:
Mar 29, 2016 8:48:51 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

use log spacing in qy for oriented usans

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    rea75043 rd6f5da6  
    4141    Load data using a sasview loader. 
    4242    """ 
    43     from sas.dataloader.loader import Loader 
     43    from sas.sascalc.dataloader.loader import Loader 
    4444    loader = Loader() 
    4545    data = loader.load(filename) 
     
    424424        plt.subplot(1, num_plots, 2) 
    425425        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,:])) 
    427427        plt.xlabel("$q_x$/A$^{-1}$") 
    428428        plt.xlabel("$q_y$/A$^{-1}$") 
     429        plt.xscale('log') 
     430        plt.yscale('log') 
    429431        #plt.axis('equal') 
    430432 
  • sasmodels/resolution2d.py

    rea75043 rd6f5da6  
    2323 
    2424## Defaults 
    25 N_SLIT_PERP = {'xhigh':2000, 'high':1000, 'med':500, 'low':250} 
     25N_SLIT_PERP = {'xhigh':1000, 'high':500, 'med':200, 'low':50} 
    2626N_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())) 
    2828 
    2929class Pinhole2D(Resolution): 
     
    213213        else: 
    214214            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)) 
    216218        self.q_calc = [v.flatten() for v in np.meshgrid(qx_calc, qy_calc)] 
    217219        self.qx_calc, self.qy_calc = qx_calc, qy_calc 
     
    229231 
    230232    def apply(self, theory): 
    231         Iq = np.sum(theory.reshape(self.ny, self.nx), axis=0)*self.dy 
     233        Iq = np.trapz(theory.reshape(self.ny, self.nx), axis=0, x=self.qy_calc) 
    232234        if self.weights is not None: 
    233235            Iq = resolution.apply_resolution_matrix(self.weights, Iq) 
Note: See TracChangeset for help on using the changeset viewer.