WCS¶
-
class
gwcs.wcs.WCS(forward_transform=None, input_frame=u'detector', output_frame=None, name=u'')[source]¶ Bases:
objectBasic WCS class.
Parameters: forward_transform :
Modelor a listThe transform between
input_frameandoutput_frame. A list of (frame, transform) tuples whereframeis the starting frame andtransformis the transform from this frame to the next one oroutput_frame. The last tuple is (transform, None), where None indicates the end of the pipeline.input_frame : str,
CoordinateFrameA coordinates object or a string name.
output_frame : str,
CoordinateFrameA coordinates object or a string name.
name : str
a name for this WCS
Attributes Summary
available_framesList all frames in this WCS object. backward_transformReturn the total backward transform if available - from output to input coordinate system. domainReturn the range of acceptable values for each input axis. forward_transformReturn the total forward transform - from input to output coordinate frame. input_frameReturn the input coordinate frame. nameReturn the name for this WCS. output_frameReturn the output coordinate frame. pipelineReturn the pipeline structure. unitThe unit of the coordinates in the output coordinate system. Methods Summary
__call__(*args, **kwargs)Executes the forward transform. footprint([domain, center])Return the footprint of the observation in world coordinates. get_transform(from_frame, to_frame)Return a transform between two coordinate frames. insert_transform(frame, transform[, after])Insert a transform before (default) or after a coordinate frame. invert(*args, **kwargs)Invert coordnates. set_transform(from_frame, to_frame, transform)Set/replace the transform between two coordinate frames. transform(from_frame, to_frame, *args, **kwargs)Transform positions between two frames. Attributes Documentation
-
available_frames¶ List all frames in this WCS object.
Returns: available_frames : dict
{frame_name: frame_object or None}
-
backward_transform¶ Return the total backward transform if available - from output to input coordinate system.
Raises: NotImplementedError :
An analytical inverse does not exist.
-
domain¶ Return the range of acceptable values for each input axis.
-
forward_transform¶ Return the total forward transform - from input to output coordinate frame.
-
input_frame¶ Return the input coordinate frame.
-
name¶ Return the name for this WCS.
-
output_frame¶ Return the output coordinate frame.
-
pipeline¶ Return the pipeline structure.
-
unit¶ The unit of the coordinates in the output coordinate system.
Methods Documentation
-
__call__(*args, **kwargs)[source]¶ Executes the forward transform.
- args : float or array-like
- Inputs in the input coordinate system, separate inputs for each dimension.
- output : str
- One of [“numericals”, “numericals_plus”]
If “numericals_plus” - returns a
SkyCoordorQuantityobject.
-
footprint(domain=None, center=True)[source]¶ Return the footprint of the observation in world coordinates.
Parameters: domain : slice or tuple of floats: (start, stop, step) or (start, stop) or (stop,)
size of image
center : bool
If
Trueuse the center of the pixel, otherwise use the corner.Returns: coord : (4, 2) array of (x, y) coordinates.
The order is counter-clockwise starting with the bottom left corner.
-
get_transform(from_frame, to_frame)[source]¶ Return a transform between two coordinate frames.
Parameters: from_frame : str or
CoordinateFrameInitial coordinate frame name of object.
to_frame : str, or instance of
CoordinateFrameEnd coordinate frame name or object.
Returns: transform :
ModelTransform between two frames.
-
insert_transform(frame, transform, after=False)[source]¶ Insert a transform before (default) or after a coordinate frame.
Append (or prepend) a transform to the transform connected to frame.
Parameters: frame : str or
CoordinateFrameCoordinate frame which sets the point of insertion.
transform :
ModelNew transform to be inserted in the pipeline
after : bool
If True, the new transform is inserted in the pipeline immediately after
frame.
-
invert(*args, **kwargs)[source]¶ Invert coordnates.
The analytical inverse of the forward transform is used, if available. If not an iterative method is used.
Parameters: args : float, array like,
SkyCoordorUnitcoordinates to be inverted
kwargs : dict
keyword arguments to be passed to the iterative invert method.
-
set_transform(from_frame, to_frame, transform)[source]¶ Set/replace the transform between two coordinate frames.
Parameters: from_frame : str or
CoordinateFrameInitial coordinate frame.
to_frame : str, or instance of
CoordinateFrameEnd coordinate frame.
transform :
ModelTransform between
from_frameandto_frame.
-
transform(from_frame, to_frame, *args, **kwargs)[source]¶ Transform positions between two frames.
Parameters: from_frame : str or
CoordinateFrameInitial coordinate frame.
to_frame : str, or instance of
CoordinateFrameCoordinate frame into which to transform.
args : float
input coordinates to transform
args : float or array-like
Inputs in
from_frame, separate inputs for each dimension.output : str
One of [“numericals”, “numericals_plus”] If “numericals_plus” - returns a
SkyCoordorQuantityobject.
-