Changeset 83a25da in sasview


Ignore:
Timestamp:
Aug 6, 2009 6:49:24 PM (15 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
9bd69098
Parents:
ba8f2c3
Message:

sansmodels: added evalDistribution to BaseComponent?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/BaseComponent.py

    r138c139 r83a25da  
    66# imports    
    77import copy 
     8import numpy 
    89#TO DO: that about a way to make the parameter 
    910#is self return if it is fittable or not   
     
    5556    def run(self, x): return NotImplemented 
    5657    def runXY(self, x): return NotImplemented   
     58     
     59    def evalDistribution(self, qdist): 
     60        """ 
     61            Evaluate a distribution of q-values. 
     62            A list of either scale q-values or [qx,qy] doublets 
     63            are assumed. The allowed data types for the doublets are  
     64            the same as for run() and runXY(). 
     65             
     66            Since the difference between scale and vector q-values 
     67            are dealt with in runXY(), we pass along the values 
     68            as-is. 
     69             
     70            @param qdist: list of scalar q-values or list of [qx,qy] doublets  
     71        """ 
     72        q_array = numpy.asarray(qdist) 
     73        iq_array = numpy.zeros(len(q_array)) 
     74        for i in len(q_array): 
     75            iq_array[i] = self.runXY(q_array[i]) 
     76             
     77        return iq_array 
    5778     
    5879    def clone(self): 
Note: See TracChangeset for help on using the changeset viewer.