Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- decode :: forall m. MonadThrow m => ByteString -> m Fits
- data HDUError
- encode :: Fits -> ByteString
- runRender :: BuilderBlock -> ByteString
- renderPrimaryHDU :: PrimaryHDU -> BuilderBlock
- renderExtensionHDU :: Extension -> BuilderBlock
- renderImageHDU :: ImageHDU -> BuilderBlock
- renderData :: ByteString -> BuilderBlock
- renderImageHeader :: BitPix -> Axes Column -> Header -> BuilderBlock
- renderPrimaryHeader :: BitPix -> Axes Column -> Header -> BuilderBlock
- renderEnd :: BuilderBlock
- renderDataKeywords :: BitPix -> Axes Column -> BuilderBlock
- renderOtherKeywords :: Header -> BuilderBlock
- fillBlock :: 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
- 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"
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
renderData :: ByteString -> BuilderBlock Source #
renderImageHeader :: BitPix -> Axes Column -> Header -> BuilderBlock Source #
renderPrimaryHeader :: BitPix -> Axes Column -> Header -> 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 :: 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 #
string :: String -> BuilderBlock Source #