telescope-0.1.2: Astronomical Observations (FITS, ASDF, WCS, etc)
Safe HaskellSafe-Inferred
LanguageGHC2021

Telescope.Fits.Encoding

Synopsis

Documentation

decode :: forall m. MonadThrow m => ByteString -> m Fits Source #

Decode a FITS file read as a strict ByteString

 decode =<< BS.readFile "samples/simple2x3.fits"

nextParserThrow :: State ByteString :> es => String -> Parser a -> Eff es a Source #

nextParser :: (Error HDUError :> es, State ByteString :> es) => String -> Parser a -> Eff es a Source #

encode :: Fits -> ByteString Source #

Encode a FITS file to a strict ByteString

BS.writeFile $ encdoe fits

runRender :: BuilderBlock -> ByteString Source #

Execute a BuilderBlock and create a bytestring

renderDataKeywords :: BitPix -> Axes Column -> BuilderBlock Source #

Render required keywords for a data array

renderOtherKeywords :: Header -> BuilderBlock Source #

Header contains all other keywords. Filter out any that match system keywords so they aren't rendered twice

fillBlock :: (Int -> BuilderBlock) -> BuilderBlock -> BuilderBlock Source #

Fill out the header or data block to the nearest 2880 bytes

data BuilderBlock Source #

We need a builder that keeps track of its length so we can pad things

Constructors

BuilderBlock 

Fields

builderBlock :: Int -> Builder -> BuilderBlock Source #

Smart constructor, don't allow negative lengths