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

Telescope.Fits.Header

Synopsis

Documentation

newtype Header #

The header part of the HDU is vital carrying not only authorship metadata, but also specifying how to make sense of the binary payload that starts 2,880 bytes after the start of the HeaderData.

Constructors

Header 

Fields

Instances

Instances details
Monoid Header 
Instance details

Defined in Data.Fits

Semigroup Header 
Instance details

Defined in Data.Fits

Show Header 
Instance details

Defined in Data.Fits

Eq Header 
Instance details

Defined in Data.Fits

Methods

(==) :: Header -> Header -> Bool #

(/=) :: Header -> Header -> Bool #

data Value #

Value datatype for discriminating valid FITS KEYWORD=VALUE types in an HDU.

Instances

Instances details
Show Value 
Instance details

Defined in Data.Fits

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

Eq Value 
Instance details

Defined in Data.Fits

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

keyword :: Text -> Value -> Maybe Text -> HeaderRecord Source #

Construct a keyword HeaderRecord

addComment :: Text -> KeywordRecord -> KeywordRecord Source #

Set the comment of a KeywordRecrod

Parsing Headers

class FromHeader a where Source #

Minimal complete definition

Nothing

Methods

parseHeader :: forall (es :: [Effect]). Parser :> es => Header -> Eff es a Source #

default parseHeader :: forall (es :: [Effect]). (Generic a, GFromHeader (Rep a), Parser :> es) => Header -> Eff es a Source #

Instances

Instances details
(AxisOrder ax, KnownText alt) => FromHeader (WCSAxis alt ax) Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseHeader :: forall (es :: [Effect]). Parser :> es => Header -> Eff es (WCSAxis alt ax) Source #

class FromKeyword a where Source #

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es a Source #

Instances

Instances details
FromKeyword CType Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es CType Source #

FromKeyword CUnit Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es CUnit Source #

FromKeyword Text Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es Text Source #

FromKeyword Bool Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es Bool Source #

FromKeyword Float Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es Float Source #

FromKeyword Int Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

parseKeywordValue :: forall (es :: [Effect]). Parser :> es => Value -> Eff es Int Source #

Creating Headers

class ToHeader a where Source #

Minimal complete definition

Nothing

Methods

toHeader :: a -> Header Source #

default toHeader :: (Generic a, GToHeader (Rep a)) => a -> Header Source #

Instances

Instances details
ToHeader a => ToHeader (Maybe a) Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

toHeader :: Maybe a -> Header Source #

ToHeader a => ToHeader [a] Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

toHeader :: [a] -> Header Source #

(AxisOrder ax, KnownText alt) => ToHeader (WCSAxis alt ax) Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

toHeader :: WCSAxis alt ax -> Header Source #

parseKeyword :: forall a (es :: [Effect]). (FromKeyword a, Parser :> es) => Text -> Header -> Eff es a Source #

Keyword Lookup

lookupKeyword :: Text -> Header -> Maybe Value Source #

Manually look up a keyword from the header

newtype HeaderFor a Source #

Constructors

HeaderFor a 

Instances

Instances details
(ToHeader a, Selector s) => GToHeader (M1 S s (K1 R (HeaderFor a) :: k -> Type) :: k -> Type) Source # 
Instance details

Defined in Telescope.Fits.Header.Class

Methods

gToHeader :: forall (p :: k). M1 S s (K1 R (HeaderFor a) :: k -> Type) p -> Header Source #

Re-exports

data LogicalConstant #

Direct encoding of a Bool for parsing Value

Constructors

T 
F 

Instances

Instances details
Show LogicalConstant 
Instance details

Defined in Data.Fits

Eq LogicalConstant 
Instance details

Defined in Data.Fits

getKeywords :: Header -> [KeywordRecord] #

Return all KeywordRecords from the header, filtering out full-line comments and blanks

data HeaderRecord #

Headers contain lines that are any of the following

KEYWORD = VALUE / inline comment
COMMENT full line comment
(blank)

Instances

Instances details
Show HeaderRecord 
Instance details

Defined in Data.Fits

Eq HeaderRecord 
Instance details

Defined in Data.Fits

data KeywordRecord #

A single 80 character header keyword line of the form: KEYWORD = VALUE / comment KEYWORD=VALUE

Constructors

KeywordRecord 

Instances

Instances details
Show KeywordRecord 
Instance details

Defined in Data.Fits

Eq KeywordRecord 
Instance details

Defined in Data.Fits