nenupy.schedule.constraints

Observation constraints classes

In the following, an instance of ESTarget is initialized for the source Cygnus A and stored in the variable target. The method computePosition() is called to compute all astronomical properties at the location of NenuFAR for the time-range times.

>>> from astropy.time import Time, TimeDelta
>>> import numpy as np
>>> from nenupy.schedule import ESTarget

>>> dt = TimeDelta(3600, format='sec')
>>> times = Time('2021-01-01 00:00:00') + np.arange(24)*dt

>>> target = ESTarget.fromName('Cas A')
>>> target.computePosition(times)

See also

ESTarget or ESTarget objects are described in TARGETS in more details.

Single constraint

There are several constraints that could be defined. The simplest and probably most basic one is the ‘elevation constraint’ (embedded in the ElevationCnst class) since observing at \(e > 0^\circ\) is a necessary requirement for a ground-based observatory. Once the constraint has been evaluated on target, a normalized ‘score’ is returned and can be plotted using the plot() method.

>>> from nenupy.schedule import ElevationCnst

>>> c = ElevationCnst()
>>> score = c(target)
>>> c.plot()
../_images/elevconstraint_casa0deg.png

If the required elevation to perform a good-quality observation needs to be greater than a given value, it could be specified to the elevationMin attribute.

>>> c = ElevationCnst(elevationMin=40)
>>> score = c(target)
>>> c.plot()
../_images/elevconstraint_casa40deg.png

The ElevationCnst’s score is now at \(0\) whenever the target elevation is lower than elevationMin.

Multiple constraints

Several constraints are often needed to select an appropriate time window for a given observation. The Constraints class is by default initialized with ElevationCnst(elevationMin=0), but any other constraint may be passed as arguments:

>>> from nenupy.schedule import (
        ESTarget,
        Constraints,
        ElevationCnst,
        MeridianTransitCnst,
        LocalTimeCnst
    )
>>> from astropy.time import Time, TimeDelta
>>> from astropy.coordinates import SkyCoord, Angle

>>> dts = np.arange(24+1)*TimeDelta(3600, format='sec')
>>> times = Time('2021-01-01 00:00:00') + dts
>>> target = ESTarget.fromName('Cas A')
>>> target.computePosition(times)

>>> cnst = Constraints(
        ElevationCnst(elevationMin=20, weight=3),
        MeridianTransitCnst(),
        LocalTimeCnst(Angle(12, 'hour'), Angle(4, 'hour'))
    )

>>> cnst.evaluate(target, times)

>>> cnst.plot()
../_images/sch_constraints.png
Inheritance diagram of nenupy.schedule.constraints

Classes

AzimuthCnst(azimuth[, weight])

Constraint([weight])

Base class for all the constraint definitions.

Constraints(*constraints)

ElevationCnst([elevationMin, ...])

Elevation constraint

LocalSiderealTimeCnst(lst[, ...])

LocalTimeCnst(hMin, hMax[, weight])

MeridianTransitCnst([weight])

Meridian Transit constraint

NightTimeCnst([sun_elevation_max, ...])

PeriodicCnst(start_time, periodicity, tolerance)

Constraint to force a block to be scheduled within periodical time intervals in the schedule.

ScheduleConstraint(weight)

Base class for constraints involving time range checks.

SolarProximityCnst([closer, ...])

TargetConstraint(weight)

Base class for constraints involving target property checks.

TimeRangeCnst(time_min, time_max[, weight])

UTCHourCnst(h_min, h_max[, weight])

Contraint to force an observation block to be scheduled between two fixed UTC hours.