telescope-0.3.0: 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 from a strict ByteString

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

encode :: Fits -> ByteString Source #

Encode a FITS file to a strict ByteString

BS.writeFile $ encode fits

parseFits :: forall es. (State ByteString :> es, Parser :> es) => Eff es Fits Source #

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

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

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