across.tools.visibility.constraints

Submodules

Attributes

AllConstraint

Constraint

Classes

AirmassConstraint

Constraint based on airmass (zenith angle) for ground-based telescopes.

AltAzConstraint

For a given Alt/Az constraint, is a given coordinate inside this

BrightStarConstraint

Constraint that avoids observing too close to bright stars.

DaytimeConstraint

Constraint that avoids daytime observations based on twilight definitions.

EarthLimbConstraint

For a given Earth limb avoidance angle, is a given coordinate inside this

EclipticLatitudeConstraint

Constraint that avoids observing at low ecliptic latitudes.

GalacticBulgeConstraint

Constraint that avoids observing too close to the Galactic Bulge.

GalacticPlaneConstraint

Constraint that avoids observing too close to the Galactic Plane.

AndConstraint

Combines two or more constraints with AND logic.

NotConstraint

Negates a constraint with NOT logic.

OrConstraint

Combines two or more constraints with OR logic.

XorConstraint

Combines two or more constraints with XOR (exclusive OR) logic.

MoonAngleConstraint

For a given Moon avoidance angle, is a given coordinate inside this

PointingConstraint

Footprint based pointing constraint. A Pointing is defined

SAAPolygonConstraint

Polygon based SAA constraint. The SAA is defined by a Shapely Polygon, and

SolarSystemConstraint

Constraint that avoids observing too close to bright Solar System objects.

SunAngleConstraint

For a given Sun avoidance angle, is a given coordinate inside this

Functions

get_slice(time, ephemeris)

Return a slice for what the part of the ephemeris that we're using.

Package Contents

class AirmassConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint based on airmass (zenith angle) for ground-based telescopes.

Airmass affects the quality of astronomical observations. Higher airmass means more atmospheric absorption and poorer image quality. This constraint ensures observations are conducted at acceptable airmass values.

Parameters:

max_air_mass (float) – Maximum allowed airmass. Observations with higher airmass will be constrained. Typical values: 1.5-2.0 for good quality, up to 3.0 for some surveys.

__call__(time, ephemeris, coordinate)[source]

Checks if the airmass is too high for the given coordinate and time.

name: Literal[across.tools.core.enums.ConstraintType.AIRMASS]
short_name: Literal['Airmass'] = 'Airmass'
max_air_mass: float = None
__call__(time, ephemeris, coordinate)[source]

Check if the airmass is too high for observation.

Parameters:
  • time (Time) – The time of observation.

  • ephemeris (Ephemeris) – The ephemeris (used to get Earth location).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the airmass is too high (constraint violated).

Return type:

npt.NDArray[np.bool_]

class AltAzConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.polygon.PolygonConstraint

For a given Alt/Az constraint, is a given coordinate inside this constraint? Constraint is both defined by a polygon exclusion region and a minimum and maximum altitude. By default the minimum and maximum altitude values are 0 and 90 degrees respectively. Polygon restriction regions can be combined with minimum and maximum altitude restrictions.

Parameters:
  • polygon – The polygon defining the exclusion region.

  • min – The minimum altitude in degrees.

  • max – The maximum altitude in degrees.

short_name: str = 'AltAz'
name: Literal[across.tools.core.enums.constraint_type.ConstraintType.ALT_AZ]
polygon: shapely.Polygon | None = None
altitude_min: float | None = None
altitude_max: float | None = None
azimuth_min: float | None = None
azimuth_max: float | None = None
__call__(time, ephemeris, coordinate)[source]

Calculate the Alt/Az constraint for a given time, ephemeris, and sky coordinates.

Parameters:
  • time (Time) – The time for which to calculate the constraint.

  • ephemeris (Ephemeris) – The ephemeris containing the Earth location.

  • coordinate (SkyCoord) – The sky coordinates to calculate the constraint for.

Returns:

The calculated constraint values as a NumPy array.

Return type:

np.ndarray

get_slice(time, ephemeris)[source]

Return a slice for what the part of the ephemeris that we’re using.

Parameters:
  • time (Time) – The time to calculate the slice for

  • ephemeris (Ephemeris) – The spacecraft ephemeris

Return type:

The slice for the ephemeris

class BrightStarConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids observing too close to bright stars.

Bright stars can cause detector saturation, blooming, or scattered light issues. This constraint ensures observations are conducted at sufficient angular distance from bright stars.

Parameters:
  • min_separation (float) – Minimum angular separation (degrees) required from bright stars. Observations closer than this to bright stars will be constrained.

  • magnitude_limit (float) – Magnitude limit for bright stars to avoid. Stars brighter than this magnitude will be considered for avoidance. Default is 6.0 (naked eye visible).

__call__(time, ephemeris, coordinate)[source]

Checks if the coordinate is too close to any bright star.

name: Literal[across.tools.core.enums.ConstraintType.BRIGHT_STAR]
short_name: Literal['Bright Star'] = 'Bright Star'
min_separation: float = None
magnitude_limit: float = None
__call__(time, ephemeris, coordinate)[source]

Check if the coordinate is too close to any bright star.

Parameters:
  • time (Time) – The time (not used for star positions).

  • ephemeris (Ephemeris) – The ephemeris (not used for star positions).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the coordinate violates the constraint (is too close to a bright star).

Return type:

npt.NDArray[np.bool_]

class DaytimeConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids daytime observations based on twilight definitions.

For ground-based telescopes, daytime is defined by the Sun’s position relative to the horizon. Different twilight types provide different levels of darkness.

For space-based telescopes, daytime refers to periods when the spacecraft is in direct sunlight (requires appropriate ephemeris data).

The telescope type (ground vs space) is automatically detected based on the ephemeris type: GroundEphemeris for ground-based, all others for space-based.

Parameters:

twilight_type (TwilightType) – The type of twilight to use for defining daytime boundaries. - ‘astronomical’: Sun 12-18° below horizon (default) - ‘nautical’: Sun 6-12° below horizon - ‘civil’: Sun 0-6° below horizon - ‘day’: Sun above horizon

__call__(time, ephemeris, coordinate)[source]

Checks if the observation time qualifies as daytime for the given constraints.

name: Literal[across.tools.core.enums.ConstraintType.DAYTIME]
short_name: Literal['Daytime'] = 'Daytime'
twilight_type: across.tools.core.enums.TwilightType = None
__call__(time, ephemeris, coordinate)[source]

Check if the observation time is during daytime.

Parameters:
  • time (Time) – The time of observation.

  • ephemeris (Ephemeris) – The ephemeris (used for Earth location and potentially sunlight data).

  • coordinate (SkyCoord) – The coordinate (not used for daytime calculations).

Returns:

Boolean array where True indicates daytime (constraint violated).

Return type:

npt.NDArray[np.bool_]

_check_ground_daytime(time, ephemeris)[source]

Check daytime for ground-based telescopes using Sun altitude.

_check_space_daytime(time, ephemeris)[source]

Check daytime for space-based telescopes using proper eclipse calculations.

Determines if the spacecraft is in direct sunlight by calculating whether the Earth is blocking the line of sight to the Sun, accounting for the finite sizes of both Earth and Sun.

class EarthLimbConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

For a given Earth limb avoidance angle, is a given coordinate inside this constraint?

Parameters:
  • name – The name of the constraint.

  • short_name – The short name of the constraint.

  • min_angle – The minimum angle from the Earth limb that the spacecraft can point.

__call__(coord, ephemeris, earth_radius_angle=None)[source]

Checks if a given coordinate is inside the constraint.

name: Literal[across.tools.core.enums.ConstraintType.EARTH]
short_name: Literal['Earth'] = 'Earth'
min_angle: float | None = None
max_angle: float | None = None
__call__(time, ephemeris, coordinate)[source]

Check for a given time, ephemeris and coordinate if positions given are inside the Earth limb constraint. This is done by checking if the separation between the Earth and the spacecraft is less than the Earth’s angular radius plus the minimum angle.

NOTE: Assumes a circular approximation for Earth.

Parameters:
  • coordinate (SkyCoord) – The coordinate to check.

  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

Returns:

True if the coordinate is inside the constraint, False otherwise.

Return type:

bool

class EclipticLatitudeConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids observing at low ecliptic latitudes.

The ecliptic plane contains zodiacal dust that scatters sunlight, creating zodiacal light that can contaminate observations. This constraint ensures observations are conducted at sufficient ecliptic latitude to avoid this background light.

Parameters:

min_latitude (float) – Minimum ecliptic latitude (degrees) required for observation. Observations closer to the ecliptic plane than this will be constrained.

__call__(time, ephemeris, coordinate)[source]

Checks if the coordinate is too close to the ecliptic plane.

name: Literal[across.tools.core.enums.ConstraintType.ECLIPTIC_LATITUDE]
short_name: Literal['Ecliptic Latitude'] = 'Ecliptic Latitude'
min_latitude: float = None
__call__(time, ephemeris, coordinate)[source]

Check if the coordinate is too close to the ecliptic plane.

Parameters:
  • time (Time) – The time (not used for ecliptic coordinates).

  • ephemeris (Ephemeris) – The ephemeris (not used for ecliptic coordinates).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the coordinate violates the constraint (is too close to the ecliptic plane).

Return type:

npt.NDArray[np.bool_]

class GalacticBulgeConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids observing too close to the Galactic Bulge.

The Galactic Bulge is a crowded region with extremely high stellar density, making it difficult to observe individual sources. This constraint ensures observations avoid this region.

Parameters:

min_separation (float) – Minimum angular separation (degrees) required from the Galactic Bulge. Observations closer than this will be constrained.

__call__(time, ephemeris, coordinate)[source]

Checks if the coordinate is too close to the Galactic Bulge.

name: Literal[across.tools.core.enums.ConstraintType.GALACTIC_BULGE]
short_name: Literal['Galactic Bulge'] = 'Galactic Bulge'
min_separation: float = None
__call__(time, ephemeris, coordinate)[source]

Check if the coordinate is too close to the Galactic Bulge.

Parameters:
  • time (Time) – The time (not used for galactic coordinates).

  • ephemeris (Ephemeris) – The ephemeris (not used for galactic coordinates).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the coordinate violates the constraint (is too close to the Galactic Bulge).

Return type:

npt.NDArray[np.bool_]

class GalacticPlaneConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids observing too close to the Galactic Plane.

The Galactic Plane contains high densities of stars and dust, making it difficult to observe faint sources. This constraint ensures observations are conducted at sufficient latitude from the galactic equator.

Parameters:

min_latitude (float) – Minimum galactic latitude (degrees) required for observation. Observations closer to the galactic plane than this will be constrained.

__call__(time, ephemeris, coordinate)[source]

Checks if the coordinate is too close to the galactic plane.

name: Literal[across.tools.core.enums.ConstraintType.GALACTIC_PLANE]
short_name: Literal['Galactic Plane'] = 'Galactic Plane'
min_latitude: float = None
__call__(time, ephemeris, coordinate)[source]

Check if the coordinate is too close to the galactic plane.

Parameters:
  • time (Time) – The time (not used for galactic coordinates).

  • ephemeris (Ephemeris) – The ephemeris (not used for galactic coordinates).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the coordinate violates the constraint (is too close to the galactic plane).

Return type:

npt.NDArray[np.bool_]

class AndConstraint(/, **data)[source]

Bases: ConstraintCoercionMixin, across.tools.visibility.constraints.base.ConstraintABC

Combines two or more constraints with AND logic.

Since constraints represent when a target is NOT visible, this constraint is violated only if ALL constituent constraints are violated. This is rarely used in practice since typical visibility calculations combine constraints with OR logic instead. Use AND only when you need ALL specified blocking conditions to occur simultaneously (e.g., both Sun AND Moon must be blocking the target).

The constraints are stored as ConstraintABC instances internally but are serialized as part of the Constraint discriminated union for JSON serialization/deserialization.

Parameters:

constraints (list[ConstraintABC]) – List of constraints to combine with AND logic. All constraints must be violated for the combined constraint to be violated.

Examples

Create an AND constraint using the & operator (rarely used):

>>> from across.tools.visibility.constraints import (
...     SunAngleConstraint, MoonAngleConstraint, EarthLimbConstraint
... )
>>> sun = SunAngleConstraint(min_angle=45)
>>> moon = MoonAngleConstraint(min_angle=10)
>>> earth = EarthLimbConstraint(min_angle=33)
>>> # Target not visible only when BOTH Sun AND Moon AND Earth all block it
>>> combined = sun & moon & earth

Notes

For typical visibility calculations, use OR logic (|) instead of AND. The | operator combines constraints so that ANY constraint violation blocks visibility, which is the standard behavior for combining multiple visibility constraints.

name: Literal[across.tools.core.enums.ConstraintType.AND]
short_name: Literal['And'] = 'And'
constraints: list[across.tools.visibility.constraints.base.ConstraintABC]
__call__(time, ephemeris, coordinate)[source]

Evaluate AND constraint: returns True only if all sub-constraints are True.

Parameters:
  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates constraint is violated.

Return type:

npt.NDArray[np.bool_]

class NotConstraint(/, **data)[source]

Bases: ConstraintCoercionMixin, across.tools.visibility.constraints.base.ConstraintABC

Negates a constraint with NOT logic.

Since constraints represent when a target is NOT visible, negating a constraint means it is violated when the original constraint is NOT violated. This is useful for expressing “target must be in this region” constraints, which act as visibility constraints (blocking observations outside that region).

The constraint is stored as a ConstraintABC instance internally but is serialized as part of the Constraint discriminated union for JSON serialization/deserialization.

Parameters:

constraint (ConstraintABC) – The constraint to negate. Can be an atomic constraint or another logical constraint.

Examples

Create a NOT constraint using the ~ operator:

>>> from across.tools.visibility.constraints import EarthLimbConstraint
>>> earth = EarthLimbConstraint(min_angle=33)
>>> # Violated when target is NOT >33° above Earth's limb
>>> # (i.e., target must stay <33° above limb)
>>> not_earth = ~earth

Complex example with combination:

>>> from across.tools.visibility.constraints import SunAngleConstraint
>>> sun = SunAngleConstraint(min_angle=45)
>>> # Target must be >45° from Sun OR must be <33° above Earth limb
>>> complex_constraint = sun | ~earth

Notes

NOT logic is rarely used in typical visibility calculations. It’s primarily useful for inverting specific constraints to express regional requirements.

name: Literal[across.tools.core.enums.ConstraintType.NOT]
short_name: Literal['Not'] = 'Not'
constraint: across.tools.visibility.constraints.base.ConstraintABC
__call__(time, ephemeris, coordinate)[source]

Evaluate NOT constraint: returns the negation of the sub-constraint.

Parameters:
  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates constraint is violated.

Return type:

npt.NDArray[np.bool_]

class OrConstraint(/, **data)[source]

Bases: ConstraintCoercionMixin, across.tools.visibility.constraints.base.ConstraintABC

Combines two or more constraints with OR logic.

Since constraints represent when a target is NOT visible, this constraint is violated if ANY constituent constraint is violated. This is the typical and recommended way to combine multiple visibility constraints: the target is NOT visible if ANY of the constraints block it (Sun OR Moon OR Earth blocking, etc.).

The constraints are stored as ConstraintABC instances internally but are serialized as part of the Constraint discriminated union for JSON serialization/deserialization.

Parameters:

constraints (list[ConstraintABC]) – List of constraints to combine with OR logic. If any constraint is violated, the combined constraint is violated.

Examples

Create an OR constraint using the | operator (recommended for typical use):

>>> from across.tools.visibility.constraints import (
...     SunAngleConstraint, MoonAngleConstraint
... )
>>> sun = SunAngleConstraint(min_angle=45)
>>> moon = MoonAngleConstraint(min_angle=10)
>>> # Target not visible if Sun OR Moon blocks it
>>> combined = sun | moon

More complex example with three constraints:

>>> from across.tools.visibility.constraints import EarthLimbConstraint
>>> earth = EarthLimbConstraint(min_angle=33)
>>> # Target not visible if ANY constraint blocks it
>>> all_constraints = sun | moon | earth

Notes

OR logic is the standard way to combine constraints. Use this when you want observations blocked if ANY of the specified conditions are violated.

name: Literal[across.tools.core.enums.ConstraintType.OR]
short_name: Literal['Or'] = 'Or'
constraints: list[across.tools.visibility.constraints.base.ConstraintABC]
__call__(time, ephemeris, coordinate)[source]

Evaluate OR constraint: returns True if any sub-constraint is True.

Parameters:
  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates constraint is violated.

Return type:

npt.NDArray[np.bool_]

class XorConstraint(/, **data)[source]

Bases: ConstraintCoercionMixin, across.tools.visibility.constraints.base.ConstraintABC

Combines two or more constraints with XOR (exclusive OR) logic.

Since constraints represent when a target is NOT visible, this constraint is violated when an odd number of constituent constraints are violated. For two constraints, it’s violated when exactly one is violated but not when both are violated or neither is violated. This is useful for expressing “either A or B but not both” logic.

The constraints are stored as ConstraintABC instances internally but are serialized as part of the Constraint discriminated union for JSON serialization/deserialization.

Parameters:

constraints (list[ConstraintABC]) – List of constraints to combine with XOR logic. The combined constraint is violated when an odd number of constituent constraints are violated.

Examples

Create an XOR constraint using the ^ operator:

>>> from across.tools.visibility.constraints import (
...     SunAngleConstraint, MoonAngleConstraint
... )
>>> sun = SunAngleConstraint(min_angle=45)
>>> moon = MoonAngleConstraint(min_angle=10)
>>> # Target not visible if exactly one (but not both) blocks it
>>> combined = sun ^ moon

More complex example with three constraints:

>>> from across.tools.visibility.constraints import EarthLimbConstraint
>>> earth = EarthLimbConstraint(min_angle=33)
>>> # Violated when odd number of constraints are violated
>>> all_constraints = sun ^ moon ^ earth

Notes

XOR logic is rarely used in typical visibility calculations but can be useful for specific edge cases where you need exclusive conditions.

name: Literal[across.tools.core.enums.ConstraintType.XOR]
short_name: Literal['Xor'] = 'Xor'
constraints: list[across.tools.visibility.constraints.base.ConstraintABC]
__call__(time, ephemeris, coordinate)[source]

Evaluate XOR constraint: returns True when odd number of sub-constraints are True.

Parameters:
  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates constraint is violated.

Return type:

npt.NDArray[np.bool_]

class MoonAngleConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

For a given Moon avoidance angle, is a given coordinate inside this constraint?

Parameters:

min_angle – The minimum angle from the Moon that the spacecraft can point.

__call__(coord, ephemeris, moon_radius_angle=None)[source]

Checks if a given coordinate is inside the constraint.

name: Literal[across.tools.core.enums.ConstraintType.MOON]
short_name: Literal['Moon'] = 'Moon'
min_angle: float | None = None
max_angle: float | None = None
__call__(time, ephemeris, coordinate)[source]

Check for a given time, ephemeris and coordinate if positions given are inside the Moon constraint. This is done by checking if the separation between the Moon and the spacecraft is less than the Moon’s angular radius plus the minimum angle.

Parameters:
  • coordinate (SkyCoord) – The coordinate to check.

  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

Returns:

True if the coordinate is inside the constraint, False otherwise.

Return type:

bool

class PointingConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Footprint based pointing constraint. A Pointing is defined as a Footprint with a start and end time. This constraint will calculate whether a target was within any set of pointings.

pointings

List of Pointing objects.

start_time

AstropyDateTime defining the start of the pointing

end_time

AstropyDateTime defining the end of the pointing

pointings: list[across.tools.footprint.Pointing]
name: Literal[across.tools.core.enums.constraint_type.ConstraintType.POINTING]
short_name: Literal['Pointing'] = 'Pointing'
__call__(time, ephemeris, coordinate)[source]

Evaluate the constraint at the given time(s) and coordinate.

Parameters:
  • time (Time) – The time(s) at which to evaluate the constraint.

  • coordinate (SkyCoord) – The sky coordinates to check against the constraint.

  • ephemeris (Ephemeris) – The ephemeris position(s) at which to evaluate the constraint. This parameter is not used in this specific constraint but is included for compatibility with the base class.

Returns:

A boolean array indicating whether the constraint is satisfied at the given time(s) and position(s). If time is scalar, returns a single boolean value. The constraint is satisfied if the coordinate is outside the footprint, OR if the time is outside the start and end time.

Return type:

ndarray

class SAAPolygonConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.polygon.PolygonConstraint

Polygon based SAA constraint. The SAA is defined by a Shapely Polygon, and this constraint will calculate for a given set of times and a given ephemeris whether the spacecraft is in that SAA polygon.

polygon

Shapely Polygon object defining the SAA polygon.

polygon: shapely.Polygon | None = None
name: Literal[across.tools.core.enums.constraint_type.ConstraintType.SAA]
short_name: str = 'SAA'
__call__(time, ephemeris, coordinate)[source]

Evaluate the constraint at the given time(s) and ephemeris position(s).

Parameters:
  • time (Time) – The time(s) at which to evaluate the constraint.

  • ephemeris (Ephemeris) – The ephemeris position(s) at which to evaluate the constraint.

  • coordinate (SkyCoord) – The sky coordinates to check against the constraint. This parameter is not used in this specific constraint but is included for compatibility with the base class.

Returns:

A boolean array indicating whether the constraint is satisfied at the given time(s) and position(s). If time is scalar, returns a single boolean value.

Return type:

ndarray

class SolarSystemConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

Constraint that avoids observing too close to bright Solar System objects.

Planets and other bright Solar System objects can contaminate observations or cause detector issues. This constraint ensures observations avoid these objects by maintaining sufficient angular separation.

Parameters:
  • min_separation (float) – Minimum angular separation (degrees) required from Solar System objects. Observations closer than this will be constrained.

  • bodies (list[str]) – List of Solar System bodies to avoid. Defaults to major planets. Options include: ‘mercury’, ‘venus’, ‘mars’, ‘jupiter’, ‘saturn’, ‘uranus’, ‘neptune’.

__call__(time, ephemeris, coordinate)[source]

Checks if the coordinate is too close to any Solar System object.

name: Literal[across.tools.core.enums.ConstraintType.SOLAR_SYSTEM]
short_name: Literal['Solar System'] = 'Solar System'
min_separation: float = None
max_magnitude: float = None
bodies: list[across.tools.core.enums.SolarSystemObject | str] = None
classmethod validate_bodies(v)[source]

Validate that bodies is a list of SolarSystemObject or strings that match SolarSystemObject enum (case insensitive).

_calculate_body_magnitude(body_name, body_coord, ephemeris, i)[source]

Calculate the apparent magnitude of a solar system body.

Parameters:
  • body_name (SolarSystemObject | str) – Name of the body (‘moon’, ‘venus’, etc.)

  • body_coord (SkyCoord) – Position of the body

  • ephemeris (Ephemeris) – Ephemeris data

  • i (slice) – Slice for the time array

Returns:

Apparent magnitude of the body

Return type:

npt.NDArray[np.float64]

__call__(time, ephemeris, coordinate)[source]

Check if the coordinate is too close to any Solar System object.

Parameters:
  • time (Time) – The time of observation.

  • ephemeris (Ephemeris) – The ephemeris (used to get Earth location for body positions).

  • coordinate (SkyCoord) – The coordinate to check.

Returns:

Boolean array where True indicates the coordinate violates the constraint (is too close to a Solar System object).

Return type:

npt.NDArray[np.bool_]

class SunAngleConstraint(/, **data)[source]

Bases: across.tools.visibility.constraints.base.ConstraintABC

For a given Sun avoidance angle, is a given coordinate inside this constraint?

Parameters:
  • min_angle – The minimum angle from the Sun that the spacecraft can point.

  • max_angle – The maximum angle from the Sun that the spacecraft can point.

__call__(coord, ephemeris, sun_radius_angle=None)[source]

Checks if a given coordinate is inside the constraint.

name: Literal[across.tools.core.enums.ConstraintType.SUN]
short_name: Literal['Sun'] = 'Sun'
min_angle: float | None = None
max_angle: float | None = None
__call__(time, ephemeris, coordinate)[source]

Check for a given time, ephemeris and coordinate if positions given are inside the Sun constraint. This is done by checking if the separation between the Sun and the spacecraft is less than the a given minimum angle or greater than a maximum angle (essentially an anti-Sun constraint).

Parameters:
  • coordinate (SkyCoord) – The coordinate to check.

  • time (Time) – The time to check.

  • ephemeris (Ephemeris) – The ephemeris object.

Returns:

True if the coordinate is inside the constraint, False otherwise.

Return type:

bool

AllConstraint[source]
Constraint[source]