gwcs.api.NativeAPIMixin¶
- class gwcs.api.NativeAPIMixin¶
Bases:
ABCA mix-in class that is intended to be inherited by the
WCSclass and provides the native GWCS API.
Attributes¶
The input_frame's bounding box |
|
The forward transformation model from the input_frame to the output_frame. |
|
The input coordinate frame. |
|
The output coordinate frame. |
- abstract property NativeAPIMixin.bounding_box: ModelBoundingBox | CompoundBoundingBox | None¶
The input_frame’s bounding box
- abstract property NativeAPIMixin.forward_transform: Model¶
The forward transformation model from the input_frame to the output_frame.
- abstract property NativeAPIMixin.input_frame: CoordinateFrameProtocol¶
The input coordinate frame.
- abstract property NativeAPIMixin.output_frame: CoordinateFrameProtocol¶
The output coordinate frame.
Methods¶
|
Executes the forward transform. |
|
Invert coordinates from output frame to input frame using analytical or user-supplied inverse. |
- abstractmethod NativeAPIMixin.evaluate(*args, with_bounding_box=True, fill_value=nan, **kwargs)¶
Executes the forward transform.
- Parameters:
args (
ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity) – Inputs in the input coordinate system, separate inputs for each dimension.with_bounding_box (
bool, default:True) – If True(default) values in the result which correspond to any of the inputs being outside the bounding_box are set tofill_value.fill_value (
float|number, default:nan) – Output value for inputs outside the bounding_box (default is np.nan).kwargs (dict) – Keyword arguments to be passed to the
forward_transformmodel.
- Return type:
tuple[ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity,...] |ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity
- abstractmethod NativeAPIMixin.invert(*args, with_bounding_box=True, fill_value=nan, **kwargs)¶
Invert coordinates from output frame to input frame using analytical or user-supplied inverse. When neither analytical nor user-supplied inverses are defined, a numerical solution will be attempted using a numerical inverse algorithm.
Note
Currently numerical inverse is implemented only for 2D imaging WCS.
- Parameters:
args (
ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity) – Coordinates to be inverted. The number of arguments must be equal to the number of world coordinates given byworld_n_dim.with_bounding_box (
bool, default:True) – IfTrue(default) values in the result which correspond to any of the inputs being outside the bounding_box are set tofill_value.fill_value (
float|number, default:nan) – Output value for inputs outside the bounding_box (default isnp.nan).kwargs (dict) – Keyword arguments to be passed to the
backward_transformmodel (when defined) or to the iterative invert method.
- Returns:
result – Returns a tuple of scalar or array values for each axis. Unless
input_frame.naxes == 1when it shall return the value. The return type will beQuantityobjects if the transform returnsQuantityobjects, else values.- Return type:
tuple[ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity,...] |ndarray[tuple[int,...],dtype[TypeVar(Dtype, bound=generic)]] |Quantity