Index2D

class sofia_redux.scan.coordinate_systems.index_2d.Index2D(coordinates=None, copy=True)[source]

Bases: Coordinate2D, Index

Initialize 2-dimensional indexing coordinates.

The indexing coordinates are used to represent integer (column, row) indices on a 2-dimensional array. As an extension of the Coordinate2D, x represents columns and y represents rows. Invalid indices are usually represented by an entry of -1.

Parameters:
coordinateslist or tuple or array-like, optional

The coordinates used to populate the object during initialization. The first (0) value or index should represent column coordinates, and the second should represent the rows.

copybool, optional

Whether to explicitly perform a copy operation on the input coordinates when storing them into these coordinates.

Methods Summary

add_x(x)

Add x to coordinates.

add_y(y)

Add y to coordinates.

change_unit(unit)

Change the coordinate units.

rotate_offsets(offsets, angle)

Rotate zero-centered offsets in-place by an angle.

scale_x(factor)

Scale the x coordinates by a factor.

scale_y(factor)

Scale the y coordinates by a factor.

set_x(coordinates[, copy])

Set the x coordinates.

set_y(coordinates[, copy])

Set the y coordinates.

subtract_x(x)

Subtract x from coordinates.

subtract_y(y)

Subtract y from coordinates.

Methods Documentation

add_x(x)[source]

Add x to coordinates.

Parameters:
xfloat or numpy.ndarray

The value(s) to add.

Returns:
None
add_y(y)[source]

Add y to coordinates.

Parameters:
yfloat or numpy.ndarray

The value(s) to add.

Returns:
None
change_unit(unit)[source]

Change the coordinate units.

Parameters:
unitstr or units.Unit
Returns:
None
classmethod rotate_offsets(offsets, angle)[source]

Rotate zero-centered offsets in-place by an angle.

Parameters:
offsetsCoordinate2D or numpy.ndarray or units.Quantity

The (x, y) offset coordinates to rotate.

angleastropy.units.Quantity or float

The angle by which to rotate the offsets.

Returns:
None
scale_x(factor)[source]

Scale the x coordinates by a factor.

Parameters:
factorfloat or units.Quantity

The factor by which to scale the x-coordinates.

Returns:
None
scale_y(factor)[source]

Scale the y coordinates by a factor.

Parameters:
factorfloat

The factor by which to scale the y-coordinates.

Returns:
None
set_x(coordinates, copy=True)[source]

Set the x coordinates.

Parameters:
coordinatesfloat or numpy.ndarray
copybool, optional

If True, copy the coordinates. Otherwise do a reference.

Returns:
None
set_y(coordinates, copy=True)[source]

Set the y coordinates.

Parameters:
coordinatesnumpy.ndarray
copybool, optional

If True, copy the coordinates. Otherwise do a reference.

Returns:
None
subtract_x(x)[source]

Subtract x from coordinates.

Parameters:
xfloat or numpy.ndarray

The value(s) to subtract.

Returns:
None
subtract_y(y)[source]

Subtract y from coordinates.

Parameters:
yfloat or numpy.ndarray or astropy.units.Quantity

The value(s) to subtract.

Returns:
None