Cfitsio Toolkit - matlab.io.fits.readCol


: [coldata, nullval] = readCol(file, colnum)
: [coldata, nullval] = readCol(file, colnum, firstrow, numrows)

Get table row data.

This is the equivalent of the cfitsio fits_read_col function.

Inputs

file - opened fits file.

firstrow - Start row

numrows - Number of rows to read

Outputs

coldata - the column data rows

nulldata - the null value flags

Examples

 import_fits;

 # open file
 filename = file_in_loadpath("demos/tst0012.fits");
 fd = fits.openFile(filename);

 # move to binary table and get column for flux
 fits.movAbsHDU(fd, 2);
 colnum = fits.getColName(fd, 'flux');

 # read all rows in column
 fluxdata = fits.readCol(fd, colnum);
 # read data starting at 2nd value
 fluxdata = fits.readCol(fd, colnum, 2);
 # read rows 3 rows starting at row 2
 fluxdata = fits.readCol(fd, colnum, 2, 3);
 fits.closeFile(fd);