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

An Image HDU.

Methods

bitpix   bitpix=   compressed?   create   dim   image_type   naxes   naxes=   naxis   new   resize   size  

Included Modules

Compressible

Constants

IMG_TYPE_MAP = { IO::Proxy::BYTE_IMG => :byte, IO::Proxy::SHORT_IMG => :short, IO::Proxy::LONG_IMG => :long, IO::Proxy::LONGLONG_IMG => :longlong, IO::Proxy::FLOAT_IMG => :float, IO::Proxy::DOUBLE_IMG => :double

Attributes

compression_options  [R] 

Public Class methods

Instantiate a new image in the specified file at the specified position, of a certain data type and size. "coptions" is optional, but if present see Compressible#activate_compression for allowed format.

If you do activate compression for an image there is one "gotcha" that might take you by surprise: if there are no existing HDUs in the file and you add a compressed image, an extra image HDU at the start of the file will be created. In other words, your new compressed image will be at fits[1] not fits[0]. This is because cfitsio compresses the image by wrapping it in a binary table, but the FITS specification mandates that the primary HDU must always be an image array.

Public Instance methods

Number of bits per data pixel. By default returns the "equivalent type" unless equiv is set to false.

Alter the datatype of the image.

 img.bitpix = IO::Proxy::LONG_IMG

Returns true if the image is compressed, false otherwise.

Actually create a physical image (i.e. write bytes). "at" is the position at which to insert the image.

The number of dimensions of the image (i.e. 2).

The type of image. Possibilities include: :byte, :short, :long, :longlong, :float, :double

Alter image dimensions to the specified size.

 img.naxes = [1000, 200]

Resize the image to the specified dimensions and data type.

 img.resize(IO::Proxy::LONG_IMG, [1000, 200])

The size of each dimension (i.e. [512, 512]).

[Validate]