{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "No Docstrings"
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/astropy/io/fits/convenience.py",
  "item_line": 0,
  "item_type": "module",
  "aliases": [
    "astropy.io.fits.convenience"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "astropy.io.fits.convenience",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Convenience functions for working with FITS files."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The functions in this module provide shortcuts for some of the most basic operations on FITS files, such as reading and updating the header.  They are included directly in the 'astropy.io.fits' namespace so that they can be used like      "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "astropy.io.fits.getheader(...)",
          "execution_status": null,
          "out": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "These functions are primarily for convenience when working with FITS files in the command-line interpreter.  If performing several operations on the same file, such as in a script, it is better to "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "not"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " use these functions, as each one must open and re-parse the file.  In such cases it is better to use "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "astropy.io.fits.open",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "astropy",
                "version": "*",
                "kind": "api",
                "path": "astropy.io.fits.hdu.hdulist:fitsopen"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and work directly with the "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "astropy.io.fits.HDUList",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "astropy",
                "version": "*",
                "kind": "api",
                "path": "astropy.io.fits.hdu.hdulist:HDUList"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " object and underlying HDU objects."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Several of the convenience functions, such as "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "getheader",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "astropy.io.fits.convenience:getheader"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "getdata",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "astropy.io.fits.convenience:getdata"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " support special arguments for selecting which HDU to use when working with a multi-extension FITS file.  There are a few supported argument formats for selecting the HDU.  See the documentation for "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "getdata",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "astropy.io.fits.convenience:getdata"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for an explanation of all the different formats."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "warning",
          "base_type": "warning",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "warning "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "All arguments to convenience functions other than the filename that are "
                },
                {
                  "__type": "Emphasis",
                  "__tag": 4047,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "not"
                    }
                  ]
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " for selecting the HDU should be passed in as keyword arguments.  This is to avoid ambiguity and conflicts with the HDU arguments.  For example, to set NAXIS=1 on the Primary HDU:"
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Wrong      "
                }
              ]
            },
            {
              "__type": "Code",
              "__tag": 4050,
              "value": "astropy.io.fits.setval('myimage.fits', 'NAXIS', 1)",
              "execution_status": null,
              "out": ""
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "The above example will try to set the NAXIS value on the first extension HDU to blank.  That is, the argument '1' is assumed to specify an HDU."
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Right      "
                }
              ]
            },
            {
              "__type": "Code",
              "__tag": 4050,
              "value": "astropy.io.fits.setval('myimage.fits', 'NAXIS', value=1)",
              "execution_status": null,
              "out": ""
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "This will set the NAXIS keyword to 1 on the primary HDU (the default).  To specify the first extension HDU use      "
                }
              ]
            },
            {
              "__type": "Code",
              "__tag": 4050,
              "value": "astropy.io.fits.setval('myimage.fits', 'NAXIS', value=1, ext=1)",
              "execution_status": null,
              "out": ""
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "This complexity arises out of the attempt to simultaneously support multiple argument formats that were used in past versions of PyFITS. Unfortunately, it is not possible to support all formats without introducing some ambiguity.  A future Astropy release may standardize around a single format and officially deprecate the other formats."
                }
              ]
            }
          ]
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Convenience functions"
        }
      ],
      "level": 0,
      "target": null
    }
  ],
  "local_refs": []
}