Îőłh*×ó      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr0.4.1Types for FITS Data Units(c) Zac Slade, 2023BSD2krakrjak@gmail.com experimental Safe-Inferred"Ň˝' fits-parseâA single 80 character header keyword line of the form: KEYWORD = VALUE / comment KEYWORD=VALUE fits-parseÇ datatype for discriminating valid FITS KEYWORD=VALUE types in an HDU.  fits-parseDirect encoding of a s for parsing   fits-parseŕThe standard defines two possible values for the SIMPLE keyword, T and F. The T refers to a  format while F refers to a  format. At this time only the , T, format is supported. fits-parse2A single record in the HDU is an eighty byte word. fits-parseÍThe maximum amount of eighty byte records is thirty-six per the standard. fits-parse›The size of an HDU block is fixed at thirty-six eighty byte words. In other words 2,880 bytes. These blocks are padded with zeros to this boundary. fits-parse!Value of SIMPLE=T in the header.  supported3 NonConformat ^ Value of SIMPLE=F in the header.  unsupporteddata/fi fits-parsež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. fits-parse Following %Ú we have a tag for integer and floating point values. We box them up to ease parsing.% fits-parseThe % is the nitty gritty of how the AxisÖ data is layed out in the file. The standard recognizes six formats: unsigned 8 bit integer, two's complement binary integers at 16, 32, and 64 bits along with 32 and 64 bit IEEE floating point formats.& fits-parse-BITPIX = 8; unsigned binary integer of 8 bits' fits-parse7BITPIX = 16; two's complement binary integer of 16 bits( fits-parse7BITPIX = 32; two's complement binary integer of 32 bits) fits-parse7BITPIX = 64; two's complement binary integer of 64 bits* fits-parse=BITPIX = -32; IEEE single precision floating point of 32 bits+ fits-parse=BITPIX = -64; IEEE double precision floating point of 64 bits, fits-parse,Đ represents the combination of NAXIS + NAXISn. The spec supports up to 999 axes - fits-parse3Headers contain lines that are any of the following ÂKEYWORD = VALUE / inline comment COMMENT full line comment (blank)1 fits-parseĎThis utility function can be used to get the word count for data in an HDU.2 fits-parseÍThis utility function can be used to get the size in bytes of the - format.3 fits-parse×This utility functions quickly lets you know if you are dealing with integer data.4 fits-parseŢThis utility functions quickly lets you know if you are dealing with floating point data.t fits-parse Removes the  tag from an u type within. v fits-parse Removes the  tag from a w type within. 5 fits-parse#Remove the Pix wrapper for integer  lists. 6 fits-parse Remove the  wrapper for floating point  lists. 7 fits-parseäThis is the main low-level function which parses the data portion of an HDU. You need and element count, a format and a bytestring. The resulting list is produced in column-row major order as specified in the standard.A fits-parseîWhen we load a header, we parse the BITPIX and NAXIS(N) keywords so we - can know how long the data array isF fits-parseöAny header data unit can use the primary format. The first MUST be Primary. This is equivalent to having no extensionG fits-parse?An encoded image. PCOUNT and GCOUNT are required but irrelevantH fits-parseËA Binary table. PCOUNT is the number of bytes that follow the data in the JL fits-parse Return all >s from the header, filtering out full-line comments and blanksM fits-parse Return all >s from the header, filtering out full-line comments and blanksX fits-parseThe XŘ is the full HDU. Both the header information is encoded alongside the data payload.Z fits-parse/The heeader contains metadata about the payload[ fits-parse&This dimensions of the main data array\ fits-parse#Extensions may vary the data format] fits-parseThe main data arrayĐ756XYZ[\]`bac !"#$LK-./0EFGHIJMNO PQR ABCD^_ %&'()*+,341289Đ756XYZ[\]`bac !"#$LK-./0EFGHIJMNO PQR ABCD^_ %&'()*+,341289#MegaParsec based parser for an HDU.(c) Zac Slade, 2023BSD2krakrjak@gmail.com experimental Safe-Inferred"0x fits-parse>Consumes ALL header blocks until end, then all remaining spacey fits-parseParses the specified keywordz fits-parse=Combinator to allow for parsing a record with inline comments{ fits-parseAnything but a space or equals| fits-parseÁWe don't parse simple here, because it isn't required on all HDUs3}~€‚ƒ„…†‡xˆ‰yzŠ‹ŒŽ‘{’“”•–—˜™š›œžŸ |Ą˘Ł¤ĽŚ§¨ŠŞ Safe-Inferred"Ëk fits-parse+Parse and read all HDUs in the input stringl fits-parse9Parse and read only the Primary HDU from the input stringm fits-parse7Look up a keyword and parse it into the expected formatn fits-parse6Get the HDU at an index and fail with a readable error ejihgfklmnop klmnopejihgf Safe-Inferred ŤŹ­ŽŻ°ą˛ł       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEEFGHIJKLMNOPQRSTUVWXYZ[[\]^_`abcdefghijklmnopqrstuvwxuvyzuv{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ'fits-parse-0.4.1-ANAyPavYU13E6Eam3J7Y54 Data.FitsData.Fits.Read fits-parseData.Fits.MegaParserPaths_fits_parse KeywordRecord_keyword_value_commentValueIntegerFloatStringLogicLogicalConstantTF SimpleFormat Conformant NonConformanthduRecordLength hduMaxRecords hduBlockSize$fShowKeywordRecord$fEqKeywordRecord $fShowValue $fEqValue$fShowLogicalConstant$fEqLogicalConstant$fEqSimpleFormat$fShowSimpleFormatHeader_recordsPixPBPI16PI32PI64PFPD BitPixFormat EightBitInt SixteenBitIntThirtyTwoBitIntSixtyFourBitIntThirtyTwoBitFloatSixtyFourBitFloatAxes HeaderRecordKeywordComment BlankLinebitPixToWordSizebitPixToByteSize isBitPixInt isBitPixFloat pixsUnwrapI pixsUnwrapDparsePix pixDimsByCol pixDimsByRow$fShowBitPixFormat $fEqHeader$fSemigroupHeader$fMonoidHeader$fEqBitPixFormat$fShowHeaderRecord$fEqHeaderRecord Dimensions_bitpix_axes ExtensionPrimaryImageBinTablepCountheaprecordskeywords getKeywordslookup isKeywordtoInttoFloattoText $fShowHeader$fShowExtension$fShowDimensions$fEqDimensions $fEqExtensionHeaderDataUnit_header _dimensions _extension _mainDataaxesbitpix dimensions extensionheadermainData$fShowHeaderDataUnit FitsError ParseError MissingKey InvalidKey MissingHDU InvalidDatareadHDUsreadPrimaryHDU getKeywordgetHDU maybeError eitherFail$fShowFitsError $fEqFitsErrorghc-prim GHC.TypesBoolunPixIIntunPixDDouble parseHeaderparseKeywordRecord' withComments parseKeywordparseDimensionsDataUnitValues FITSFloat64 FITSFloat32 FITSInt64 FITSInt32 FITSInt16 FITSUInt8ParseErrParsertoWord wordsTextparseRecordLineparseKeywordRecordignoreCommentsparseKeywordValue parseLineEndspacesToLineEnd parseSpacesNparseInlineCommentparseLineCommentparseLineBlank parseValueparseInt parseFloat parseLogicparseStringContinueparseStringValuerequireKeyword requireNaxis skipEmpty consumeDeadparseEnd parseEqualsparsePos parseBitPix parseNaxes parsePrimaryparsePrimaryKeywords parseImageparseImageKeywords parseBinTableparseBinTableKeywords parseMainDataparseHDU parseHDUsdataSizeversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDirgetDataFileName getSysconfDir