ContentsContentsi1Introduction111BriefhistoryofFITS112Versionhistoryofthisdocument113Acknowledgments ID: 89309
Download Pdf The PPT/PDF document "DenitionoftheFlexibleImageTransportSyst..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
DenitionoftheFlexibleImageTransportSystem(FITS)TheFITSStandardVersion3.0:approved2008July10bytheIAUFWGDocumentpublicationdate:2010November18FITSWorkingGroupCommission5:DocumentationandAstronomicalDataInternationalAstronomicalUnionhttp://fits.gsfc.nasa.gov/iaufwg/ ContentsContentsi1Introduction11.1BriefhistoryofFITS..................................................11.2Versionhistoryofthisdocument............................................11.3Acknowledgments...................................................22Denitions,acronyms,andsymbols32.1Conventionsusedinthisdocument...........................................32.2Denedterms......................................................33FITSleorganization43.1Overalllestructure..................................................43.2IndividualFITSStructures...............................................43.3Primaryheaderanddataunit..............................................43.3.1Primaryheader.................................................43.3.2Primarydataarray...............................................43.4Extensions........................................................53.4.1Requirementsforconformingextensions...................................53.4.2Standardextensions..............................................53.4.3Orderofextensions...............................................53.5Specialrecords(restricteduse).............................................53.6Physicalblocking....................................................53.6.1Bitstreamdevices................................................53.6.2Sequentialmedia................................................53.7Restrictionsonchanges.................................................64Headers64.1Keywordrecords....................................................64.1.1Syntax.....................................................64.1.2Components..................................................64.2Value..........................................................64.2.1Characterstring.................................................64.2.2Logical.....................................................74.2.3Integernumber.................................................74.2.4Realoating-pointnumber...........................................74.2.5Complexintegernumber............................................74.2.6Complexoating-pointnumber........................................74.3Units...........................................................84.3.1Constructionofunitsstrings..........................................84.3.2Unitsincommentelds............................................84.4Keywords........................................................104.4.1Mandatorykeywords..............................................104.4.2Otherreservedkeywords............................................114.4.3Additionalkeywords..............................................145DataRepresentation145.1Characters........................................................145.2Integers.........................................................145.2.1Eight-bit....................................................145.2.2Sixteen-bit...................................................145.2.3Thirty-two-bit..................................................145.2.4Sixty-four-bit..................................................145.2.5Unsignedintegers................................................145.3IEEE-754oatingpoint.................................................14i 6Randomgroupsstructure146.1Keywords........................................................156.1.1Mandatorykeywords..............................................156.1.2Reservedkeywords...............................................156.2Datasequence......................................................156.3Datarepresentation...................................................167Standardextensions167.1Imageextension.....................................................167.1.1Mandatorykeywords..............................................167.1.2Otherreservedkeywords............................................167.1.3Datasequence.................................................167.2TheASCIItableextension...............................................177.2.1Mandatorykeywords..............................................177.2.2Otherreservedkeywords............................................187.2.3Datasequence.................................................187.2.4Fields......................................................197.2.5Entries.....................................................197.3Binarytableextension.................................................197.3.1Mandatorykeywords..............................................207.3.2Otherreservedkeywords............................................207.3.3DataSequence.................................................227.3.4Datadisplay..................................................247.3.5Variable-lengtharrays.............................................247.3.6Variable-length-arrayguidelines........................................258Worldcoordinatesystems268.1Basicconcepts.....................................................268.2Worldcoordinatesystemrepresentations........................................288.2.1AlternativeWCSaxisdescriptions.......................................288.3Celestialcoordinatesystemrepresentations......................................308.4Spectralcoordinatesystemrepresentations.......................................318.4.1Spectralcoordinatereferenceframes......................................318.5Conventionalcoordinatetypes.............................................33ASyntaxofkeywordrecords34BSuggestedtimescalespecication35CSummaryofkeywords37DASCIItext38EIEEEoating-pointformats38E.1Basicformats......................................................38E.1.1Single......................................................39E.1.2Double.....................................................39E.2Bytepatterns......................................................39FReservedextensiontypenames41F.1Standardextensions...................................................41F.2Conformingextensions.................................................41F.3Othersuggestedextensionnames............................................41GMIMEtypes41G.1MIMEtype`application/fits'...........................................41G.1.1Recommendationsforapplicationwriters...................................42G.2MIMEtype`image/fits'...............................................42G.2.1Recommendationsforapplicationwriters...................................42G.3Fileextensions.....................................................43ii HPastchangesorclaricationstotheformaldenitionofFITS43H.1DierencesbetweentherequirementsinthisstandardandtherequirementsintheoriginalFITSpapers.......43H.2ListofmodicationtotheFITSstandard,version3..................................43References/Index44ListofTables1SignicantmilestonesinthedevelopmentofFITS...................................22Versionhistoryofthestandard..............................................23IAU-recommendedbasicunits..............................................84Additionalallowedunits.................................................95Prexesformultiplesandsubmultiples.........................................96Charactersandstringsallowedtodenotemathematicaloperations...........................97Mandatorykeywordsforprimaryheader.........................................108InterpretationofvalidBITPIXvalue...........................................109Exampleofaprimaryarrayheader............................................1110Mandatorykeywordsinconformingextensions.....................................1111UsageofBZEROtorepresentnon-defaultintegerdatatypes...............................1412Mandatorykeywordsinprimaryheaderprecedingrandomgroups...........................1513Mandatorykeywordsinimageextensions........................................1614MandatorykeywordsinASCIItableextensions.....................................1715ValidTFORMnformatvaluesinTABLEextensions....................................1716ValidTDISPnformatvaluesinTABLEextensions....................................1817Mandatorykeywordsinbinarytableextensions.....................................2018ValidTFORMndatatypesinBINTABLEextensions....................................2119UsageofTZEROntorepresentnon-defaultintegerdatatypes..............................2220ValidTDISPnformatvaluesinBINTABLEextensions..................................2221WCSandcelestialcoordinatesnotation.........................................2722ReservedWCSkeywords................................................2923Reservedcelestialcoordinatealgorithmcodes......................................3024AllowedvaluesofRADESYSa..............................................3125Reservedspectralcoordinatetypecodes1........................................3226Non-linearspectralalgorithmcodes1..........................................3227Spectralreferencesystems................................................3328Examplekeywordsfora100elementarrayofcomplexvalues.............................3329ConventionalStokesvalues...............................................33C.1MandatoryFITSkeywords................................................37C.2ReservedFITSkeywords.................................................37C.3GeneralreservedFITSkeywords.............................................37D.1ASCIIcharacterset...................................................38E.1Summaryofformatparameters.............................................39E.2IEEEoating-pointformats...............................................40iii iv 1.IntroductionAnarchivalformatmustbeutterlyportableandself-describing,ontheassumptionthat,apartfromthetran-scriptiondevice,neitherthesoftwarenorthehardwarethatwrotethedatawillbeavailablewhenthedataareread.`PreservingScienticDataonourPhysicalUniverse,'p.60.SteeringCommitteefortheStudyontheLong-TermRetentionofSelectedScienticandTechnicalRecordsoftheFederalGovernment,[US]NationalResearchCouncil,NationalAcademyPress1995.Thisdocument,hereafterreferredtoasthe`standard',de-scribestheFlexibleImageTransportSystem(FITS)whichisthestandardarchivaldataformatforastronomicaldatasets.AlthoughFITSwasoriginallydesignedfortransportingimagedataonmagnetictape(whichaccountsforthe`I'and`T'inthename),thecapabilitiesoftheFITSformathaveexpandedtoac-commodatemorecomplexdatastructures.TheroleofFITShasalsogrownfromsimplyawaytotransportdatabetweendier-entanalysissoftwaresystemsintothepreferredformatfordatainastronomicalarchives,aswellastheon-lineanalysisformatusedbymanysoftwarepackages.ThisstandardisintendedasaformalcodicationoftheFITSformatwhichhasbeenendorsedbytheInternationalAstronomicalUnion(IAU)fortheinterchangeofastronomicaldata(IAU1983).Itisfullyconsistentwithallactionsanden-dorsementsoftheIAUFITSWorkingGroup(IAUFWG)whichwasappointedbyCommission5oftheIAUtooverseefurtherdevelopmentoftheFITSformat.Inparticular,thisstandardde-nestheorganizationandcontentoftheheaderanddataunitsforallstandardFITSdatastructures:theprimaryarray,therandomgroupsstructure,theimageextension,theASCIItableextension,andthebinarytableextension.Italsospeciesminimumstruc-turalrequirementsandgeneralprinciplesgoverningthecreationofnewextensions.Forheaders,itspeciesthepropersyntaxforkeywordrecordsanddenesrequiredandreservedkeywords.Fordata,itspeciescharacterandnumericvaluerepresentationsandtheorderingofcontentswithinthebytestream.OneimportantfeatureoftheFITSformatisthatitsstruc-ture,downtothebitlevel,iscompletelyspeciedindocuments(suchasthisstandard),manyofwhichhavebeenpublishedinrefereedscienticjournals.Giventhesedocuments,whicharereadilyavailableinhardcopyforminlibrariesaroundtheworldaswellasinelectronicformontheInternet,futureresearchersshouldbeabletodecodethestreamofbytesinanyFITSformatdatale.Incontrast,manyothercurrentdataformatsareonlyimplicitlydenedbythesoftwarethatreadsandwritestheles.Ifthatsoftwareisnotcontinuallymaintainedsothatitcanberunonfuturecomputersystems,thentheinformationencodedinthosedatalescouldbelost.1.1.BriefhistoryofFITSTheFITSformatevolvedoutoftherecognitionthatastandardformatwasneededfortransferringastronomicalimagesfromoneresearchinstitutiontoanother.Therstprototypedevel-opmentsofauniversalinterchangeformatthatwouldeventu-allyleadtothedenitionoftheFITSformatbeganin1976be-tweenDonWellsatKPNOandRonHartenattheNetherlandsFoundationforResearchinAstronomy(NFRA).ThisneedforanimageinterchangeformatwasraisedatameetingoftheAstronomysectionoftheU.S.NationalScienceFoundationinJanuary1979,whichledtotheformationofataskforcetoworkontheproblem.MostofthetechnicaldetailsoftherstbasicFITSagreement(withlesconsistingofonlyaprimaryheaderfollowedbyadataarray)weresubsequentlydevelopedbyDonWellsandEricGreisen(NRAO)inMarch1979.Afterfurtherrenements,andsuccessfulimageinterchangetestsbe-tweenobservatoriesthatusedwidelydierenttypesofcomputersystems,therstpapersthatdenedtheFITSformatwerepub-lishedin1981(Wellsetal.1981;Greisen&Harten1981).TheFITSformatquicklybecamethedefactostandardfordatainter-changewithintheastronomicalcommunity(mostlyon9-trackmagnetictapeatthattime)andwasociallyendorsedbytheIAUin1982(IAU1983).Mostnationalandinternationalas-tronomicalprojectsandorganizationssubsequentlyadoptedtheFITSformatfordistributionandarchivingoftheirscienticdataproducts.SomeofthehighlightsinthedevelopmentalhistoryofFITSareshowninTable1.1.2.VersionhistoryofthisdocumentThefundamentaldenitionoftheFITSformatwasoriginallycontainedinaseriesofpublishedpapers(Wellsetal.1981;Greisen&Harten1981;Grosbøletal.1988;Hartenetal.1988).AsFITSbecamemorewidelyused,theneedforasin-gledocumenttounambiguouslydenetherequirementsoftheFITSformatbecameapparent.In1990,theNASAScienceOceofStandardsandTechnology(NOST)attheGoddardSpaceFlightCenterprovidedfundingforatechnicalpaneltodeveloptherstversionofthisstandarddocument.AsshowninTable2,theNOSTpanelproducedseveraldraftversions,culminatingintherstNOSTstandarddocument,NOST100-1.0,in1993.AlthoughthisdocumentwasdevelopedunderaNASAaccreditationprocess,itwassubsequentlyformallyap-provedbytheIAUFWG,whichistheinternationalcontrolau-thorityfortheFITSformat.Thesmallupdatetothestandardin1995(NOST100-1.1)addedarecommendationonthephysicalunitsofheaderkeywordvalues.TheNOSTtechnicalpanelwasconvenedasecondtimetomakefurtherupdatesandclaricationstothestandard,resultingintheNOST100-2.0versionthatwasapprovedbytheIAUFWGin1999andpublishedin2001(Hanischetal.2001).In2005,theIAUFWGformallyapprovedthevariable-lengtharraycon-ventioninbinarytables,andashorttimelaterapprovedsup-portforthe64-bitintegersdatatype.Newversionsofthestan-dardwerereleasedtoreectbothofthesechanges(versionsIAUFWG2.1andIAUFWG2.1b).Mostrecently,theIAUFWGappointeditsowntechnicalpanelinearly2007toconsiderfurthermodicationsandup-datestothestandard.Thechangesproposedbythispanel,whichwereultimatelyapprovedbytheIAUFWGafteraformalpublicreviewprocess,areshowninthis3.0versionofthedocument.Thelatestversionofthestandard,aswellasotherinfor-mationabouttheFITSformat,canbeobtainedfromtheFITSSupportOcewebsiteathttp://fits.gsfc.nasa.gov.ThiswebsitealsocontainsthecontactinformationfortheChairmanoftheIAUFWG,towhomanyquestionsorcommentsregardingthisstandardshouldbeaddressed.1 Table1.SignicantmilestonesinthedevelopmentofFITS. DateMilestoneSection 1979InitialFITSAgreementandrstinterchangeofles1981Publishedoriginal(singleHDU)denition(Wellsetal.1981)1981Publishedrandomgroupsdenition(Greisen&Harten1981)Sect.61982FormallyendorsedbytheIAU(IAU1983)1988Denedrulesformultipleextensions(Grosbøletal.1988)1988IAUFITSWorkingGroup(IAUFWG)established1988ExtendedtoincludeASCIItableextensions(Hartenetal.1988)Sect.7.21988FormalIAUapprovalofASCIItables(IAU1988)Sect.7.21990ExtendedtoincludeIEEEoating-pointdata(Wells&Grosbøl1990)Sect.5.31994ExtendedtomultipleIMAGEarrayextensions(Ponzetal.1994)Sect.7.11995Extendedtobinarytableextensions(Cottonetal.1995)Sect.7.31997Adopted4-digityeardateformat(Bunclark&Rots1997)Sect.4.4.22002Adoptedconventionsforworldcoordinatesystems(Greisen&Calabretta2002)Sect.82002Adoptedconventionsforcelestialcoordinates(Calabretta&Greisen2002)Sect.8.32004AdoptedMIMEtypesforFITSdatales(Allen&Wells2005)App.G2005Extendedtosupportvariable-lengtharraysinbinarytablesSect.7.3.52005Adoptedconventionsforspectralcoordinatesystems(Greisenetal.2006)Sect.8.42005Extendedtoinclude64-bitintegerdatatypeSect.5.2.4 Table2.Versionhistoryofthestandard. VersionDateStatus NOST100-0.11990DecemberFirstDraftStandardNOST100-0.21991JuneSecondRevisedDraftStandardNOST100-0.31991DecemberThirdRevisedDraftStandardNOST100-1.01993JuneNOSTStandardNOST100-1.11995SeptemberNOSTStandardNOST100-2.01999MarchNOSTStandardIAUFWG2.12005AprilIAUFWGStandardIAUFWG2.1b2005DecemberIAUFWGStandardIAUFWG3.02008JulyIAUFWGStandard 1.3.AcknowledgmentsThemembersofthethreetechnicalpanelsthatproducedthisstandardareshownbelow.Firsttechnicalpanel,19901993RobertJ.Hanisch(Chair)SpaceTelescopeScienceInst.LeeE.BrotzmanHughesSTXEdwardKemperHughesSTXBarryM.SchlesingerRaytheonSTXPeterJ.TeubenUniversityofMarylandMichaelE.VanSteenbergNASAGoddardSFCWayneH.WarrenJr.HughesSTXRichardA.WhiteNASAGoddardSFCSecondtechnicalpanel,19941999RobertJ.Hanisch(Chair)SpaceTelescopeScienceInst.AllenFarrisSpaceTelescopeScienceInst.EricW.GreisenNationalRadioAstr.Obs.WilliamD.PenceNASAGoddardSFCBarryM.SchlesingerRaytheonSTXPeterJ.TeubenUniversityofMarylandRandallW.ThompsonComputerSciencesCorp.ArchibaldWarnockA/WWWEnterprisesThirdtechnicalpanel,2007WilliamD.Pence(Chair)NASAGoddardSFCLucioChiappettiIASFMilano,INAF,ItalyCliveG.PageUniversityofLeicester,UKRichardShawNationalOpticalAstr.Obs.ElizabethStobieUniversityofArizona2 2.Denitions,acronyms,andsymbols2.1.ConventionsusedinthisdocumentTermsorletterssetinCourierfontrepresentliteralstringsthatappearinFITSles.Inthecaseofkeywordnames,suchas`NAXISn',thelowercaseletterrepresentsapositiveintegerindexnumber,generallyintherange1to999.Theemphasizedwordsmust,shall,should,may,recommended,andoptionalinthisdocumentaretobeinterpretedasdescribedinIETFstan-dard,RFC2119(Bradner1997).2.2.Denedterms UsedtodesignateanASCIIspacecharacter.ANSIAmericanNationalStandardsInstitute.ArrayAsequenceofdatavalues.Thissequencecorrespondstotheelementsinarectilinear,n-dimensionmatrix(1n999,orn=0inthecaseofanullarray).ArrayvalueThevalueofanelementofanarrayinaFITSle,withouttheapplicationoftheassociatedlineartransforma-tiontoderivethephysicalvalue.ASCIIAmericanNationalStandardCodeforInformationInterchange.ASCIIcharacterAnymemberofthe7-bitASCIIcharacterset.ASCIIdigitOneofthetenASCIIcharacters`0'through`9'whicharerepresentedbydecimalcharactercodes48through57(hexadecimal30through39).ASCIINULLTheASCIIcharacterthathasalleightbitssettozero.ASCIIspaceTheASCIIcharacterforspacewhichisrepre-sentedbydecimal32(hexadecimal20).ASCIItextTherestrictedsetofASCIIcharactersdecimal32through126(hexadecimal20through7E).BasicFITSTheFITSstructureconsistingoftheprimaryheaderfollowedbyasingleprimarydataarray.ThisisalsoknownasSingleImageFITS(SIF),asopposedtoMulti-ExtensionFITS(MEF)lesthatcontainoneormoreexten-sionsfollowingtheprimaryHDU.BigendianThenumericaldataformatusedinFITSlesinwhichthemostsignicantbyteofthevalueisstoredrstfollowedbytheremainingbytesinorderofsignicance.BitAsinglebinarydigit.ByteAnorderedsequenceofeightconsecutivebitstreatedasasingleentity.CardimageAnobsoletetermforan80-characterkeywordrecordderivedfromthe80-columnpunchedcomputercardsthatwereprevalentinthe1960sand1970s.CharacterstringAsequenceofoneormoreoftherestrictedsetofASCIItextcharacters,decimal32through126(hex-adecimal20through7E).ConformingextensionAnextensionwhosekeywordsandor-ganizationadheretotherequirementsforconformingexten-sionsdenedinSect.3.4.1ofthisstandard.DatablockA2880-byteFITSblockcontainingdatadescribedbythekeywordsintheassociatedheaderofthatHDU.DeprecateToexpressdisapprovalof.ThistermisusedtorefertoobsoletestructuresthatshouldnotbeusedinnewFITSlesbutwhichshallremainvalidindenitely.EntryAsinglevalueinanASCIItableorbinarytablestandardextension.ExtensionAFITSHDUappearingaftertheprimaryHDUinaFITSle.ExtensiontypenameThevalueoftheXTENSIONkeyword,usedtoidentifythetypeoftheextension.FieldAcomponentofalargerentity,suchasakeywordrecordorarowofanASCIItableorbinarytablestandardextension.Aeldinatableextensionrowconsistsofasetofzeroormoretableentriescollectivelydescribedbyasingleformat.FileAsequenceofoneormorerecordsterminatedbyanend-of-leindicatorappropriatetothemedium.FITSFlexibleImageTransportSystem.FITSblockAsequenceof28808-bitbytesalignedon2880byteboundariesintheFITSle,mostcommonlyeitheraheaderblockoradatablock.Specialrecordsareanotherin-frequentlyusedtypeofFITSblock.ThisblocklengthwaschosenbecauseitisevenlydivisiblebythebyteandwordlengthsofallknowncomputersystemsatthetimeFITSwasdevelopedin1979.FITSleAlewithaformatthatconformstothespecicationsinthisdocument.FITSstructureOneofthecomponentsofaFITSle:thepri-maryHDU,therandomgroupsrecords,anextension,or,col-lectively,thespecialrecordsfollowingthelastextension.FITSSupportOceTheFITSinformationwebsitethatismaintainedbytheIAUFWGandiscurrentlyhostedathttp://fits.gsfc.nasa.gov.FloatingpointAcomputerrepresentationofarealnumber.FractionTheeldofthemantissa(orsignicand)ofaoating-pointnumberthatliestotherightofitsimpliedbinarypoint.GroupparametervalueThevalueofoneoftheparametersprecedingagroupintherandomgroupsstructure,withouttheapplicationoftheassociatedlineartransformation.HDUHeaderandDataUnit.Adatastructureconsistingofaheaderandthedatatheheaderdescribes.NotethatanHDUmayconsistentirelyofaheaderwithnodatablocks.HeaderAseriesofkeywordrecordsorganizedwithinoneormoreheaderblocksthatdescribesstructuresand/ordatawhichfollowitintheFITSle.HeaderblockA2880-byteFITSblockcontainingasequenceofthirty-six80-characterkeywordrecords.HeapThesupplementaldataareafollowingthemaindatatableinabinarytablestandardextension.IAUInternationalAstronomicalUnion.IAUFWGInternationalAstronomicalUnionFITSWorkingGroup.IEEEInstituteofElectricalandElectronicEngineers.IEEENaNIEEENot-a-Numbervalue;usedtorepresentunde-nedoating-pointvaluesinFITSarraysandbinarytables.IEEEspecialvaluesFloating-pointnumberbytepatternsthathaveaspecial,reservedmeaning,suchas 0,1,underow,overow,denormalized,NaN.(SeeAppendixE).IndexedkeywordAkeywordnamethatisoftheformofaxedrootwithanappendedpositiveintegerindexnumber.KeywordnameThersteightbytesofakeywordrecordwhichcontaintheASCIInameofametadataquantity(unlessitisblank).KeywordrecordAn80-characterrecordinaheaderblockcon-sistingofakeywordnameinthersteightcharactersfol-lowedbyanoptionalvalueindicator,valueandcommentstring.Thekeywordrecordshallbecomposedonlyofthe3 restrictedsetofASCIItextcharactersrangingfromdecimal32to126(hexadecimal20to7E).MandatorykeywordAkeywordthatmustbeusedinallFITSlesorakeywordrequiredinconjunctionwithparticularFITSstructures.MantissaAlsoknownassignicand.ThecomponentofanIEEEoating-pointnumberconsistingofanexplicitorim-plicitleadingbittotheleftofitsimpliedbinarypointandafractioneldtotheright.MEFMulti-ExtensionFITS,i.e.,aFITSlecontainingapri-maryHDUfollowedbyoneormoreextensionHDUs.NOSTNASA/ScienceOceofStandardsandTechnology.PhysicalvalueThevalueinphysicalunitsrepresentedbyanelementofanarrayandpossiblyderivedfromthearrayvalueusingtheassociated,butoptional,lineartransformation.PixelShortfor`Pictureelement';asinglelocationwithinanarray.PrimarydataarrayThedataarraycontainedintheprimaryHDU.PrimaryHDUTherstHDUinaFITSle.PrimaryheaderTherstheaderinaFITSle,containingin-formationontheoverallcontentsofthele(aswellasontheprimarydataarray,ifpresent).RandomGroupAFITSstructureconsistingofacollectionof`groups',whereagroupconsistsofasubarrayofdataandasetofassociatedparametervalues.Randomgroupsaredep-recatedforanyuseotherthanforradiointerferometrydata.RecordAsequenceofbitstreatedasasinglelogicalentity.RepeatcountThenumberofvaluesrepresentedinaeldinabinarytablestandardextension.ReservedkeywordAnoptionalkeywordthatmustbeusedonlyinthemannerdenedinthisstandard.SIFSingleImageFITS,i.e.,aFITSlecontainingonlyapri-maryHDU,withoutanyextensionHDUs.AlsoknownasBasicFITS.SpecialrecordsAseriesofoneormoreFITSblocksfollowingthelastHDUwhoseinternalstructuredoesnototherwiseconformtothatfortheprimaryHDUortothatspeciedforaconformingextensioninthisstandard.Anyuseofspe-cialrecordsrequiresapprovalfromtheIAUFITSWorkingGroup.StandardextensionAconformingextensionwhoseheaderanddatacontentarecompletelyspeciedinSect.7ofthisstan-dard,namely,animageextension,anASCIItableextension,orabinarytableextension.3.FITSleorganization3.1.OveralllestructureAFITSleshallbecomposedofthefollowingFITSstructures,intheorderlisted:Primaryheaderanddataunit(HDU).ConformingExtensions(optional).Otherspecialrecords(optional,restricted).AFITSlecomposedofonlytheprimaryHDUissometimesreferredtoasaBasicFITSle,oraSingleImageFITS(SIF)le,andaFITSlecontainingoneormoreextensionsfollowingtheprimaryHDUissometimesreferredtoasaMulti-ExtensionFITS(MEF)le.EachFITSstructureshallconsistofanintegralnumberofFITSblockswhichareeach2880bytes(23040bits)inlength.TheprimaryHDUshallstartwiththerstFITSblockoftheFITSle.TherstFITSblockofeachsubsequentFITSstruc-tureshallbetheFITSblockimmediatelyfollowingthelastFITSblockoftheprecedingFITSstructure.ThisstandarddoesnotimposealimitonthetotalsizeofaFITSle,noronthesizeofanindividualHDUwithinaFITSle.Softwarepackagesthatreadorwritedataaccordingtothisstandardcouldbelimited,however,inthesizeoflesthataresupported.Inparticular,somesoftwaresystemshavehistoricallyonlysupportedlesupto231bytesinsize(approximately2:1109bytes).3.2.IndividualFITSStructuresTheprimaryHDUandeveryextensionHDUshallconsistofoneormore2880-byteheaderblocksimmediatelyfollowedbyanoptionalsequenceofassociated2880-bytedatablocks.TheheaderblocksshallcontainonlytherestrictedsetofASCIItextcharacters,decimal32through126(hexadecimal20through7E).TheASCIIcontrolcharacterswithdecimalvalueslessthan32(includingthenull,tab,carriagereturn,andlinefeedcharac-ters),andthedeletecharacter(decimal127orhexadecimal7F)mustnotappearanywherewithinaheaderblock.3.3.PrimaryheaderanddataunitTherstcomponentofaFITSleshallbetheprimaryHDUwhichalwayscontainstheprimaryheaderandmaybefollowedbytheprimarydataarray.Iftheprimarydataarrayhaszerolength,asdeterminedbythevaluesoftheNAXISandNAXISnkeywordsintheprimaryheader(Sect.4.4.1),thentheprimaryHDUshallcontainnodatablocks.3.3.1.PrimaryheaderTheheaderofaprimaryHDUshallconsistofoneormoreheaderblocks,eachcontainingaseriesof80-characterkeywordrecordscontainingonlytherestrictedsetofASCIItextcharac-ters.Each2880-byteheaderblockcontains36keywordrecords.ThelastheaderblockmustcontaintheENDkeyword(denedinSect.4.4.1)whichmarksthelogicalendoftheheader.Keywordrecordswithoutinformation(e.g.,followingtheENDkeyword)shallbelledwithASCIIspaces(decimal32orhexadecimal20).3.3.2.PrimarydataarrayTheprimarydataarray,ifpresent,shallconsistofasingledataarraywithfrom1to999dimensions(asspeciedbytheNAXISkeyworddenedinSect.4.4.1).TherandomgroupsconventionintheprimarydataarrayisamorecomplicatedstructureandisdiscussedseparatelyinSect.6.Theentirearrayofdataval-uesarerepresentedbyacontinuousstreamofbitsstartingwiththerstbitoftherstdatablock.Eachdatavalueshallcon-sistofaxednumberofbitsthatisdeterminedbythevalueoftheBITPIXkeyword(Sect.4.4.1).Arraysofmorethanonedi-mensionshallconsistofasequencesuchthattheindexalongaxis1variesmostrapidly,thatalongaxis2nextmostrapidly,andthosealongsubsequentaxesprogressivelylessrapidly,with4 A(1,1,...,1),A(2,1,...,1),:::,A(NAXIS1,1,...,1),A(1,2,...,1),A(2,2,...,1),:::,A(NAXIS1,2,...,1),:::,A(1,NAXIS2,...,NAXISm),:::,A(NAXIS1,NAXIS2,...,NAXISm)Fig.1.Arraysofmorethanonedimensionshallconsistofase-quencesuchthattheindexalongaxis1variesmostrapidlyandthosealongsubsequentaxesprogressivelylessrapidly.thatalongaxism,wheremisthevalueofNAXIS,varyingleastrapidly.Thereisnospaceoranyotherspecialcharacterbetweenthelastvalueonaroworplaneandtherstvalueonthenextroworplaneofamulti-dimensionalarray.Exceptfortheloca-tionoftherstelement,thearraystructureisindependentoftheFITSblockstructure.ThisstorageorderisshownschematicallyinFig.1andisthesameorderasinmulti-dimensionalarraysintheFortranprogramminglanguage(ISO2004).Theindexcountalongeachaxisshallbeginwith1andincrementby1uptothevalueoftheNAXISnkeyword(Sect.4.4.1).Ifthedataarraydoesnotllthenaldatablock,theremain-derofthedatablockshallbelledbysettingallbitstozero.Theindividualdatavaluesshallbestoredinbig-endianbyteor-dersuchthatthebytecontainingthemostsignicantbitsofthevalueappearsrstintheFITSle,followedbytheremainingbytes,ifany,indecreasingorderofsignicance.3.4.Extensions3.4.1.RequirementsforconformingextensionsAllextensions,whetherornotfurtherdescribedinthisstandard,shallfulllthefollowingrequirementstobeinconformancewiththisFITSstandard.Newextensiontypesshouldbecreatedonlywhentheorganizationoftheinformationissuchthatitcan-notbehandledbyoneoftheexistingextensiontypes.AFITSlethatcontainsextensionsiscommonlyreferredtoasamulti-extensionFITS(MEF)le.3.4.1.1.IdentityEachextensiontypeshallhaveauniquetypename,speci-edintheheaderbytheXTENSIONkeyword(Sect.4.4.1).Toprecludeconict,extensiontypenamesmustberegisteredwiththeIAUFWG.ThecurrentlistofregisteredextensionsisgiveninAppendixF.Anup-to-datelistisalsomaintainedontheFITSSupportOcewebsite.3.4.1.2.SizespecicationThetotalnumberofbitsinthedataofeachextensionshallbespeciedintheheaderforthatextension,inthemannerprescribedinSect.4.4.1.3.4.2.StandardextensionsAstandardextensionisaconformingextensionwhoseorgani-zationandcontentarecompletelyspeciedinSect.7ofthisstandard.Onlyoneextensionformatshallbeapprovedforeachtypeofdataorganization.3.4.3.OrderofextensionsAnextensionmayfollowtheprimaryHDUoranotherconform-ingextension.Standardextensionsandotherconformingexten-sionsmayappearinanyorderinaFITSle.3.5.Specialrecords(restricteduse)Specialrecordsare2880-byteFITSblocksfollowingthelastHDUoftheFITSlethathaveanunspeciedstructurethatdoesnotmeettherequirementsofaconformingextension.Therst8bytesofthespecialrecordsmustnotcontainthestring`XTENSION'.Itisrecommendedthattheydonotcontainthestring`SIMPLE '.Thecontentsofspecialrecordsarenototh-erwisespeciedbythisstandard.SpecialrecordswereoriginallydesignedasawayfortheFITSformattoevolvebyallowingnewFITSstructurestobeimplemented.Followingthedevelopmentofconformingexten-sions,whichprovideageneralmechanismforstoringdierenttypesofdatastructuresinFITSformatinawelldenedmanner,theneedforothernewtypesofFITSdatastructureshasbeengreatlyreduced.Consequently,furtheruseofspecialrecordsisrestrictedandrequirestheapprovaloftheIAUFITSWorkingGroup.3.6.Physicalblocking3.6.1.BitstreamdevicesForbitstreamdevices,includingbutnotrestrictedtologicallesystems,FITSlesshallbeinterpretedasasequenceofoneormore2880-byteFITSblocks,regardlessofthephysicalblock-ingstructureoftheunderlyingrecordingmedia.WhenwritingaFITSleonmediawithaphysicalblocksizeunequaltothe2880-byteFITSblocklength,anybytesremaininginthelastphysicalblockfollowingtheendoftheFITSleshouldbesettozero.Similarly,whenreadingFITSlesonsuchmedia,anybytesremaininginthelastphysicalblockfollowingtheendoftheFITSleshallbedisregarded.3.6.2.SequentialmediaTheFITSformatwasoriginallydevelopedforwritinglesonsequentialmagnetictapedevices.Thefollowingrulesonhowtowritetosequentialmedia(Grosbøl&Wells1994)arenowirrelevanttomostcurrentdatastoragedevices.Ifphysicallypossible,FITSlesshallbewrittenonsequen-tialmediainblocksthatarefromonetotenintegermultiplesof2880-bytesinlength.Ifthisisnotpossible,theFITSleshallbewrittenasabitstreamusingthenativeblocksizeofthesequen-5 tialdevice.AnybytesremaininginthelastblockfollowingtheendoftheFITSleshallbesettozero.WhenreadingFITSlesonsequentialmedia,anylesshorterthan2880bytesinlength(e.g.,ANSItapelabels)arenotconsideredpartoftheFITSlesandshouldbedisregarded.3.7.RestrictionsonchangesAnystructurethatisavalidFITSstructureshallremainavalidFITSstructureatallfuturetimes.UseofcertainvalidFITSstruc-turesmaybedeprecatedbythisorfutureFITSstandarddocu-ments.4.HeadersThersttwosectionsofthischapterdenethestructureandcon-tentofheaderkeywordrecords.ThisisfollowedinSect.4.3withrecommendationsonhowphysicalunitsshouldbeexpressed.Thenalsectiondenesthemandatoryandreservedkeywordsforprimaryarraysandconformingextensions.4.1.Keywordrecords4.1.1.SyntaxEach80-characterheaderkeywordrecordshallconsistofakey-wordname,avalueindicator(onlyrequiredifavalueispresent),anoptionalvalue,andanoptionalcomment.Keywordsmayap-pearinanyorderexceptwherespecicallystatedotherwiseinthisstandard.ItisrecommendedthattheorderofthekeywordsinFITSlesbepreservedduringdataprocessingoperationsbecausethedesignersoftheFITSlemayhaveusedconven-tionsthatattachparticularsignicancetotheorderofcertainkeywords(e.g.,bygroupingsequencesofCOMMENTkeywordsatspeciclocationsintheheader,orappendingHISTORYkey-wordsinchronologicalorderofthedataprocessingsteps).Aformalsyntax,givingacompletedenitionofthesyntaxofFITSkeywordrecords,isgiveninAppendixA.Itisintendedasanaidininterpretingthetextdeningthestandard.4.1.2.Components4.1.2.1.Keywordname(bytes1through8)Thekeywordnameshallbealeftjustied,8-character,space-lled,ASCIIstringwithnoembeddedspaces.Alldigits0through9(decimalASCIIcodes48to57,orhexadecimal30to39)anduppercaseLatinalphabeticcharacters`A'through`Z'(decimal65to90orhexadecimal41to5A)arepermitted;lowercasecharactersshallnotbeused.Theunderscore(` ',decimal95orhexadecimal5F)andhyphen(`-',decimal45orhexadecimal2D)arealsopermitted.Noothercharactersarepermitted.1Forindexedkeywordnamesthathaveasinglepositiveintegerindexcounterappendedtotherootname,thecountershallnothaveleadingzeroes(e.g.,NAXIS1,notNAXIS001).Notethatkeywordnamesthatbeginwith(orconsistsolelyof)anycombinationofhyphens,underscores,anddigitsarelegal. 1ThisrequirementdiersfromthewordingintheoriginalFITSpa-pers.SeeAppendixH.4.1.2.2.Valueindicator(bytes9and10)IfthetwoASCIIcharacters`= '(decimal61followedbydecimal32)arepresentinbytes9and10ofthekeywordrecordthisindicatesthatthekeywordhasavalueeldasso-ciatedwithit,unlessitisoneofthecommentarykeywordsdenedinSect.4.4.2(i.e.,aHISTORY,COMMENT,orcompletelyblankkeywordname)whichbydenitionhavenovalue.4.1.2.3.Value/comment(bytes11through80)Inkeywordrecordsthatcontainthevalueindicatorinbytes9and10,theremainingbytes11through80oftherecordshallcontainthevalue,ifany,ofthekeyword,followedbyoptionalcomments.Inkeywordrecordswithoutavalueindicator,bytes9through80shouldbeinterpretedascommentarytext,however,thisdoesnotprecludeconventionsthatinterpretthecontentofthesebytesinotherways.Thevalueeld,whenpresent,shallcontaintheASCIItextrepresentationofaliteralstringconstant,alogicalconstant,oranumericalconstant,intheformatspeciedinSect.4.2.Thevalueeldmaybeanulleld;i.e.,itmayconsistentirelyofspaces,inwhichcasethevalueassociatedwiththekeywordisundened.ThemandatoryFITSkeywordsdenedinthisstandardmustnotappearmorethanoncewithinaheader.Allotherkeywordsthathaveavalueshouldnotappearmorethanonce.Ifakeyworddoesappearmultipletimeswithdierentvalues,thenthevalueisindeterminate.Ifacommentfollowsthevalueeld,itmustbeprecededbyaslash(`/',decimal47orhexadecimal2F).1Aspacebe-tweenthevalueandtheslashisstronglyrecommended.ThecommentmaycontainanyoftherestrictedsetofASCIItextcharacters,decimal32through126(hexadecimal20through7E).TheASCIIcontrolcharacterswithdecimalvalueslessthan32(includingthenull,tab,carriagereturn,andlinefeedcharac-ters),andthedeletecharacter(decimal127orhexadecimal7F)mustnotappearanywherewithinakeywordrecord.4.2.ValueThestructureofthevalueelddependsonthedatatypeofthevalue.Thevalueeldrepresentsasinglevalueandnotanarrayofvalues.1Thevalueeldmustbeinoneoftwoformats:xedorfree.Thexed-formatisrequiredforvaluesofmandatorykeywordsandisrecommendedforvaluesofallotherkeywords.4.2.1.CharacterstringAcharacterstringvalueshallbecomposedonlyofthesetofrestrictedASCIItextcharacters,decimal32through126(hex-adecimal20through7E)enclosedbysinglequotecharacters(',decimal39,hexadecimal27).Asinglequoteisrepresentedwithinastringastwosuccessivesinglequotes,e.g.,O'HARA='O''HARA'.Leadingspacesaresignicant;trailingspacesarenot.Thisstandardimposesnorequirementsonthecasesensi-tivityofcharacterstringvaluesunlessexplicitlystatedinthedenitionofspecickeywords.Ifthevalueisaxed-formatcharacterstring,thestartingsinglequotecharactermustbeinbyte11ofthekeywordrecordandtheclosingsinglequotemustoccurinorbeforebyte80.6 Earlierversionsofthisstandardalsorequiredthatxed-formatcharactersstringsmustbepaddedwithspacecharacterstoatleastalengthofeightcharacterssothattheclosingquotechar-acterdoesnotoccurbeforebyte20.Thisminimumcharacterstringlengthisnolongerrequired,exceptforthevalueoftheXTENSIONkeyword(e.g.,'IMAGE 'and'TABLE ';seeSect.7)whichmustbepaddedtoalengthofeightcharactersforbackwardcompatibilitywithprevioususage.Free-formatcharacterstringsfollowthesamerulesasxed-formatcharacterstringsexceptthatthestartingsinglequotecharactermayoccurafterbyte11.Anybytesprecedingthestart-ingquotecharacterandafterbyte10mustcontainthespacechar-acter.Notethatthereisasubtledistinctionbetweenthefollowingthreekeywords:KEYWORD1=''/nullstringkeywordKEYWORD2=''/emptystringkeywordKEYWORD3=/undefinedkeywordThevalueofKEYWORD1isanull,orzerolengthstringwhereasthevalueoftheKEYWORD2isanemptystring(nominallyasinglespacecharacterbecausetherstspaceinthestringissignicant,buttrailingspacesarenot).ThevalueofKEYWORD3isundenedandhasanindeterminatedatatypeaswell,exceptincaseswherethedatatypeofthespeciedkeywordisexplicitlydenedinthisstandard.Themaximumpossiblelengthofakeywordstringis68char-acters(withtheopeningandclosingquotecharactersinbytes11and80,respectively).Ingeneral,nolengthlimitlessthan68isimpliedforcharacter-valuedkeywords.4.2.2.LogicalIfthevalueisaxed-formatlogicalconstant,itshallappearasanuppercaseTorFinbyte30.Alogicalvalueisrepresentedinfree-formatbyasinglecharacterconsistingofanuppercaseTorFastherstnon-spacecharacterinbytes11through80.4.2.3.IntegernumberIfthevalueisaxed-formatinteger,theASCIIrepresentationshallberight-justiedinbytes11through30.Anintegercon-sistsofa`+'(decimal43orhexadecimal2B)or` '(decimal45orhexadecimal2D)sign,followedbyoneormorecontiguousASCIIdigits(decimal48to57orhexadecimal30to39),withnoembeddedspaces.Theleading`+'signisoptional.Leadingzerosarepermitted,butarenotsignicant.Theintegerrepresen-tationshallalwaysbeinterpretedasasigned,decimalnumber.Thisstandarddoesnotlimittherangeofanintegerkeywordvalue,however,softwarepackagesthatreadorwritedataac-cordingtothisstandardcouldbelimitedintherangeofvaluesthataresupported(e.g.,totherangethatcanberepresentedbya32-bitor64-bitsignedbinaryinteger).Afree-formatintegervaluefollowsthesamerulesasxed-formatintegersexceptthattheASCIIrepresentationmayoccuranywherewithinbytes11through80.4.2.4.Realoating-pointnumberIfthevalueisaxed-formatrealoating-pointnumber,theASCIIrepresentationshallberight-justiedinbytes11through30.Aoating-pointnumberisrepresentedbyadecimalnumberfollowedbyanoptionalexponent,withnoembeddedspaces.Adecimalnumbershallconsistofa`+'(decimal43orhex-adecimal2B)or`'(decimal45orhexadecimal2D)sign,fol-lowedbyasequenceofASCIIdigitscontainingasingledecimalpoint(`.'),representinganintegerpartandafractionalpartoftheoating-pointnumber.Theleading`+'signisoptional.Atleastoneoftheintegerpartorfractionalpartmustbepresent.Ifthefractionalpartispresent,thedecimalpointmustalsobepresent.Ifonlytheintegerpartispresent,thedecimalpointmaybeomitted,inwhichcasetheoating-pointnumberisindistin-guishablefromaninteger.Theexponent,ifpresent,consistsofanexponentletterfollowedbyaninteger.Lettersintheexponen-tialform(`E'or`D')2shallbeuppercase.Thefullprecisionof64-bitvaluescannotbeexpressedoverthewholerangeofvaluesusingthexed-format.Thisstandarddoesnotimposeanupperlimitonthenumberofdigitsofprecision,noranylimitontherangeofoating-pointkeywordvalues.Softwarepackagesthatreadorwritedataaccordingtothisstandardcouldbelimited,however,intherangeofvaluesandexponentsthataresupported(e.g.,totherangethatcanberepresentedbya32-bitor64-bitoating-pointnumber).Afree-formatoating-pointvaluefollowsthesamerulesasaxed-formatoating-pointvalueexceptthattheASCIIrepre-sentationmayoccuranywherewithinbytes11through80.4.2.5.ComplexintegernumberThereisnoxed-formatforcomplexintegernumbers.3Ifthevalueisacomplexintegernumber,thevaluemustberepresentedasarealpartandanimaginarypart,separatedbyacommaandenclosedinparenthesese.g.,(123,45).Spacesmayprecedeandfollowtherealandimaginaryparts.Therealandimaginarypartsarerepresentedinthesamewayasintegers(Sect.4.2.3).Sucharepresentationisregardedasasinglevalueforthecomplexintegernumber.Thisrepresentationmaybelo-catedanywherewithinbytes11through80.4.2.6.Complexoating-pointnumberThereisnoxed-formatforcomplexoating-pointnumbers.3Ifthevalueisacomplexoating-pointnumber,thevaluemustberepresentedasarealpartandanimaginarypart,sepa-ratedbyacommaandenclosedinparentheses,e.g.,(123.23,-45.7).Spacesmayprecedeandfollowtherealandimaginaryparts.Therealandimaginarypartsarerepresentedinthesamewayasoating-pointvalues(Sect.4.2.4).Sucharepresenta-tionisregardedasasinglevalueforthecomplexoating-pointnumber.Thisrepresentationmaybelocatedanywherewithinbytes11through80. 2The`D'exponentformistraditionallyusedwhenrepresentingval-uesthathavemoredecimalsofprecisionoralargermagnitudethancanberepresentedbyasingleprecision32-bitoating-pointnumber,butotherwisethereisnodistinctionbetween`E'or`D'.3ThisrequirementdiersfromthewordingintheoriginalFITSpa-pers.SeeAppendixH.7 Table3.IAU-recommendedbasicunits. QuantityUnitMeaningNotes SIbase&supplementaryunitslengthmmetermasskgkilogramggramallowedtimessecondplaneangleradradiansolidanglesrsteradiantemperatureKkelvinelectriccurrentAampereamountofsubstancemolmoleluminousintensitycdcandelaIAU-recognizedderivedunitsfrequencyHzhertzs