open, memmap=False, **kwargs)[source]

Creates a DataModel from a number of different types

  • init (shape tuple, file path, file object,,) –

    numpy array, dict, None

    • None: A default data model with no shape

    • shape tuple: Initialize with empty data of the given shape

    • file path: Initialize from the given file (FITS , JSON or ASDF)

    • readable file object: Initialize from the given file object

    • Initialize from the given HDUList

    • A numpy array: A new model with the data array initialized to what was passed in.

    • dict: The object model tree for the data model

  • memmap (bool) – Turn memmap of FITS file on or off. (default: False). Ignored for ASDF files.

  • kwargs (dict) –

    Additional keyword arguments passed to lower level functions. These arguments are generally file format-specific. Arguments of note are:

    • FITS

      skip_fits_update - bool or None

      True to skip updating the ASDF tree from the FITS headers, if possible. If None, value will be taken from the environmental SKIP_FITS_UPDATE. Otherwise, the default value is True.



Return type

DataModel instance