This class describes a data file. It contains header information and
data. The header information follows the NASA FITS standard closely
with a few extensions.
Header items: _NAME -- the filename from which the data came,
_FILETYPE -- a string indicating the format of the data file
Each instance has two attributes that are intended for general use:
hdr -- a dictionary containing all the header information, and d -- a
2-dimensional numpy array containing the data.
|
__init__(self,
hdr,
data=None)
Creates an gpk_img object from hdr (a dictionary that describes a
data array) and the data (a Numeric 2-dimensional array). |
source code
|
|
|
|
|
add_history(self,
h)
Adds an item to the file's history. |
source code
|
|
|
get_history(self)
Returns the file's history as a list of strings. |
source code
|
|
|
empty(self)
Returns True if there is no data. |
source code
|
|
|
index(self,
t,
i)
What is the i^th index if the i^th coordinate = t? More plainly, this
function gives you the index that corresponds to the coordinate, and
'i' selects which index. |
source code
|
|
|
coord(self,
index,
i)
What is the i^th coordinate if the i^th index==index? More plainly,
this function gives you the coordinate that corresponds to the index,
and 'i' selects which index. |
source code
|
|
|
x_index(self,
x)
Returns the y-index for a particular x-coordinate. |
source code
|
|
|
|
|
x(self,
index=None)
Returns the x-coordinate for a particular x-index. |
source code
|
|
|
y(self,
index=None)
Returns the y-coordinate for a particular y-index. |
source code
|
|
|
write(self,
f)
Write out a data file, with the information in this class. |
source code
|
|
|
__len__(self)
This is here to make it possible to access the class as a
(header,data) tuple. |
source code
|
|
|
__getitem__(self,
key)
This is here to make it possible to access the class as a
(header,data) tuple. |
source code
|
|
|
time(self,
index=None)
What time corresponds to a certain index? (This is the same as
self.y(index).) |
source code
|
|
|
|
|
|
|
|
|
dt(self)
Assuming time flows down a column (axis=2), what's the time interval? |
source code
|
|
|
|
|
register(self,
ttype,
column,
trange=None,
tunit=None)
This sets up the TTYPE fields so that the specified datatype lives in
the specified column. |
source code
|
|
|
attach_col(self,
data,
ttype,
trange=None,
tunit=None,
extra_hdr={ } )
Attach another column to an existing class. |
source code
|
|
|
select_cols(self,
columns,
extra_hdr={ } )
Select a set of columns in an existing class, returning a new gpk_img
class containing a subset of the data. |
source code
|
|