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: Block

Class 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.

  • target (ESTarget or SSTarget) – The celestial target.

  • 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.

__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_time and stop_time.

reset()

Attributes

constraints

kpColor

program

size

target

title

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_time and stop_time. This methods adds to the ObsBlock’s constraints a new TimeRangeCnst. Each copied block is then constrained to occur at \(t_0 + n \times \Delta t \pm \delta t\) (where \(t_0\) is start_time, \(\Delta t\) is periodicity and \(\delta t\) is the tolerance).

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 reaching stop_time.

Returns:

The observations blocks.

Return type:

Block

Warning

The original ObsBlock cannot already contain an instance of TimeRangeCnst. 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