Public Member Functions | Public Attributes | List of all members
wirecell.sigproc.response.foo Class Reference

Public Member Functions

def __init__ (self)
 
def __call__ (self, plane, impact, region=None)
 
def impact_region_numbers_to_indices (self, impact, region)
 
def impact_range (self)
 
def region_range (self)
 
def nregions (self)
 
def ntbins (self)
 

Public Attributes

 region_center
 

Detailed Description

Definition at line 457 of file __init__.py.

Constructor & Destructor Documentation

def wirecell.sigproc.response.foo.__init__ (   self)

Definition at line 459 of file __init__.py.

459  def __init__(self):
460 
461 
462  self.region_center = self.nregions // 2
463 

Member Function Documentation

def wirecell.sigproc.response.foo.__call__ (   self,
  plane,
  impact,
  region = None 
)
Return a response block by plane (0,1,2) and by impact
(-4,...,0,...,5) and optionally by region (-10,...,0,...,10).

If region is None, return corresponding (Nregions,Ntbins)
array.  If region is given, return (Ntbins) array.  The impact
(and region) numbers may be negative.

Definition at line 464 of file __init__.py.

464  def __call__(self, plane, impact, region=None):
465  '''
466  Return a response block by plane (0,1,2) and by impact
467  (-4,...,0,...,5) and optionally by region (-10,...,0,...,10).
468 
469  If region is None, return corresponding (Nregions,Ntbins)
470  array. If region is given, return (Ntbins) array. The impact
471  (and region) numbers may be negative.
472  '''
473  pib = self.pibs[plane]
474  if region is None: # 2D
475  if impact >= 0:
476  return pib[impact]
477  return numpy.flipud(pib[-impact])
478  # 1D
479  impact,region = self.impact_region_numbers_to_indices(impact, region)
480  return pib[impact, region]
481 
def impact_region_numbers_to_indices(self, impact, region)
Definition: __init__.py:482
def __call__(self, plane, impact, region=None)
Definition: __init__.py:464
def wirecell.sigproc.response.foo.impact_range (   self)

Definition at line 491 of file __init__.py.

491  def impact_range(self):
492  max_impact = len(self.pibs[0]) - 1
493  return range(-max_impact, max_impact) # skip highest as it's shared with lowest of lower region
def wirecell.sigproc.response.foo.impact_region_numbers_to_indices (   self,
  impact,
  region 
)

Definition at line 482 of file __init__.py.

482  def impact_region_numbers_to_indices(self, impact, region):
483  if impact < 0: # must reflect
484  impact *= -1
485  region *= -1
486  region + self.region_center
487  return (impact,region)
488 
489 
def impact_region_numbers_to_indices(self, impact, region)
Definition: __init__.py:482
def wirecell.sigproc.response.foo.nregions (   self)

Definition at line 500 of file __init__.py.

500  def nregions(self):
501  return self.pibs[0][0].shape[0]
def wirecell.sigproc.response.foo.ntbins (   self)

Definition at line 503 of file __init__.py.

503  def ntbins(self):
504  return self.pibs[0][0].shape[1]
505 
506 
507 
def wirecell.sigproc.response.foo.region_range (   self)

Definition at line 495 of file __init__.py.

495  def region_range(self):
496  nhalf_regions = self.nregions//2
497  return range(-nhalf_regions, nhalf_regions+1) # inclusive
498 

Member Data Documentation

wirecell.sigproc.response.foo.region_center

Definition at line 462 of file __init__.py.


The documentation for this class was generated from the following file: