Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- decode :: MonadThrow m => ByteString -> m Fits
- encode :: Fits -> ByteString
- encodePrimaryHDU :: PrimaryHDU -> ByteString
- encodeImageHDU :: ImageHDU -> ByteString
- encodeExtension :: Extension -> ByteString
- encodeHDU :: (Checksum -> BuilderBlock) -> ByteString -> ByteString
- replaceKeywordLine :: ByteString -> Value -> Maybe Text -> ByteString -> ByteString
- nextParser :: forall (es :: [Effect]) a. (Error HDUError :> es, State ByteString :> es) => String -> Parser a -> Eff es a
- parseFits :: forall (es :: [Effect]). (State ByteString :> es, Error HDUError :> es) => Eff es Fits
- parseMainData :: forall (es :: [Effect]). State ByteString :> es => Dimensions -> Eff es DataArray
- data HDUError
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
encodeImageHDU :: ImageHDU -> ByteString 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
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 #
parseMainData :: forall (es :: [Effect]). State ByteString :> es => Dimensions -> Eff es DataArray Source #
Instances
Exception HDUError Source # | |
Defined in Telescope.Fits.Encoding toException :: HDUError -> SomeException # fromException :: SomeException -> Maybe HDUError # displayException :: HDUError -> String # | |
Show HDUError Source # | |