Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

__all__ = ["FitsTable", "getColumnData"] 

 

from . import base 

from .fitsTable import FitsTable 

 

 

def getColumnData(self, column): 

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

 

Parameters 

---------- 

column : `str` 

Name of the column to retrieve. 

 

Returns 

------- 

data : `list` of `numpy.array` 

 

""" 

nrows = self.nRow 

shape = self.columnShape(column) 

dtype = self.columnType(column) 

 

if dtype == base.DataType.DoubleType: 

newshape = list(shape) 

newshape.append(nrows) 

coldata = self.getColumnData1D(column) 

coldata = coldata.reshape(newshape, order="F") 

else: 

raise ValueError("Can only retrieve double column data") 

return coldata 

 

 

FitsTable.getColumnData = getColumnData