Coverage for python/astshim/fitsTableContinued.py: 29%

15 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2022-09-11 00:57 -0700

1__all__ = ["FitsTable", "getColumnData"] 

2 

3from . import base 

4from .fitsTable import FitsTable 

5 

6 

7def getColumnData(self, column): 

8 """Retrieve the column data in the correct type and shape. 

9 

10 Parameters 

11 ---------- 

12 column : `str` 

13 Name of the column to retrieve. 

14 

15 Returns 

16 ------- 

17 data : `list` of `numpy.array` 

18 

19 """ 

20 nrows = self.nRow 

21 shape = self.columnShape(column) 

22 dtype = self.columnType(column) 

23 

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 

32 

33 

34FitsTable.getColumnData = getColumnData