nenupy.schedule.schedule.ScheduleBlock

class nenupy.schedule.schedule.ScheduleBlock(name, program, target, constraints, duration, dt, processing_delay, max_extended_duration)[source]

Bases: ObsBlock

__init__(name, program, target, constraints, duration, dt, processing_delay, max_extended_duration)[source]

Methods

__init__(name, program, target, constraints, ...)

evaluate_score(time, sun_elevation, sun_position)

get([operation])

is_within(start, stop)

periodic_observation(start_time, stop_time, ...)

Create duplicates of the observing block periodically spread in time between start_time and stop_time.

plot(**kwargs)

kwargs

reset()

Attributes

constraints

indices

isBooked

kpColor

program

score

size

statusColor

target

title

property constraints
evaluate_score(time, sun_elevation, sun_position)[source]
get(operation=<built-in function eq>, **kwargs)

Example

bb = aa.get(program=’es00’)

property indices
property isBooked
property kpColor
periodic_observation(start_time, stop_time, periodicity, tolerance, repetition_max=None)

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")
    )
plot(**kwargs)[source]
kwargs

figsize nPoints figname

property program
reset()
property score
property size
property statusColor
property target
property title