ScheduledDowntimeData

class rubin_sim.site_models.ScheduledDowntimeData(start_time, scheduled_downtime_db=None, start_of_night_offset=-0.34)

Bases: object

Read the scheduled downtime data.

This class deals with the scheduled downtime information that was previously produced for OpSim version 3.

Parameters:
start_timeastropy.time.Time

The time of the start of the simulation. The cloud database will be assumed to start on Jan 01 of the same year.

cloud_dbstr, optional

The full path name for the cloud database. Default None, which will use the database stored in the module ($SIMS_CLOUDMODEL_DIR/data/cloud.db).

start_of_night_offsetfloat, optional

The fraction of a day to offset from MJD.0 to reach the defined start of a night (‘noon’ works). Default 0.16 (UTC midnight in Chile) - 0.5 (minus half a day) = -0.34

Methods Summary

__call__()

Return the current (if any) and any future scheduled downtimes.

read_data()

Read the scheduled downtime information from disk and translate to astropy.time.Times.

total_downtime()

Return total downtime (in days).

Methods Documentation

__call__()

Return the current (if any) and any future scheduled downtimes.

Parameters:
timeastropy.time.Time

Time in the simulation for which to find the current downtime.

Returns:
downtimenp.ndarray

The array of all unscheduled downtimes, with keys for ‘start’, ‘end’, ‘activity’, corresponding to astropy.time.Time, astropy.time.Time, and str.

read_data()

Read the scheduled downtime information from disk and translate to astropy.time.Times.

This function gets the appropriate database file and creates the set of scheduled downtimes from it. The default behavior is to use the module stored database. However, an alternate database file can be provided. The alternate database file needs to have a table called Downtime with the following columns:

nightint

The night (from start of simulation) the downtime occurs.

durationint

The duration (units=days) of the downtime.

activitystr

A description of the activity involved.

total_downtime()

Return total downtime (in days).

Returns:
totalint

Total number of downtime days.