[docs]classStep:""" Represents a ``step`` in the WCS pipeline. Parameters ---------- frame : `~gwcs.coordinate_frames.CoordinateFrame` A gwcs coordinate frame object. transform : `~astropy.modeling.Model` or None A transform from this step's frame to next step's frame. The transform of the last step should be `None`. """def__init__(self,frame:str|CoordinateFrame|None,transform=None):# Allow for a string to be passed in for the frame but be turned into a# frame objectself.frame=(frameifisinstance(frame,CoordinateFrame)elseEmptyFrame(name=frame))self.transform=transform@propertydefframe(self):returnself._frame@frame.setterdefframe(self,val):ifnotisinstance(val,CoordinateFrame|str):msg='"frame" should be an instance of CoordinateFrame or a string.'raiseTypeError(msg)self._frame=val@propertydeftransform(self):returnself._transform@transform.setterdeftransform(self,val):ifvalisnotNoneandnotisinstance(val,(Model)):msg='"transform" should be an instance of astropy.modeling.Model.'raiseTypeError(msg)self._transform=val@propertydefframe_name(self):ifisinstance(self.frame,str):returnself.framereturnself.frame.namedef__getitem__(self,ind):warnings.warn("Indexing a WCS.pipeline step is deprecated. ""Use the `frame` and `transform` attributes instead.",DeprecationWarning,stacklevel=2,)ifindnotin(0,1):msg="Allowed inices are 0 (frame) and 1 (transform)."raiseIndexError(msg)ifind==0:returnself.framereturnself.transformdef__str__(self):return(f"{self.frame_name}\t "f"{getattr(self.transform,'name','None')ortype(self.transform).__name__}"# noqa: E501)def__repr__(self):return(f"Step(frame={self.frame_name}, "f"transform={getattr(self.transform,'name','None')ortype(self.transform).__name__})"# noqa: E501)