Public Member Functions | Public Attributes | List of all members
wirecell.img.plots.Hist2D Class Reference
Inheritance diagram for wirecell.img.plots.Hist2D:

Public Member Functions

def __init__ (self, nx, xmin, xmax, ny, ymin, ymax)
 
def xbin (self, x)
 
def ybin (self, y)
 
def fill (self, x, y, v)
 
def extent (self)
 
def imshow (self, ax)
 
def like (self)
 

Public Attributes

 arr
 
 nx
 
 rangex
 
 ny
 
 rangey
 

Detailed Description

Definition at line 13 of file plots.py.

Constructor & Destructor Documentation

def wirecell.img.plots.Hist2D.__init__ (   self,
  nx,
  xmin,
  xmax,
  ny,
  ymin,
  ymax 
)

Definition at line 14 of file plots.py.

14  def __init__(self, nx, xmin, xmax, ny, ymin, ymax):
15  self.arr = numpy.zeros((ny, nx))
16  self.nx = nx
17  self.rangex = (xmin, xmax)
18  self.ny = ny
19  self.rangey = (ymin, ymax)
20 
def __init__(self, nx, xmin, xmax, ny, ymin, ymax)
Definition: plots.py:14

Member Function Documentation

def wirecell.img.plots.Hist2D.extent (   self)

Definition at line 36 of file plots.py.

36  def extent(self):
37  return (self.rangex[0], self.rangex[1],
38  self.rangey[1], self.rangey[0])
def wirecell.img.plots.Hist2D.fill (   self,
  x,
  y,
  v 
)

Definition at line 31 of file plots.py.

31  def fill(self, x, y, v):
32  xi = self.xbin(x)
33  yi = self.ybin(y)
34  self.arr[yi, xi] += v
35 
def xbin(self, x)
Definition: plots.py:21
def ybin(self, y)
Definition: plots.py:26
def fill(self, x, y, v)
Definition: plots.py:31
def wirecell.img.plots.Hist2D.imshow (   self,
  ax 
)

Definition at line 39 of file plots.py.

39  def imshow(self, ax):
40  return ax.imshow(self.arr, extent=self.extent())
41 
def imshow(self, ax)
Definition: plots.py:39
def wirecell.img.plots.Hist2D.like (   self)

Definition at line 42 of file plots.py.

42  def like(self):
43  return Hist2D(self.nx, self.rangex[0], self.rangex[1],
44  self.ny, self.rangey[0], self.rangey[1])
45 
def wirecell.img.plots.Hist2D.xbin (   self,
  x 
)

Definition at line 21 of file plots.py.

21  def xbin(self, x):
22  xmin,xmax=self.rangex
23  xrel = max(0, min(1.0, (x - xmin) / (xmax-xmin)))
24  return int(xrel * self.nx);
25 
def xbin(self, x)
Definition: plots.py:21
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
def wirecell.img.plots.Hist2D.ybin (   self,
  y 
)

Definition at line 26 of file plots.py.

26  def ybin(self, y):
27  ymin,ymax=self.rangey
28  yrel = max(0, min(1.0, (y - ymin) / (ymax-ymin)))
29  return int(yrel * self.ny);
30 
def ybin(self, y)
Definition: plots.py:26
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55

Member Data Documentation

wirecell.img.plots.Hist2D.arr

Definition at line 15 of file plots.py.

wirecell.img.plots.Hist2D.nx

Definition at line 16 of file plots.py.

wirecell.img.plots.Hist2D.ny

Definition at line 18 of file plots.py.

wirecell.img.plots.Hist2D.rangex

Definition at line 17 of file plots.py.

wirecell.img.plots.Hist2D.rangey

Definition at line 19 of file plots.py.


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