Coverage for python/astshim/fitsTableContinued.py: 29%
15 statements
« prev ^ index » next coverage.py v7.2.1, created at 2023-03-12 01:17 -0800
« prev ^ index » next coverage.py v7.2.1, created at 2023-03-12 01:17 -0800
1__all__ = ["FitsTable", "getColumnData"]
3from . import base
4from .fitsTable import FitsTable
7def getColumnData(self, column):
8 """Retrieve the column data in the correct type and shape.
10 Parameters
11 ----------
12 column : `str`
13 Name of the column to retrieve.
15 Returns
16 -------
17 data : `list` of `numpy.array`
19 """
20 nrows = self.nRow
21 shape = self.columnShape(column)
22 dtype = self.columnType(column)
24 if dtype == base.DataType.DoubleType:
25 newshape = list(shape)
26 newshape.append(nrows)
27 coldata = self.getColumnData1D(column)
28 coldata = coldata.reshape(newshape, order="F")
29 else:
30 raise ValueError("Can only retrieve double column data")
31 return coldata
34FitsTable.getColumnData = getColumnData