Class RFits::HDU
In: lib/rfits/rfits.rb
Parent: Object

The base class for all HDUs. It‘s possible to use this on its own, but really it‘s intended to be abstract.

Methods

Constants

HDU_TYPE_MAP = { IO::Proxy::IMAGE_HDU => :image, IO::Proxy::ASCII_TBL => :ascii_tbl, IO::Proxy::BINARY_TBL => :binary_tbl, IO::Proxy::ANY_HDU => :other

Attributes

data  [R]  The data associated with the HDU.
file  [R]  The file object associated with the HDU.
header  [R]  The header associated with the HDU.

Public Class methods

Initialize a new HDU in the specified file at the specified position (zero-based). This doesn‘t actually write bytes to file—use HDU#create for that.

 fits = File.open('m31.fits', 'rw') do |f|
   hdu = HDU.new(f, 2)
 end

Public Instance methods

Get the type of HDU. Possibilities are: :image, :ascii_tbl, :binary_tbl, :other

Get the position of the HDU.

 puts hdu.position   # 2 -> this is the third HDU in the file

[Validate]