# Licensed under a 3-clause BSD style license - see LICENSE.rstfromastropyimportunitsasufrom._coreimportCoordinateFrame__all__=["Frame2D"]
[docs]classFrame2D(CoordinateFrame):""" A 2D coordinate frame. Parameters ---------- axes_order : tuple of int A dimension in the input data that corresponds to this axis. unit : list of astropy.units.Unit Unit for each axis. axes_names : list Names of the axes in this frame. name : str Name of this frame. """def__init__(self,axes_order=(0,1),unit=(u.pix,u.pix),axes_names=("x","y"),name=None,axes_type=None,axis_physical_types=None,):ifaxes_typeisNone:axes_type=["SPATIAL","SPATIAL"]pht=axis_physical_typesorself._default_axis_physical_types(axes_names,axes_type)super().__init__(naxes=2,axes_type=axes_type,axes_order=axes_order,name=name,axes_names=axes_names,unit=unit,axis_physical_types=pht,)def_default_axis_physical_types(self,axes_names,axes_type):ifaxes_namesisnotNoneandall(axes_names):ph_type=axes_nameselse:ph_type=axes_typereturntuple(f"custom:{t}"fortinph_type)