h&{      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklTypes for FITS Data Units(c) Zac Slade, 2023BSD2krakrjak@gmail.com experimental Safe-Inferred":$ fits-parseThe 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-parse datatype for discriminating valid FITS KEYWORD=VALUE types in an HDU.  fits-parseThe m wrapper for HDU the keyword data for lines of the form: KEYWORD=VALUE fits-parseDirect encoding of a n for parsing   fits-parseThe 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-parseThe maximum amount of eighty byte records is thirty-six per the standard.! fits-parseThe 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-parseThis utility function can be used to get the word count for data in an HDU.# fits-parseThis utility function can be used to get the size in bytes of the - format.$ fits-parseThis utility functions quickly lets you know if you are dealing with integer data.% fits-parseThis utility functions quickly lets you know if you are dealing with floating point data.o fits-parse Removes the  tag from an p type within. q fits-parse Removes the  tag from a r type within. & fits-parse#Remove the Pix wrapper for integer  lists. ' fits-parse Remove the  wrapper for floating point  lists. ( fits-parseThis 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.7 fits-parse!Value of SIMPLE=T in the header.  supported3 NonConformat ^ Value of SIMPLE=F in the header.  unsupported8 fits-parseWhen we load a header, we parse the BITPIX and NAXIS(N) keywords so we - can know how long the data array is= fits-parseAny header data unit can use the primary format. The first MUST be Primary. This is equivalent to having no extension> fits-parse?An encoded image. PCOUNT and GCOUNT are required but irrelevant? fits-parseA Binary table. PCOUNT is the number of bytes that follow the data in the AL fits-parseThe L is the full HDU. Both the header information is encoded alongside the data payload.N fits-parse/The heeader contains metadata about the payloadO fits-parse&This dimensions of the main data arrayP fits-parse#Extensions may vary the data formatQ fits-parseThe main data array  !"#$%&'()*89:;<=>?@ABCDEFLMNOPQRSTUZ[\](&'LMNOPQZ\[] B<=>?@ACDEF89:;TURS $%"#)* !#MegaParsec based parser for an HDU.(c) Zac Slade, 2023BSD2krakrjak@gmail.com experimental Safe-Inferred"s fits-parse>Consumes ALL header blocks until end, then all remaining spacet fits-parse=Combinator to allow for parsing a record with inline commentsu fits-parseParses the specified keywordv fits-parseAnything but a space or equalsw fits-parseWe don't parse simple here, because it isn't required on all HDUs,xyz{|}~stuvw Safe-Inferred"'e fits-parse+Parse and read all HDUs in the input stringf fits-parse9Parse and read only the Primary HDU from the input stringg fits-parse7Look up a keyword and parse it into the expected formath fits-parse6Get the HDU at an index and fail with a readable error _dcba`efghij efghij_dcba` Safe-Inferredf      !"#$%&'()*+,-./0123456789:;;<=>?@ABCDEFGHIJKLMNNOPQRSSTUVWXYZ[\]^_`abcdefghijklmnopqrspqtupqvwxyz{|}~&fits-parse-0.3.4-2hb4dDdOajnOLlUvJkXCo Data.FitsData.Fits.ReadData.Fits.MegaParserPaths_fits_parseHeader _keywordsPixPBPI16PI32PI64PFPD BitPixFormat EightBitInt SixteenBitIntThirtyTwoBitIntSixtyFourBitIntThirtyTwoBitFloatSixtyFourBitFloatAxesValueIntegerFloatStringLogicKeywordLogicalConstantTF SimpleFormat Conformant NonConformanthduRecordLength hduMaxRecords hduBlockSizebitPixToWordSizebitPixToByteSize isBitPixInt isBitPixFloat pixsUnwrapI pixsUnwrapDparsePix pixDimsByCol pixDimsByRow$fShowBitPixFormat $fEqHeader$fEqBitPixFormat $fShowValue $fEqValue $fShowKeyword $fEqKeyword $fOrdKeyword$fIsStringKeyword$fShowLogicalConstant$fEqLogicalConstant$fEqSimpleFormat$fShowSimpleFormat Dimensions_bitpix_axes ExtensionPrimaryImageBinTablepCountheapkeywordslookuptoInttoFloattoText $fShowHeader$fShowExtension$fShowDimensions$fEqDimensions $fEqExtensionHeaderDataUnit_header _dimensions _extension _mainDataCommentaxesbitpix $fShowComment $fEqComment $fOrdComment$fIsStringComment dimensions extensionheadermainData$fShowHeaderDataUnit FitsError ParseError MissingKey InvalidKey MissingHDU InvalidDatareadHDUsreadPrimaryHDU getKeywordgetHDU maybeError eitherFail$fShowFitsError $fEqFitsError text-2.0.2-7m9cX8KC0uFFaB64QvE9WData.Text.InternalTextghc-prim GHC.TypesBoolunPixIIntunPixDDouble parseHeader withCommentsparseKeywordRecord' parseKeywordparseDimensionsDataUnitValues FITSFloat64 FITSFloat32 FITSInt64 FITSInt32 FITSInt16 FITSUInt8ParseErrParsertoWord wordsTextparseRecordLineparseKeywordRecordparseKeywordValueparseInlineCommentparseLineComment parseValueparseInt parseFloat parseLogicparseStringContinueparseStringValuerequireKeyword requireNaxis skipEmpty consumeDeadparseEnd parseEqualsparsePos parseBitPix parseNaxes parsePrimary parseImage parseBinTableparseBinTableKeywords parseMainDataparseHDU parseHDUsdataSizeversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir