Changeset 3e6aaad in sasmodels


Ignore:
Timestamp:
Aug 31, 2015 11:55:50 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:
cd8dde1
Parents:
346bc88
Message:

add resolution accuracy setting to compare

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • compare.py

    r346bc88 r3e6aaad  
    108108            if smearer is not None: 
    109109                smearer.model = model  # because smear_selection has a bug 
     110                smearer.accuracy = data.accuracy 
    110111                smearer.set_index(index) 
    111112                value = smearer.get_value() 
     
    145146    return value, average_time 
    146147 
    147 def make_data(qmax, is2D, Nq=128, resolution=0.0, view='log'): 
     148def make_data(qmax, is2D, Nq=128, resolution=0.0, accuracy='Low', view='log'): 
    148149    if is2D: 
    149150        from sasmodels.bumps_model import empty_data2D, set_beam_stop 
    150151        data = empty_data2D(np.linspace(-qmax, qmax, Nq), resolution=resolution) 
     152        data.accuracy = accuracy 
    151153        set_beam_stop(data, 0.004) 
    152154        index = ~data.mask 
     
    172174    Nq = int(opt_values.get('-Nq', '128')) 
    173175    res = float(opt_values.get('-res', '0')) 
     176    accuracy = opt_values.get('-accuracy', 'Low') 
    174177    is2D = not "-1d" in opts 
    175     data, index = make_data(qmax, is2D, Nq, res, view=view) 
     178    data, index = make_data(qmax, is2D, Nq, res, accuracy, view=view) 
    176179 
    177180 
     
    296299    -mono/-poly* force monodisperse/polydisperse 
    297300    -ctypes/-sasview* whether cpu is tested using sasview or ctypes 
    298     -cutoff=1e-5*/value cutoff for including a point in polydispersity 
     301    -cutoff=1e-5* cutoff value for including a point in polydispersity 
    299302    -pars/-nopars* prints the parameter set or not 
    300303    -abs/-rel* plot relative or absolute error 
     
    302305    -hist/-nohist* plot histogram of relative error 
    303306    -res=0 sets the resolution width dQ/Q if calculating with resolution 
     307    -accuracy=Low resolution accuracy Low, Mid, High, Xhigh 
    304308 
    305309Key=value pairs allow you to set specific values to any of the model 
     
    326330VALUE_OPTIONS = [ 
    327331    # Note: random is both a name option and a value option 
    328     'cutoff', 'random', 'Nq', 'res', 
     332    'cutoff', 'random', 'Nq', 'res', 'accuracy', 
    329333    ] 
    330334 
  • sasmodels/bumps_model.py

    r346bc88 r3e6aaad  
    399399            qmin = getattr(data, 'qmin', 1e-16) 
    400400            qmax = getattr(data, 'qmax', np.inf) 
     401            accuracy = getattr(data, 'accuracy', 'Low') 
    401402            self.index = (~data.mask) & (~np.isnan(data.data)) \ 
    402403                         & (q >= qmin) & (q <= qmax) 
     
    404405            self.dIq = data.err_data[self.index] 
    405406            self.resolution = Pinhole2D(data=data, index=self.index, 
    406                                         nsigma=3.0, accuracy='Low') 
     407                                        nsigma=3.0, accuracy=accuracy) 
    407408            #self._theory = np.zeros_like(self.Iq) 
    408409            if not partype['orientation'] and not partype['magnetic']: 
  • sasmodels/resolution2d.py

    r346bc88 r3e6aaad  
    9292        nbins = nr * nphi 
    9393        # Number of bins in the dqr direction (polar coordinate of dqx and dqy) 
    94         bin_size = self.nsigma // nr 
     94        bin_size = self.nsigma / nr 
    9595        # in dq_r-direction times # of bins in dq_phi-direction 
    9696        # data length in the range of self.index 
Note: See TracChangeset for help on using the changeset viewer.