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)
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()
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()
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()

Classes
|
|
|
Base class for all the constraint definitions. |
|
|
|
Elevation constraint |
|
|
|
|
|
Meridian Transit constraint |
|
|
|
Constraint to force a block to be scheduled within periodical time intervals in the schedule. |
|
Base class for constraints involving time range checks. |
|
|
|
Base class for constraints involving target property checks. |
|
|
|
Contraint to force an observation block to be scheduled between two fixed UTC hours. |