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