source: trunk/common/commonobjects.py@ 57

Last change on this file since 57 was 57, checked in by JohnLightfoot, 10 years ago

almost working

File size: 1.1 KB
Line 
1import numpy as np
2
3class Axis(object):
4 """Class to hold axis information.
5 """
6 def __init__(self, data, title='', units=''):
7 self.data = data.copy()
8 self.title = title
9 self.units = units
10
11
12class Cube(object):
13 """Class to hold 3d image, with axes, units, title, etc.
14 """
15 def __init__(self, data, axes=[], title='', units=''):
16 self.data = data.copy()
17 self.axes = axes
18 self.title = title
19 self.units = units
20
21
22class Image(object):
23 """Class to hold 2d image, with axes, units, title, etc.
24 """
25 def __init__(self, data, axes=[], title='', units=''):
26 self.data = data.copy()
27 self.axes = axes
28 self.title = title
29 self.units = units
30
31
32class Spectrum(object):
33 """Class to hold 1d spectrum, with axis, units, title, etc.
34 """
35 def __init__(self, data, flag=None, axis=None, title='', units=''):
36 self.data = data.copy()
37 if flag is None:
38 self.flag = np.zeros(np.shape(data), np.bool)
39 else:
40 self.flag = flag.copy()
41 self.axis = axis
42 self.title = title
43 self.units = units
Note: See TracBrowser for help on using the repository browser.