@c ---------------------------------------------------
@node High Level File Functions
@section High Level File Functions
@cindex High Level File Functions
@c High Level File Functions fitsdisp
@c -----------------------------------------
@subsection fitsdisp
@cindex fitsdisp
@deftypefn {} {@var{info}} = fitsdisp(@var{filename})
@deftypefnx {} {@var{info}} = fitsdisp(@var{filename}, @var{propertyname}, @var{propertyvalue})
 Display metadata about fits format file

@subsubheading Inputs
@var{filename} - filename to open.

@var{propertyname}, @var{propertyvalue} - property name/value pairs

 Known property names are:
@table @asis
@item 'Index'
 Value is a scalar or vector of hdu numbers to display
@item 'Mode'
 display mode of 'standard' (default), 'min' or 'full'
@end table

 'standard' display mode shows the standard keywords for the selected HDUs.@*
 'min' display mode shows only the type and size of the selected HDUs.@*
 'full' display shows all keywords for the selected HDU.

@subsubheading Outputs
@var{info} - the metadata of the file. If no output variable is provided, it displays
 to the screen.

@subsubheading Examples
@example
 filename = file_in_loadpath("demos/tst0012.fits");

 fitsdisp(filename);
@end example
@end deftypefn
@c High Level File Functions fitsinfo
@c -----------------------------------------
@subsection fitsinfo
@cindex fitsinfo
@deftypefn {} {@var{info}} = fitsinfo(@var{filename})
 Read information about fits format file
@subsubheading Inputs
@var{filename} - filename to open.

@subsubheading Outputs
@var{info} - a struct containing the structure and information about
 the fits file.

@subsubheading Examples
@example
 filename = file_in_loadpath("demos/tst0012.fits");

 info = fitsinfo(filename);
@end example

@end deftypefn
@c High Level File Functions fitsread
@c -----------------------------------------
@subsection fitsread
@cindex fitsread
@deftypefn {} {@var{data}} = fitsread(@var{filename})
@deftypefnx {} {@var{data}} = fitsread(@var{filename}, 'raw')
@deftypefnx {} {@var{data}} = fitsread(@var{filename}, @var{extname})
@deftypefnx {} {@var{data}} = fitsread(@var{filename}, @var{extname}, @var{index})
@deftypefnx {} {@var{data}} = fitsread(@var{filename}, ____, @var{propertyname}, @var{propertyvalue})
 Read the primary data, or specified extension data. It scales the data and applied Nan to any undefined values.

@subsubheading Inputs
@var{filename} - filename to open.

@var{exttype} - can be  'primary', 'asciitable', 'binarytable', 'image', 'unknown'.

@var{index} - can be used to specify which table when more than one of a given type exists.

 'raw'-  If the 'raw' keyword is used, the raw data from the file will be used without replacing
 undefined values with Nan

 Known property names are:
@table @asis
@item Info
 input info from fitsinfo call.
@item PixelRegion
 pixel region to extract data for in an image. It expects a cell array of same size as
 the number of axis in the image. Each cell should be in vector format of: start, [start stop]
 or [start, increment, stop].
@item TableColumns
 A list of columns to extract from a ascii or binary table.
@item TableRows
 A list of rows to extract from an ascii or binary table.
@end table

@subsubheading Outputs
@var{data} - The read data from the table or image.

@subsubheading Examples
@example
 filename = file_in_loadpath("demos/tst0012.fits");

 # read the primary image data
 imagedata = fitsread(filename);

 # read the 1st non primary image
 imagedata = fitsread(filename, "image");

 # read the first binary table, selected columns
 tbldata = fitsread(filename, "binarytable", "TableColumns", [1 2 11]);

 # read the first ascii table
 atbldata = fitsread(filename, "asciitable");
@end example
@end deftypefn
@c High Level File Functions fitswrite
@c -----------------------------------------
@subsection fitswrite
@cindex fitswrite
@deftypefn {} {} fitswrite(@var{data}, @var{filename})
@deftypefnx {} {} fitswrite(@var{data}, @var{filename}, @var{propertyname}, @var{propertyvalue})
 Write image data @var{data}  to FITS file @var{filename}. If the fie already exists, overwrite it.

@subsubheading Inputs
@var{data} - imagedata to write to a file.

@var{filename} - filename to write to.

@var{propertyname}, @var{propertyvalue} - property name/value pairs

 Additional properties can be set as @var{propertyname}, @var{propertyvalue} pairs.
 Known property names are:
@table @asis
@item WriteMode
 Set mode for writing to image as 'overwrite' (default) or 'append' to append images.
@item Compression
 Set compression type to use for image as
 'none' (default), 'gzip', 'rice', 'hcompress' or 'plio'.
@end table

@subsubheading Outputs
 None

@subsubheading Examples
@example
 filename = tempname();
 X =  double([1:3;4:6]);
 fitswrite(X, filename);
@end example
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions
@section Low Level Functions
@cindex Low Level Functions
@c ---------------------------------------------------
@node Low Level Functions - File Functions
@subsection File Functions
@cindex Low Level Functions - File Functions
@c Low Level FunctionsFile Functions matlab.io.fits.closeFile
@c -----------------------------------------
@subsubsection matlab.io.fits.closeFile
@cindex closeFile
@deftypefn {} {} closeFile(@var{file})
 Close the opened fits file

 This is the equivalent of the fits_close_file function.

@subsubheading Inputs
@var{file} - opened file returned from openFile or createFile.

@subsubheading Outputs
 None

@subsubheading Examples
@example
 import_fits;
 filename = file_in_loadpath("demos/tst0012.fits")

 fd = fits.openFile(filename);
 fits.closeFile(fd);
@end example

@xseealso {matlab.io.fits.createFile, matlab.io.fits.openFile}
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.createFile
@c -----------------------------------------
@subsubsection matlab.io.fits.createFile
@cindex createFile
@deftypefn {} {@var{file}} = createFile(@var{filename})
 Attempt to create  a file of the given input name.

 If the filename starts with ! and the file exists, it will create a new file, otherwise, if the
 file exists, the create will fail.

 This is the equivalent of the cfitsio fits_create_file function.

@subsubheading Inputs
@var{filename} - filename to open.

@subsubheading Outputs
@var{file} - opened file identifier.

@subsubheading Examples
@example
 import_fits;

 fd = fits.createFile("myfitsfile.fits");
 fits.createImg(fd, 'uint16', [100 100]);
 fits.closeFile(fd);
@end example

@xseealso {matlab.io.fits.openFile}
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.deleteFile
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteFile
@cindex deleteFile
@deftypefn {} {} deleteFile(@var{file})
 Force a close and delete of a fits file.

 This is the equivalent of the fits_delete_file function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.fileMode
@c -----------------------------------------
@subsubsection matlab.io.fits.fileMode
@cindex fileMode
@deftypefn {} {@var{mode}} = fileMode(@var{file})
 Return the file mode of the opened fits file.

 This is the equivalent of the fits_file_mode function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{mode} - The mode will return as a string 'READWRITE' or 'READONLY'
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.fileName
@c -----------------------------------------
@subsubsection matlab.io.fits.fileName
@cindex fileName
@deftypefn {} {@var{filename}} = fileName(@var{file})
 Return the file name of the opened fits file.

 This is the equivalent of the fits_file_name function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{filename} - name of the fits file.
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.openDiskFile
@c -----------------------------------------
@subsubsection matlab.io.fits.openDiskFile
@cindex openDiskFile
@deftypefn {} {@var{file}} = openDiskFile(@var{filename})
@deftypefnx {} {@var{file}} = openDiskFile(@var{filename}, @var{mode})
 Attempt to open a file of the given input name, ignoring any special processing of the filename.

 This is the equivalent of the cfitsio fits_open_diskfile function.

@subsubheading Inputs
@var{filename} - filename to open.

@var{mode} - If the option mode string 'READONLY' (default) or 'READWRITE' is provided,
 open the file using that mode.

@subsubheading Outputs
@var{file} - opened file identifier.

@subsubheading Examples
@example
 import_fits;
 filename = file_in_loadpath("demos/tst0012.fits")

 fd = fits.openDiskFile(filename, 'READONLY');
 fits.closeFile(fd);
@end example

@xseealso {openFile, createFile}
@end deftypefn
@c Low Level FunctionsFile Functions matlab.io.fits.openFile
@c -----------------------------------------
@subsubsection matlab.io.fits.openFile
@cindex openFile
@deftypefn {} {@var{file}} = openFile(@var{filename})
@deftypefnx {} {@var{file}} = openFile(@var{filename}, @var{mode})
 Attempt to open a file of the given input name.

 This is the equivalent of the cfitsio fits_open_file function.

@subsubheading Inputs
@var{filename} - filename to open.

@var{mode} - If the option mode string 'READONLY' (default) or 'READWRITE' is provided,
 open the file using that mode.

@subsubheading Outputs
@var{file} - opened file identifier.

@subsubheading Examples
@example
 import_fits;
 filename = file_in_loadpath("demos/tst0012.fits")

 fd = fits.openFile(filename, 'READONLY');
 fits.closeFile(fd);
@end example

@xseealso {matlab.io.fits.openDiskFile, matlab.io.fits.createFile}
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - HDU Functions
@subsection HDU Functions
@cindex Low Level Functions - HDU Functions
@c Low Level FunctionsHDU Functions matlab.io.fits.copyHDU
@c -----------------------------------------
@subsubsection matlab.io.fits.copyHDU
@cindex copyHDU
@deftypefn {} {} copyHDU(@var{infile}, @var{outfile})
 Copy current HDU from one infile to another.

 This is the equivalent of the cfitsio fits_copy_hdu function.

@subsubheading Inputs
@var{filename} - filename to open.

@subsubheading Outputs
@var{infile} - opened input file identifier.

@var{outfile} - opened output file identifier.

@subsubheading Examples
@example
 import_fits;

 # open input and output files
 infilename = file_in_loadpath("demos/tst0012.fits");
 infile = fits.openFile(infilename);

 outfile = fits.createFile("myfitsfile.fits");
 # copy first hdu
 fits.copyHDU(infile, outfile);
 # move to and then copy 2nd hdu
 fits.movAbsHDU(infile,2);
 fits.copyHDU(infile, outfile);

 # close files
 fits.closeFile(infile);
 fits.closeFile(outfile);
@end example
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.deleteHDU
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteHDU
@cindex deleteHDU
@deftypefn {} {@var{type}} = deleteHDU(@var{file})
 Delete the current HDU and go to next HDU.

 Returns the newly current HDU type as a string.

 This is the equivalent of the cfitsio fits_delete_hdu function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{type} - string value for type of the next HDU.

@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.getHDUnum
@c -----------------------------------------
@subsubsection matlab.io.fits.getHDUnum
@cindex getHDUnum
@deftypefn {} {@var{num}} = getHDUnum(@var{file})
 Return the index of the current HDU.

 This is the equivalent of the cfitsio fits_get_hdu_num function.
@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{num} - current hdu number.

@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.getHDUoff
@c -----------------------------------------
@subsubsection matlab.io.fits.getHDUoff
@cindex getHDUoff
@deftypefn {} {[@var{headtstart}, @var{datastart}, @var{dataend}]} = getHDUoff(@var{file})
 Return offsets of the current HDU.

 This is the equivalent of the cfitsio fits_get_hduoff function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{headtstart}, @var{datastart}, @var{dataend} - offset information for the current HDU.
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.getHDUtype
@c -----------------------------------------
@subsubsection matlab.io.fits.getHDUtype
@cindex getHDUtype
@deftypefn {} {@var{type}} = getHDUtype(@var{file})
 Return the current HDUs type as a string.

 This is the equivalent of the cfitsio fits_get_hdu_type function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{type} - current hdu type
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.getNumHDUs
@c -----------------------------------------
@subsubsection matlab.io.fits.getNumHDUs
@cindex getNumHDUs
@deftypefn {} {@var{num}} = getNumHDUs(@var{file})
 Return the count of HDUs in the file.

 This is the equivalent of the cfitsio fits_get_num_hdus function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{num} - return the number of HDUs in the file.
@subsubheading Examples
@example
 import_fits;
 testname = file_in_loadpath("demos/tst0012.fits");
 fd = fits.openFile(testname);
 hducount = getNumHDUs(fd), 5);
 fits.closeFile(fd);
@end example
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.movAbsHDU
@c -----------------------------------------
@subsubsection matlab.io.fits.movAbsHDU
@cindex movAbsHDU
@deftypefn {} {@var{type} =} movAbsHDU(@var{file}, @var{hdunum})
 Go to absolute HDU index @var{hdunum}

 Returns the newly current HDU type as a string.

 This is the equivalent of the cfitsio fits_movabs_hdu function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{hdunum} - HDU number to move to.

@subsubheading Outputs
@var{type} - hdu type of the now current HDU.
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.movNamHDU
@c -----------------------------------------
@subsubsection matlab.io.fits.movNamHDU
@cindex movNamHDU
@deftypefn {} {@var{hdutype} =} movNamHDU(@var{file}, @var{hdutype}, @var{extname}, @var{extver})
 Go to HDU matching @var{hdutype}, @var{extname}, @var{extver}.

 This is the equivalent of the cfitsio fits_movnam_hdu function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{hdutype} - HDU number to move to.
 Valid hdutype values are 'IMAGE_HDU', 'ASCII_TBL', 'BINARY_TBL', 'ANY_HDU'.

@var{extname}, @var{extver} - EXTNAME and EXTVER keywords to match.

@subsubheading Outputs
@var{hdutype} - hdu type of the now current HDU.
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.movRelHDU
@c -----------------------------------------
@subsubsection matlab.io.fits.movRelHDU
@cindex movRelHDU
@deftypefn {} {@var{type}} = movRelHDU(@var{file}, @var{hdunum})
 Go to relative HDU index @var{hdunum}.

 Returns the newly current HDU type as a string.

 This is the equivalent of the cfitsio fits_movrel_hdu function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{hdunum} - relative HDU number to move to.

@subsubheading Outputs
@var{type} - hdu type of the now current HDU.
@end deftypefn
@c Low Level FunctionsHDU Functions matlab.io.fits.writeChecksum
@c -----------------------------------------
@subsubsection matlab.io.fits.writeChecksum
@cindex writeChecksum
@deftypefn {} {} writeChecksum(@var{file})
 Recalculate the HDU checksum and if required, write the new value.

 This is the equivalent of the cfitsio fits_write_chksum function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
 None
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Keyword Functions
@subsection Keyword Functions
@cindex Low Level Functions - Keyword Functions
@c Low Level FunctionsKeyword Functions matlab.io.fits.deleteKey
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteKey
@cindex deleteKey
@deftypefn {} {} deleteKey(@var{file}, @var{key})
 Delete a key in the fits file.

 This is the equivalent of the cfitsio fits_delete_key function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{key} - Key name to remove.

@subsubheading Outputs
 None

@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.deleteRecord
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteRecord
@cindex deleteRecord
@deftypefn {} {} deleteRecord(@var{file}, @var{keynum})
 Delete a key in the fits file.

 This is the equivalent of the cfitsio fits_delete_record function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{keynum} - Record number to remove.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.getHdrSpace
@c -----------------------------------------
@subsubsection matlab.io.fits.getHdrSpace
@cindex getHdrSpace
@deftypefn {} {[@var{numkeys}, @var{freekeys}] = } getHdrSpace(@var{file})
 Get the number of keyword records used and available.

 This is the equivalent of the cfitsio fits_get_hdrspace function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{numkeys} - number of existing keys.

@var{freekeys} - number of free key space.
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readCard
@c -----------------------------------------
@subsubsection matlab.io.fits.readCard
@cindex readCard
@deftypefn {} {@var{card} = } readCard(@var{file}, @var{recname})
 Read the keyword card for name @var{recname}

 This is the equivalent of the cfitsio fits_read_card function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - record name to read

@subsubheading Outputs
@var{card} - unparsed record value string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKey
@c -----------------------------------------
@subsubsection matlab.io.fits.readKey
@cindex readKey
@deftypefn {} {[@var{keyvalue}, @var{keycomment}] = } readKey(@var{file}, @var{recname})
 Read the keyword value and comment for name @var{recname}.

 This is the equivalent of the cfitsio fits_read_key_str function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{keyvalue} - string value of record.

@var{keycomment} - comment string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKeyCmplx
@c -----------------------------------------
@subsubsection matlab.io.fits.readKeyCmplx
@cindex readKeyCmplx
@deftypefn {} {[@var{value}, @var{comment}] = } readKeyCmplx(@var{file}, @var{recname})
 Read the key value @var{recname} as a complex double.

 This is the equivalent of the cfitsio fits_read_key_dblcmp function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{value} - complex value of record.

@var{comment} - comment string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKeyDbl
@c -----------------------------------------
@subsubsection matlab.io.fits.readKeyDbl
@cindex readKeyDbl
@deftypefn {} {[@var{value}, @var{comment}] = } readKeyDbl(@var{file}, @var{recname})
 Read the key value @var{recname} as a double.

 This is the equivalent of the cfitsio fits_read_key_dbl function.\n \

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{value} - double value of record.

@var{comment} - comment string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKeyLongLong
@c -----------------------------------------
@subsubsection matlab.io.fits.readKeyLongLong
@cindex readKeyLongLong
@deftypefn {} {[@var{value}, @var{comment}] = } readKeyLongLong(@var{file}, @var{recname})
 Read the key value @var{recname} as a long long.

 This is the equivalent of the cfitsio fits_read_key_lnglng function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{value} - int64 value of record.

@var{comment} - comment string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKeyLongStr
@c -----------------------------------------
@subsubsection matlab.io.fits.readKeyLongStr
@cindex readKeyLongStr
@deftypefn {} {[@var{value}, @var{comment}] = } readKeyLongStr(@var{file}, @var{recname})
 Read the key value @var{recname} as a string.

 This is the equivalent of the cfitsio fits_read_key_longstr function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{value} - string value of record.

@var{comment} - comment string
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readKeyUnit
@c -----------------------------------------
@subsubsection matlab.io.fits.readKeyUnit
@cindex readKeyUnit
@deftypefn {} {@var{keyunit} = } readKeyUnit(@var{file}, @var{recname})
 Read the physical key units value @var{recname}.

 This is the equivalent of the cfitsio fits_read_key_unit function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recname} - keyword name.

@subsubheading Outputs
@var{keyunit} - units value of record.
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.readRecord
@c -----------------------------------------
@subsubsection matlab.io.fits.readRecord
@cindex readRecord
@deftypefn {} {@var{rec} = } readRecord(@var{file}, @var{recidx})
 Read the keyword record at @var{recidx}.

 This is the equivalent of the cfitsio fits_read_record function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{recidx} - record number.

@subsubheading Outputs
@var{rec} - full keyword record
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.writeComment
@c -----------------------------------------
@subsubsection matlab.io.fits.writeComment
@cindex writeComment
@deftypefn {} {} writeComment(@var{file}, @var{comment})
 Append a comment to to the fits file.

 This is the equivalent of the cfitsio fits_write_comment function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{comment} - comment to append

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.writeDate
@c -----------------------------------------
@subsubsection matlab.io.fits.writeDate
@cindex writeDate
@deftypefn {} {} writeDate(@var{file})
 Write the date keyword.

 This is the equivalent of the cfitsio fits_write_date function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.writeHistory
@c -----------------------------------------
@subsubsection matlab.io.fits.writeHistory
@cindex writeHistory
@deftypefn {} {} writeHistory(@var{file}, @var{history})
 Append a history to to the fits file.

 This is the equivalent of the cfitsio fits_write_history function.
@subsubheading Inputs
@var{file} - opened fits file.

@var{history} - history string.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.writeKey
@c -----------------------------------------
@subsubsection matlab.io.fits.writeKey
@cindex writeKey
@deftypefn {} {} writeKey(@var{file}, @var{key}, @var{value})
@deftypefnx {} {} writeKey(@var{file}, @var{key}, @var{value}, @var{comment})
@deftypefnx {} {} writeKey(@var{file}, @var{key}, @var{value}, @var{comment}, @var{decimals})
 Append or replace a key in the fits file.

 This is the equivalent of the cfitsio fits_write_key and fits_update_key function.
@subsubheading Inputs
@var{file} - opened fits file.

@var{key} - keyword name.

@var{value} - keyword value.

@var{comment} - keyword comment.

@var{decimals} - number of decimals.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsKeyword Functions matlab.io.fits.writeKeyUnit
@c -----------------------------------------
@subsubsection matlab.io.fits.writeKeyUnit
@cindex writeKeyUnit
@deftypefn {} {} writeKeyUnit(@var{file}, @var{key}, @var{unit})
 Write a key unit to the fits file.

 This is the equivalent of the cfitsio fits_write_key_unit function.
@subsubheading Inputs
@var{file} - opened fits file.

@var{key} - keyword name.

@var{unit} - keyword units as string.

@subsubheading Outputs
 None
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Image Manipulation
@subsection Image Manipulation
@cindex Low Level Functions - Image Manipulation
@c Low Level FunctionsImage Manipulation matlab.io.fits.createImg
@c -----------------------------------------
@subsubsection matlab.io.fits.createImg
@cindex createImg
@deftypefn {} {} createImg(@var{file}, @var{bitpix}, @var{naxis})
 create a new primary image or image extension.

 This is the equivalent of the cfitsio fits_create_imgll function.

@subsubheading Inputs
@var{file} - file previously opened with openFile, openDiskFile
 or createFile.

@var{bitpix} - type for the data as a string in either matlab or cfitsio naming.

@var{naxis} - axis values for the image.

@subsubheading Outputs
 None

@subsubheading Examples
@example
 import_fits;
 fd = fits.createFile("test.fits");
 fits.createImg(fd,'int16',[10 20]);
 fits.close(fd);
@end example
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.getImgSize
@c -----------------------------------------
@subsubsection matlab.io.fits.getImgSize
@cindex getImgSize
@deftypefn {} {@var{size}} = getImgSize(@var{file})
 Return size of a Image HDU.

 This is the equivalent of the cfitsio fits_get_img_size function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{size} - vector containing the image dimensions.
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.getImgType
@c -----------------------------------------
@subsubsection matlab.io.fits.getImgType
@cindex getImgType
@deftypefn {} {@var{type}} = getImgType(@var{file})
 Return datatype of a Image HDU

 This is the equivalent of the cfitsio fits_get_img_type function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{type} - datatype as a string for the image type.
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.insertImg
@c -----------------------------------------
@subsubsection matlab.io.fits.insertImg
@cindex insertImg
@deftypefn {} {} insertImg(@var{file}, @var{bitpix}, @var{naxis})
 Insert a new primary image or image extension at current HDU position.

 This is the equivalent of the cfitsio fits_insert_imgll function.

@subsubheading Inputs
@var{file} - file previously opened with openFile, openDiskFile
 or createFile.

@var{bitpix} - type for the data as a string in either matlab or cfitsio naming.

@var{naxis} - axis values for the image.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.readImg
@c -----------------------------------------
@subsubsection matlab.io.fits.readImg
@cindex readImg
@deftypefn {} {@var{data}} = readImg(@var{file})
@deftypefnx {} {@var{data}} = readImg(@var{file}, @var{firstpix}, @var{lastpix})
@deftypefnx {} {@var{data}} = readImg(@var{file}, @var{firstpix}, @var{lastpix}, @var{inc})
 Read Image data.

 This is the equivalent of the cfitsio fits_read_subset function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{firstpix} - first pile coordinate

@var{lastpix} - last pixel coordinate

@var{inc} -  pixel increment

@subsubheading Outputs
@var{data} - image data read
@subsubheading Examples
@example
 import_fits;
 filename = file_in_loadpath("demos/tst0012.fits");
 fd = fits.openFile(filename);
 # read the image
 imagedata = fits.readImg(fd);
 # read a 70x80 part of the image
 imagedata = fits.readImg(fd, [11 11],[80 90]);
 fits.closeFile(fd);
@end example
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.setBscale
@c -----------------------------------------
@subsubsection matlab.io.fits.setBscale
@cindex setBscale
@deftypefn {} {} setBscale(@var{file}, @var{bscale}, @var{bzero})
 Reset bscale and bzero to be used with reading and writing Images.

 This is the equivalent of the cfitsio fits_set_bscale function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{bscale} - bscale value

@var{bzero} - bzero value

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.setTscale
@c -----------------------------------------
@subsubsection matlab.io.fits.setTscale
@cindex setTscale
@deftypefn {} {} setTscale(@var{file}, @var{col}, @var{scale}, @var{zero})
 Reset scale and zero to be used with reading and writing table data.

 This is the equivalent of the cfitsio fits_set_tscale function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{col} - column number

@var{scale} - scale value

@var{zero} - zero value

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsImage Manipulation matlab.io.fits.writeImg
@c -----------------------------------------
@subsubsection matlab.io.fits.writeImg
@cindex writeImg
@deftypefn {} {} writeImg(@var{file}, @var{imagedata})
@deftypefnx {} {} writeImg(@var{file}, @var{imagedata}, @var{fpixel})
 write imagedata to a FITS file. The rows and column size must match the size of NAXIS, NAXIS etc

 This is the equivalent of the cfitsio fits_write_subset function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{imagedata} - Image data.

@var{fpixel} - start pixel to write from.

@subsubheading Outputs
 None

@subsubheading Examples
 Create a fits file and write a 10x10 image in the primary and image ext:
@example
 import_fits;
 fd = fits.createFile("myfitsfile.fits");
 data = int16(zeros(10,10));
 # primary
 fits.createImg(fd,class(data), size(data));
 fits.writeImg(fd,data);
 # image ext
 fits.createImg(fd,class(data), size(data));
 fits.writeImg(fd,data);
 # close file
 fits.closeFile(fd);
@end example
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Utility Functions
@subsection Utility Functions
@cindex Low Level Functions - Utility Functions
@c Low Level FunctionsUtility Functions matlab.io.fits.getConstantNames
@c -----------------------------------------
@subsubsection matlab.io.fits.getConstantNames
@cindex getConstantNames
@deftypefn {} {@var{namelist}} = getConstantNames()
 Return the names of all known fits constants.

@subsubheading Inputs
 None

@subsubheading Outputs
@var{namelist} - cell array of all known fits constant names

@xseealso {getConstantValue}
@end deftypefn
@c Low Level FunctionsUtility Functions matlab.io.fits.getConstantValue
@c -----------------------------------------
@subsubsection matlab.io.fits.getConstantValue
@cindex getConstantValue
@deftypefn {} {@var{value}} = getConstantValue(@var{name})
 Return the value of a known fits constant.

@subsubheading Inputs
@var{name} - name of the constant to retrieve value of.

@subsubheading Outputs
@var{value} - value of the constant

@xseealso {getConstantNames}
@end deftypefn
@c Low Level FunctionsUtility Functions matlab.io.fits.getOpenFiles
@c -----------------------------------------
@subsubsection matlab.io.fits.getOpenFiles
@cindex getOpenFiles
@deftypefn {} {@var{files}} = getOpenFiles()
 Get the file handles of all open fits files.

@subsubheading Inputs
 None

@subsubheading Outputs
@var{files} list of opened fits file handles.
@xseealso {openFile}
@end deftypefn
@c Low Level FunctionsUtility Functions matlab.io.fits.getVersion
@c -----------------------------------------
@subsubsection matlab.io.fits.getVersion
@cindex getVersion
@deftypefn {} {@var{ver}} = getVersion()
 Return the version number of the cfitsio library used.

 This is the equivalent of the cfitsio fits_get_version function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{ver} - version
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Compression Functions
@subsection Compression Functions
@cindex Low Level Functions - Compression Functions
@c Low Level FunctionsCompression Functions matlab.io.fits.imgCompress
@c -----------------------------------------
@subsubsection matlab.io.fits.imgCompress
@cindex imgCompress
@deftypefn {} {} imgCompress(@var{infile}, @var{outfile})
 Copy HDU and image data from one infile to another, using the outfiles compression type.

 This is the equivalent of the cfitsio fits_img_compress function.

@subsubheading Inputs
@var{infile} - opened input fits file.

@var{outfile} - opened writable output fits file.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsCompression Functions matlab.io.fits.isCompressedImg
@c -----------------------------------------
@subsubsection matlab.io.fits.isCompressedImg
@cindex isCompressedImg
@deftypefn {} {@var{comp} =} isCompressedImg(@var{file})
 Return true if image is compressed.

 This is the equivalent of the cfitsio fits_is_compressed_image function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{comp} - boolean for whether image is compressed or not.
@end deftypefn
@c Low Level FunctionsCompression Functions matlab.io.fits.setCompressionType
@c -----------------------------------------
@subsubsection matlab.io.fits.setCompressionType
@cindex setCompressionType
@deftypefn {} {} setCompressionType(@var{file}, @var{comptype})
 Set compression type for writing FITS images.

 This is the equivalent of the cfitsio fits_set_compression_type function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{comptype} - compression type.
 Valid comptype values are: 'GZIP', 'GZIP2', 'RICE', 'PLIO', 'HCOMPRESS' or 'NOCOMPRESS'.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsCompression Functions matlab.io.fits.setHCompScale
@c -----------------------------------------
@subsubsection matlab.io.fits.setHCompScale
@cindex setHCompScale
@deftypefn {} {} setHCompScale(@var{file}, @var{scale})
 Set scale to be used with HCOMPRESS compression.

 This is the equivalent of the cfitsio fits_set_hcomp_scale function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{scale} - scale value
@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsCompression Functions matlab.io.fits.setHCompSmooth
@c -----------------------------------------
@subsubsection matlab.io.fits.setHCompSmooth
@cindex setHCompSmooth
@deftypefn {} {} setHCompSmooth(@var{file}, @var{smooth})
 Set smooth value to be used with HCOMPRESS compression.

 This is the equivalent of the cfitsio fits_set_hcomp_smooth function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{smooth} - smooth value

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsCompression Functions matlab.io.fits.setTileDim
@c -----------------------------------------
@subsubsection matlab.io.fits.setTileDim
@cindex setTileDim
@deftypefn {} {} setTileDim(@var{file}, @var{tiledims})
 Set compression tile dims for writing FITS images.

 This is the equivalent of the cfitsio fits_set_tile_dim function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{tiledims} - tile dimensions

@subsubheading Outputs
 None
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Binary and ASCII Tables
@subsection Binary and ASCII Tables
@cindex Low Level Functions - Binary and ASCII Tables
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.createTbl
@c -----------------------------------------
@subsubsection matlab.io.fits.createTbl
@cindex createTbl
@deftypefn {} {} createTbl(@var{file}, @var{tbltype}, @var{nrows}, @var{ttype}, @var{tform})
@deftypefnx {} {} createTbl(@var{file}, @var{tbltype}, @var{nrows}, @var{ttype}, @var{tform}, @var{tunit})
@deftypefnx {} {} createTbl(@var{file}, @var{tbltype}, @var{nrows}, @var{ttype}, @var{tform}, @var{tunit}, @var{extname})
 Create a new ASCII or bintable extension.

 This is the equivalent of the cfitsio fits_create_tbl function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{tbltype} - table type 'binary' or 'ascii'.

@var{nrows} - initial number of rows (normally 0)

@var{ttype} - cell array of column type

@var{tform} - cell array of column format

@var{tunit} - cell array of column units

@var{extname} - optional extension name

@var{ttype}, @var{tform}, @var{tunit} are expected to be the same size.

@subsubheading Outputs
 None

@subsubheading Examples
@example
 import_fits;
 fd = fits.createFile("test.fits");
 ttype = @{'Col1','Col2','Col3','Col4'@};
 tform = @{'A9','A4','A3','A8'@};
 tunit = @{'m','s','kg','km'@};
 fits.createTbl(fd,'binary',0,ttype,tform,tunit,'table-name');
 fits.closeFile(fd);
@end example
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.deleteCol
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteCol
@cindex deleteCol
@deftypefn {} {} deleteCol(@var{file}, @var{colnum})
 Delete a column from a table.

 This is the equivalent of the cfitsio fits_delete_col function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column to delete from current table.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.deleteRows
@c -----------------------------------------
@subsubsection matlab.io.fits.deleteRows
@cindex deleteRows
@deftypefn {} {} deleteRows(@var{file}, @var{firstrow}, @var{numrows})
 Insert a rows into a table.

 This is the equivalent of the cfitsio fits_delete_rows function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{firstrow} - Start row to delete.

@var{numrows} - Number of rows to delete.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getAColParms
@c -----------------------------------------
@subsubsection matlab.io.fits.getAColParms
@cindex getAColParms
@deftypefn {} {[@var{ttype},@var{tbcol},@var{tunit},@var{tform},@var{scale},@var{zero},@var{nulstr},@var{tdisp}]} = getAColParms(@var{file}, @var{colnum})
 Get ASCII table parameters.

 This is the equivalent of the cfitsio fits_get_acolparms function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column to retrieve.

@subsubheading Outputs
@var{ttype},@var{tbcol},@var{tunit},@var{tform},@var{scale},@var{zero},@var{nulstr},@var{tdisp}
 column information in same format as provided by fits_get_acolparms.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getBColParms
@c -----------------------------------------
@subsubsection matlab.io.fits.getBColParms
@cindex getBColParms
@deftypefn {} {[@var{ttype},@var{tunit},@var{typechar},@var{repeat},@var{scale},@var{zero},@var{nulval},@var{tdisp}]} = getBColParms(@var{file}, @var{colnum})
 Get binary table parameters.

 This is the equivalent of the cfitsio  fits_get_bcolparms function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column to retrieve.

@subsubheading Outputs
@var{ttype},@var{tunit},@var{typechar},@var{repeat},@var{scale},@var{zero},@var{nulval},@var{tdisp}
 column information in same format as provided by fits_get_bcolparms.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getColName
@c -----------------------------------------
@subsubsection matlab.io.fits.getColName
@cindex getColName
@deftypefn {} {[@var{colnum},@var{colname}]} = getColName(@var{file}, @var{template})
@deftypefnx {} {[@var{colnum},@var{colname}]} = getColName(@var{file}, @var{template}, @var{casesens})
 Get column name.

 This is the equivalent of the cfitsio fits_get_colname function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{template} - template string for matching column name.

@var{casesens} - boolean whether to be case sensitive in match.

@subsubheading Outputs
@var{colnum} - column number of match.

@var{colname} - column name of match.

@subsubheading Examples
@example
 import_fits;
 filename = file_in_loadpath("demos/tst0012.fits");
 fd = fits.openFile(filename);
 fits.movAbsHDU(fd,2);
 [colnum, colname] = fits.getColName(fd,"C*");
 # returned 3, "COUNTS"
 fits.closeFile(fd);
@end example
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getColType
@c -----------------------------------------
@subsubsection matlab.io.fits.getColType
@cindex getColType
@deftypefn {} {[@var{dtype},@var{repeat},@var{width}]} = getColType(@var{file}, @var{colnum})
 Get column type.

 This is the equivalent of the cfitsio  fits_get_coltypell function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column to delete from current table.

@subsubheading Outputs
@var{dtype},@var{repeat},@var{width} - column information.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getEqColType
@c -----------------------------------------
@subsubsection matlab.io.fits.getEqColType
@cindex getEqColType
@deftypefn {} {[@var{dtype},@var{repeat},@var{width}]} = getEqColType(@var{file}, @var{colnum})
 Get column type.

 This is the equivalent of the cfitsio  fits_get_eqcoltypell function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column number.

@subsubheading Outputs
@var{dtype},@var{repeat},@var{width} - column type
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getNumCols
@c -----------------------------------------
@subsubsection matlab.io.fits.getNumCols
@cindex getNumCols
@deftypefn {} {@var{ncols}} = getNumCols(@var{file})
 Get number of columns.

 This is the equivalent of the cfitsio  fits_get_num_cols function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{ncols} - the number of columns in the table.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getNumRows
@c -----------------------------------------
@subsubsection matlab.io.fits.getNumRows
@cindex getNumRows
@deftypefn {} {@var{nrows}} = getNumRows(@var{file})
 Get number of rows.

 This is the equivalent of the cfitsio fits_get_numrowsll function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{nrows} - the number of rows in in the current table.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.getRowSize
@c -----------------------------------------
@subsubsection matlab.io.fits.getRowSize
@cindex getRowSize
@deftypefn {} {@var{nrows}} = getRowSize(@var{file})
 Get optimum number of rows to read/write at one time.

 This is the equivalent of the cfitsio  fits_get_rowsize function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{nrows} - number of rows.
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.insertATbl
@c -----------------------------------------
@subsubsection matlab.io.fits.insertATbl
@cindex insertATbl
@deftypefn {} {} insertATbl(@var{file}, @var{rowlen}, @var{nrows}, @var{ttype}, @var{tbcol}, @var{tform})
@deftypefnx {} {} insertATbl(@var{file}, @var{rowlen}, @var{nrows}, @var{ttype}, @var{tbcol}, @var{tform}, @var{tunit})
@deftypefnx {} {} insertATbl(@var{file}, @var{tbltype}, @var{nrows}, @var{ttype}, @var{tbcol}, @var{tform}, @var{tunit}, @var{extname})
 Insert a new ASCII table after current HDU.

 This is the equivalent of the cfitsio fits_insert_atbl function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{rowlen} - row length. If set to 0, the function will calculate size based on
 tbcol and ttype.

@var{nrows} - initial number of rows (normally 0)

@var{ttype} - cell array of column type

@var{tbcol} - array containing the start indices for each column.

@var{tform} - cell array of column format

@var{tunit} - cell array of column units

@var{extname} - optional extension name

@subsubheading Outputs
 None

@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.insertBTbl
@c -----------------------------------------
@subsubsection matlab.io.fits.insertBTbl
@cindex insertBTbl
@deftypefn {} {} insertBTbl(@var{file}, @var{nrows}, @var{ttype}, @var{tform}, @var{tunit}, @var{extname}, @var{pcount})
 Insert a new bintable extension.

 This is the equivalent of the cfitsio fits_insert_btbl function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{nrows} - initial number of rows (normally 0)

@var{ttype} - cell array of column type

@var{tform} - cell array of column format

@var{tunit} - cell array of column units

@var{extname} - optional extension name

@var{pcount} - heap size.

@var{ttype}, @var{tform}, @var{tunit} are expected to be the same size.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.insertCol
@c -----------------------------------------
@subsubsection matlab.io.fits.insertCol
@cindex insertCol
@deftypefn {} {} insertCol(@var{file}, @var{colnum}, @var{ttype}, @var{tform})
 Insert a column into a table.

 This is the equivalent of the cfitsio fits_insert_col function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - Column to delete from current table.

@var{ttype}, @var{tform} - column type to insert

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.insertRows
@c -----------------------------------------
@subsubsection matlab.io.fits.insertRows
@cindex insertRows
@deftypefn {} {} insertRows(@var{file}, @var{firstrow}, @var{numrows})
 Insert rows into a table.

 This is the equivalent of the cfitsio fits_insert_rows function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{firstrow} - Start row to insert from.

@var{numrows} - Number of rows to add.

@subsubheading Outputs
 None
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.readATblHdr
@c -----------------------------------------
@subsubsection matlab.io.fits.readATblHdr
@cindex readATblHdr
@deftypefn {} {[@var{rowlen},@var{nrows},@var{ttype},@var{tbcol},@var{tform},@var{tunit},@var{extname}]} = readATblHdr(@var{file})
 Get ASCII table parameters.

 This is the equivalent of the cfitsio  fits_read_atablhdrll function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{rowlen},@var{nrows},@var{ttype},@var{tbcol},@var{tform},@var{tunit},@var{extname} - table properties
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.readBTblHdr
@c -----------------------------------------
@subsubsection matlab.io.fits.readBTblHdr
@cindex readBTblHdr
@deftypefn {} {[@var{nrows},@var{ttype},@var{tform},@var{tunit},@var{extname},@var{pcount}]} = readBTblHdr(@var{file})
 Get Binary table parameters.

 This is the equivalent of the cfitsio  fits_read_btablhdrll function.

@subsubheading Inputs
@var{file} - opened fits file.

@subsubheading Outputs
@var{nrows},@var{ttype},@var{tform},@var{tunit},@var{extname},@var{pcount}] - table properties
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.readCol
@c -----------------------------------------
@subsubsection matlab.io.fits.readCol
@cindex readCol
@deftypefn {} {[@var{coldata}, @var{nullval}]} = readCol(@var{file}, @var{colnum})
@deftypefnx {} {[@var{coldata}, @var{nullval}]} = readCol(@var{file}, @var{colnum}, @var{firstrow}, @var{numrows})
 Get table row data.

 This is the equivalent of the cfitsio  fits_read_col function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{firstrow} - Start row

@var{numrows} - Number of rows to read

@subsubheading Outputs
@var{coldata} - the column data rows

@var{nulldata} - the null value flags
@subsubheading Examples
@example
 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);
@end example
@end deftypefn
@c Low Level FunctionsBinary and ASCII Tables matlab.io.fits.writeCol
@c -----------------------------------------
@subsubsection matlab.io.fits.writeCol
@cindex writeCol
@deftypefn {} {} writeCol(@var{file}, @var{colnum}, @var{firstrow}, @var{data})
 Write elements to a table.

 This is the equivalent of the cfitsio fits_write_col function.

@subsubheading Inputs
@var{file} - opened fits file.

@var{colnum} - column number.

@var{firstrow} - first row number.

@var{data} - data to write to column

@subsubheading Outputs
 None
@end deftypefn
@c ---------------------------------------------------
@node Low Level Functions - Import functions
@subsection Import functions
@cindex Low Level Functions - Import functions
@c Low Level FunctionsImport functions import_fits
@c -----------------------------------------
@subsubsection import_fits
@cindex import_fits
@deftypefn {} {} import_fits
 Import the fits functions into a fits.xxxxx variable, to emulate importing the fits namespace.
@end deftypefn
