PrecessingCoordinates

class sofia_redux.scan.coordinate_systems.precessing_coordinates.PrecessingCoordinates(coordinates=None, unit='degree', copy=True, epoch=<sofia_redux.scan.coordinate_systems.epoch.epoch.JulianEpoch object>)[source]

Bases: CelestialCoordinates

Initialize a PrecessingCoordinates object.

The precessing coordinates extend celestial coordinates by adding an epoch (time) to the coordinate set. In addition to the functionality provided by celestial coordinates, the coordinate set may be precessed to a new epoch if desired.

Parameters:
coordinateslist or tuple or array-like or units.Quantity, optional

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

unitunits.Unit or str, optional

The angular unit for the spherical coordinates. The default is ‘degree’.

copybool, optional

Whether to explicitly perform a copy operation on the input coordinates when storing them into these coordinates. Note that it is extremely unlikely for the original coordinates to be passed in as a reference due to the significant checks performed on them.

epochEpoch or str or int or float or Time or fits.Header, optional

Information from which to set the epoch for these coordinates.

Attributes Summary

empty_copy_skip_attributes

Return attributes that are set to None on an empty copy.

Methods Summary

convert(from_coordinates, to_coordinates)

Convert one type of coordinates to another.

copy()

Return a copy of the PrecessingCoordinates.

copy_coordinates(coordinates)

Copy the contents of another coordinate system.

edit_header(header, key_stem[, alt])

Edit the header with precessing coordinate information.

empty_copy()

Return an unpopulated instance of the coordinates.

get_indices(indices)

Return selected data for given indices.

insert_blanks(insert_indices)

Insert blank (NaN) values at the requested indices.

merge(other)

Append other coordinates to the end of these.

parse_header(header, key_stem[, alt, default])

Set the coordinate from the header.

paste(other, indices)

Paste new coordinate values at the given indices.

precess(new_epoch)

Precess the coordinates to a new epoch.

precess_to_epoch(new_epoch)

Precess from one epoch to another.

precession_required(epoch1, epoch2)

Determine if precession is required when converting between epochs.

set_epoch(epoch)

Set the epoch for the precessing coordinates.

Attributes Documentation

empty_copy_skip_attributes

Return attributes that are set to None on an empty copy.

Returns:
attributesset (str)

Methods Documentation

convert(from_coordinates, to_coordinates)[source]

Convert one type of coordinates to another.

The to_coordinates will be updated in-place.

Parameters:
from_coordinatesCelestialCoordinates or PrecessingCoordinates
to_coordinatesCelestialCoordinates or PrecessingCoordinates
Returns:
None
copy()[source]

Return a copy of the PrecessingCoordinates.

Returns:
PrecessingCoordinates
copy_coordinates(coordinates)[source]

Copy the contents of another coordinate system.

Parameters:
coordinatesSphericalCoordinates
Returns:
None
edit_header(header, key_stem, alt='')[source]

Edit the header with precessing coordinate information.

Parameters:
headerastropy.io.fits.header.Header

The header to modify.

key_stemstr

The name of the header key to update.

altstr, optional

The alternative coordinate system.

Returns:
None
empty_copy()[source]

Return an unpopulated instance of the coordinates.

Returns:
PrecessingCoordinates
get_indices(indices)[source]

Return selected data for given indices.

Parameters:
indicesslice or list or int or numpy.ndarray (int)

The indices to extract.

Returns:
FlaggedData
insert_blanks(insert_indices)[source]

Insert blank (NaN) values at the requested indices.

Follows the logic of numpy.insert().

Parameters:
insert_indicesnumpy.ndarray (int)
Returns:
None
merge(other)[source]

Append other coordinates to the end of these.

The other coordinates will be precessed to this epoch if possible. If this epoch contains more than one equinox, no precession is performed and the final equinox will contain those of the other equinox, expanded and appended as necessary.

Parameters:
otherPrecessingCoordinates
Returns:
None
parse_header(header, key_stem, alt='', default=None)[source]

Set the coordinate from the header.

Parameters:
headerastropy.io.fits.header.Header

The FITS header to read.

key_stemstr
altstr, optional

The alternate coordinate system.

defaultastropy.units.Quantity (numpy.ndarray)

The (x, y) default coordinate.

Returns:
None
paste(other, indices)[source]

Paste new coordinate values at the given indices.

Parameters:
otherPrecessingCoordinates
indicesnumpy.ndarray (int)
Returns:
None
precess(new_epoch)[source]

Precess the coordinates to a new epoch.

Parameters:
new_epochEpoch
Returns:
None
abstract precess_to_epoch(new_epoch)[source]

Precess from one epoch to another.

Parameters:
new_epochEpoch
Returns:
None
static precession_required(epoch1, epoch2)[source]

Determine if precession is required when converting between epochs.

Parameters:
epoch1Epoch or None

The epoch to convert from.

epoch2Epoch or None

The epoch to convert to.

Returns:
precess, epoch1, epoch2bool, Epoch, Epoch

Whether precession is required, and the epochs to convert between.

set_epoch(epoch)[source]

Set the epoch for the precessing coordinates.

Parameters:
epochEpoch or str or int or float or Time or fits.Header
Returns:
None