Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- decode :: forall m. MonadThrow m => ByteString -> m Fits
- dataArray :: Dimensions -> ByteString -> DataArray
- parseFits :: State ByteString :> es => Eff es Fits
- mainData :: State ByteString :> es => Dimensions -> Eff es DataArray
- nextParserThrow :: State ByteString :> es => String -> Parser a -> Eff es a
- nextParser :: (Error HDUError :> es, State ByteString :> es) => String -> Parser a -> Eff es a
- data HDUError
- encode :: Fits -> ByteString
- runRender :: BuilderBlock -> ByteString
- encodePrimaryHDU :: PrimaryHDU -> ByteString
- encodeImageHDU :: ImageHDU -> ByteString
- encodeExtension :: Extension -> ByteString
- encodeHDU :: (Checksum -> BuilderBlock) -> ByteString -> ByteString
- encodeHeader :: BuilderBlock -> Checksum -> ByteString
- encodeDataArray :: ByteString -> ByteString
- replaceChecksum :: Checksum -> ByteString -> ByteString
- replaceKeywordLine :: ByteString -> Value -> Maybe Text -> ByteString -> ByteString
- renderData :: ByteString -> BuilderBlock
- renderImageHeader :: Header -> DataArray -> Checksum -> BuilderBlock
- renderPrimaryHeader :: Header -> DataArray -> Checksum -> BuilderBlock
- renderDatasum :: Checksum -> BuilderBlock
- renderEnd :: BuilderBlock
- renderDataKeywords :: BitPix -> Axes Column -> BuilderBlock
- renderOtherKeywords :: Header -> BuilderBlock
- fillBlock :: (Int -> BuilderBlock) -> BuilderBlock -> BuilderBlock
- bitPixCode :: BitPix -> Int
- renderKeywordLine :: Text -> Value -> Maybe Text -> BuilderBlock
- renderKeywordValue :: Text -> Value -> BuilderBlock
- renderKeyword :: Text -> BuilderBlock
- renderComment :: Int -> Text -> BuilderBlock
- renderValue :: Value -> BuilderBlock
- data BuilderBlock = BuilderBlock {}
- builderBlock :: Int -> Builder -> BuilderBlock
- justify :: Int -> BuilderBlock -> BuilderBlock
- pad :: Int -> BuilderBlock -> BuilderBlock
- spaces :: Int -> BuilderBlock
- zeros :: Int -> BuilderBlock
- padding :: Builder -> Int -> BuilderBlock
- string :: String -> BuilderBlock
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"
dataArray :: Dimensions -> ByteString -> DataArray Source #
mainData :: State ByteString :> es => Dimensions -> Eff es DataArray Source #
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 #
Instances
Exception HDUError Source # | |
Defined in Telescope.Fits.Encoding toException :: HDUError -> SomeException # fromException :: SomeException -> Maybe HDUError # displayException :: HDUError -> String # | |
Show HDUError 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
encodeImageHDU :: ImageHDU -> ByteString Source #
encodeHDU :: (Checksum -> BuilderBlock) -> ByteString -> ByteString Source #
encodeHeader :: BuilderBlock -> Checksum -> ByteString Source #
replaceChecksum :: Checksum -> ByteString -> ByteString Source #
replaceKeywordLine :: ByteString -> Value -> Maybe Text -> ByteString -> ByteString Source #
renderData :: ByteString -> BuilderBlock Source #
renderImageHeader :: Header -> DataArray -> Checksum -> BuilderBlock Source #
renderPrimaryHeader :: Header -> DataArray -> Checksum -> BuilderBlock Source #
renderDatasum :: Checksum -> BuilderBlock Source #
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
bitPixCode :: BitPix -> Int Source #
renderKeywordLine :: Text -> Value -> Maybe Text -> BuilderBlock Source #
renderKeywordValue :: Text -> Value -> BuilderBlock Source #
renderKeyword :: Text -> BuilderBlock Source #
renderComment :: Int -> Text -> BuilderBlock Source #
renderValue :: Value -> BuilderBlock Source #
data BuilderBlock Source #
We need a builder that keeps track of its length so we can pad things
Instances
IsString BuilderBlock Source # | |
Defined in Telescope.Fits.Encoding fromString :: String -> BuilderBlock # | |
Monoid BuilderBlock Source # | |
Defined in Telescope.Fits.Encoding mempty :: BuilderBlock # mappend :: BuilderBlock -> BuilderBlock -> BuilderBlock # mconcat :: [BuilderBlock] -> BuilderBlock # | |
Semigroup BuilderBlock Source # | |
Defined in Telescope.Fits.Encoding (<>) :: BuilderBlock -> BuilderBlock -> BuilderBlock # sconcat :: NonEmpty BuilderBlock -> BuilderBlock # stimes :: Integral b => b -> BuilderBlock -> BuilderBlock # |
builderBlock :: Int -> Builder -> BuilderBlock Source #
Smart constructor, don't allow negative lengths
justify :: Int -> BuilderBlock -> BuilderBlock Source #
pad :: Int -> BuilderBlock -> BuilderBlock Source #
spaces :: Int -> BuilderBlock Source #
zeros :: Int -> BuilderBlock Source #
string :: String -> BuilderBlock Source #