[docs]classCelestialFrame(CoordinateFrame):""" Representation of a Celesital coordinate system. This class has a native order of longitude then latitude, meaning ``axes_names``, ``unit`` and ``axis_physical_types`` should be lon, lat ordered. If your transform is in a different order this should be specified with ``axes_order``. Parameters ---------- axes_order : tuple of int A dimension in the input data that corresponds to this axis. reference_frame : astropy.coordinates.builtin_frames A reference frame. unit : str or units.Unit instance or iterable of those Units on axes. axes_names : list Names of the axes in this frame. name : str Name of this frame. axis_physical_types : list The UCD 1+ physical types for the axes, in frame order (lon, lat). """def__init__(self,axes_order=None,reference_frame=None,unit=None,axes_names=None,name=None,axis_physical_types=None,):if(reference_frameisnotNoneandnotisinstance(reference_frame,str)andreference_frame.name.upper()inSTANDARD_REFERENCE_FRAMES):_axes_names=list(reference_frame.representation_component_names.values())if"distance"in_axes_names:_axes_names.remove("distance")ifaxes_namesisNone:axes_names=_axes_namesnaxes=len(axes_names)ifaxes_namesisnotNoneelse2self.native_axes_order=tuple(range(naxes))ifaxes_orderisNone:axes_order=self.native_axes_orderifunitisNone:unit=tuple([u.degree]*naxes)axes_type=["SPATIAL"]*naxespht=axis_physical_typesorself._default_axis_physical_types(reference_frame,axes_names)super().__init__(naxes=naxes,axes_type=axes_type,axes_order=axes_order,reference_frame=reference_frame,unit=unit,axes_names=axes_names,name=name,axis_physical_types=pht,)def_default_axis_physical_types(self,reference_frame,axes_names):ifisinstance(reference_frame,coord.Galactic):return"pos.galactic.lon","pos.galactic.lat"ifisinstance(reference_frame,coord.GeocentricTrueEcliptic|coord.GCRS|coord.PrecessedGeocentric,):return"pos.bodyrc.lon","pos.bodyrc.lat"ifisinstance(reference_frame,coord.builtin_frames.BaseRADecFrame):return"pos.eq.ra","pos.eq.dec"ifisinstance(reference_frame,coord.builtin_frames.BaseEclipticFrame):return"pos.ecliptic.lon","pos.ecliptic.lat"returntuple(f"custom:{t}"fortinaxes_names)@propertydefworld_axis_object_classes(self):return{"celestial":(coord.SkyCoord,(),{"frame":self.reference_frame,"unit":self._prop.unit},)}@propertydef_native_world_axis_object_components(self):return[("celestial",0,lambdasc:sc.spherical.lon.to_value(self._prop.unit[0])),("celestial",1,lambdasc:sc.spherical.lat.to_value(self._prop.unit[1])),]