nenupy.schedule.obsblocks.ObsBlock
- class nenupy.schedule.obsblocks.ObsBlock(name, program, target, constraints=None, duration=<TimeDelta object: scale='None' format='sec' value=3600.0>, processing_delay=None, max_extended_duration=None)[source]
Bases:
BlockClass to handle observation blocks.
- Parameters:
name (
str) – The name of the observation, for further reference.program (
str) – The NenuFAR scientific program to which this observation belongs.constraints (
Constraints) – The observing constraints to apply.duration (
TimeDelta) – The requested duration of the observation.processing_delay (
TimeDelta) – Time delay needed after the observation for the processing to take place. Only :class:`~nenupy.schedule.obsblocks.ObsBlock`s with this parameter set are compared with each other while computing the scheduling. This parameter particularly suits the imaging data.max_extended_duration (
TimeDelta) – Once the observation block is booked. The duration of the scheduled observation will be extended up to this value. The duration extension will cease if the resulting scheduled score ever decreases or if another scheduled observation is reached.
See also
- __init__(name, program, target, constraints=None, duration=<TimeDelta object: scale='None' format='sec' value=3600.0>, processing_delay=None, max_extended_duration=None)[source]
Methods
__init__(name, program, target[, ...])get([operation])periodic_observation(start_time, stop_time, ...)Create duplicates of the observing block periodically spread in time between
start_timeandstop_time.reset()Attributes
- property constraints
- get(operation=<built-in function eq>, **kwargs)
Example
bb = aa.get(program=’es00’)
- property kpColor
- periodic_observation(start_time, stop_time, periodicity, tolerance, repetition_max=None)[source]
Create duplicates of the observing block periodically spread in time between
start_timeandstop_time. This methods adds to theObsBlock’s constraints a newTimeRangeCnst. Each copied block is then constrained to occur at \(t_0 + n \times \Delta t \pm \delta t\) (where \(t_0\) isstart_time, \(\Delta t\) isperiodicityand \(\delta t\) is thetolerance).- Parameters:
start_time (
Time) – The start time of the duplication period.stop_time (
Time) – The stop time of the duplication period.periodicity (
TimeDelta) – The time periodicity at which the time block is repeated.tolerance (
TimeDelta) – The tolerance in time duration with respect to a strict repetition. The higher the tolerance, the easier the block will be scheduled. Keep also in mind that if the tolerance is too small and the starting time poorly chosen, the target may never be observed (for instance the allowed time range may not match when the target is above the horizon).repetition_max (int, optional) – Maximum number of repetitions. Default is
None, i.e. the the repetitions are going on until reachingstop_time.
- Returns:
The observations blocks.
- Return type:
Block
Warning
The original
ObsBlockcannot already contain an instance ofTimeRangeCnst. An error is raised in this case.Examples
>>> from nenupy.schedule import ObsBlock, ESTarget >>> from astropy.time import Time, TimeDelta >>> crab = ObsBlock( name="Crab", program="LT03", target=ESTarget.fromName("Crab"), duration=TimeDelta(3600, format="sec") ) >>> crab_blocks = crab.periodic_observation( start_time=Time("2025-06-01 00:00:00"), stop_time=Time("2025-12-01 00:00:00"), periodicity=TimeDelta(28, format="jd"), tolerance=TimeDelta(3, format="jd") )
- property program
- reset()
- property size
- property target
- property title