| Class | RFits::File |
| In: |
lib/rfits/rfits.rb
|
| Parent: | Object |
A class representing a FITS file.
| io | [R] |
Open an existing FITS file or create a new one. The mode parameter may be on of:
fits = RFits::File.new('m31.fits', 'rw') # this is probably what you want
Works as RFits::File#new but accepts a block. The FITS file is automatically closed after execution of the block.
RFits::File.open('m31.fits', 'rw') do |fits|
# do things to the FITS file, fits.close gets called automatically
end
Get the specified HDU associated with the FITS file. Contrary to FITS conventions this is *zero-based* access. So:
primary_hdu = fits[0] # primary array hdu = fits[2] # third HDU
Delete the HDU at the specified position. Again, this is zero-based access.
fits.delete_at(2) # delete the third HDU