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

Telescope.Fits.Encoding

Synopsis

Decoding

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

Decode a FITS file read as a strict ByteString

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

Encoding

encode :: Fits -> ByteString Source #

Encode a FITS file to a strict ByteString

BS.writeFile $ encdoe fits

encodeHDU :: (Checksum -> BuilderBlock) -> ByteString -> ByteString Source #

Encode an HDU, properly handling datasum and checksum

replaceKeywordLine :: ByteString -> Value -> Maybe Text -> ByteString -> ByteString Source #

Fast replace a single keyword in a raw header bytestring

Parser

nextParser :: forall (es :: [Effect]) a. (Error HDUError :> es, State ByteString :> es) => String -> Parser a -> Eff es a Source #

Parse HDUs by running MegaParsec parsers one at a time, tracking how much of the ByteString we've consumed

parseFits :: forall (es :: [Effect]). (State ByteString :> es, Error HDUError :> es) => Eff es Fits Source #