telescope-0.2.0: Astronomical Observations (FITS, ASDF, WCS, etc)
Safe HaskellNone
LanguageGHC2021

Telescope.Fits.DataArray

Synopsis

Documentation

data DataArray Source #

Raw HDU Data. See DataArray

Constructors

DataArray 

Instances

Instances details
Show DataArray Source # 
Instance details

Defined in Telescope.Fits.Types

dataArray :: Dimensions -> ByteString -> DataArray Source #

Create a DataArray from raw Fits info

decodeDataArray :: forall ix a m. (MonadThrow m, MonadCatch m, Index ix, AxesIndex ix, Prim a, BinaryValue a) => DataArray -> m (Array D ix a) Source #

Decode a DataArray of arbitrary dimensions ix and type a. Consider inspecting the DataArray's (.bitpix) and (.axes) if these are unknown.

>>> decodeDataArray @Ix2 @Float hdu.dataArray
Array D Seq (Sz (2 :. 3))
  [ [ 1.0, 2.0, 3.0 ]
  , [ 4.0, 5.0, 6.0 ]
  ]

This creates a delayed (D) array, which will postpone evaluation of cells until needed

encodeDataArray :: forall r ix a. (Source r a, Stream r Ix1 a, Size r, PutArray ix, Index ix, AxesIndex ix, BinaryValue a, Prim a, IsBitPix a) => Array r ix a -> DataArray Source #

Encode an Array to a DataArray

>>> encodeImage array
DataArray:
  data: 48 bytes
  dimensions:
    format: Int64
    axes: [3,2]