ObservationPlan
- class ctapointing.observation.ObservationPlan(**kwargs: Any)
Bases:
ComponentObservation planning for pointing observations.
Attributes Summary
observation plan file
name of ObservationPlan
UUID of ObservationPlan
Methods Summary
add_target(target_name, target_pos, ...)Add a new target at the end of the observation plan.
close()from_config(**kwargs)Read an observation plan configuration from either configuration file or database.
Return observation plan as a QTable.
is_compatible(file_path)read(filename[, file_format])Load an observation plan from file (to which it was previously written using ObservationPlan.write()).
Schedule according to a set of AltAz coordinates
schedule_isotropic(num_targets, start_time, ...)Schedule an isotropic observation plan, i.e. aim at selecting targets such that isotropy on the (half-)sky is reached.
write([filename, file_format, overwrite])Write observation schedule to file.
Attributes Documentation
- input_url
observation plan file
- is_stream
- name
name of ObservationPlan
- uuid
UUID of ObservationPlan
Methods Documentation
- add_target(target_name, target_pos, start_time, duration)
Add a new target at the end of the observation plan.
- Parameters:
name (str) – target name
target_pos (astropy.SkyCoord) – target position (ICRS or AltAz frame)
start_time (astropy.Time) – start time of observation
duration (astropy.Quantity) – duration of the observation
- close()
- classmethod from_config(**kwargs)
Read an observation plan configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.
- Parameters:
input_url (str or pathlib.Path) – path of the configuration file.
name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.
uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.
collection (str) – name of the database collection from which configuration is read
database (str) – name of the database in which the collection is stored
- Returns:
plan
- Return type:
ObservationPlan object
- get_schedule()
Return observation plan as a QTable.
- Return type:
astropy.table.QTable
- static is_compatible(file_path)
- read(filename: str, file_format: str = 'hdf5')
Load an observation plan from file (to which it was previously written using ObservationPlan.write()).
- Parameters:
filename (str or Path) – filename from which to read the observation plan.
file_format (str) – file format according to astropy specifications (default: “auto”)
- schedule_coordinates_altaz(target_position_altaz, duration)
Schedule according to a set of AltAz coordinates
- schedule_isotropic(num_targets: int, start_time: ~astropy.time.core.Time, location: ~ctapointing.config.traits.AstroEarthLocation, duration: ~astropy.units.quantity.Quantity = <Quantity 10. s>, time_between_targets: ~astropy.units.quantity.Quantity = <Quantity 120. s>, altitude_limits: (<class 'astropy.units.quantity.Quantity'>, <class 'astropy.units.quantity.Quantity'>) = (<Quantity 10. deg>, <Quantity 70. deg>), magnitude_limits: (<class 'float'>, <class 'float'>) = (-3.0, 4.0))
Schedule an isotropic observation plan, i.e. aim at selecting targets such that isotropy on the (half-)sky is reached.
- Parameters:
num_targets (int) – number of targets to schedule
start_time (astropy.time.Time or str) – start time of the observations
location (AstroEarthLocation) – earth location of observer
duration (astropy.units.Quantity) – duration of each exposure
time_between_targets (astropy.units.Quantity) – time between the targets
altitude_limits (tuple of astropy.units.Quantity) – altitude lower and upper limit
magnitude_limits (tuple of float) – magnitude range for star selection
- schedule_polaris()
- write(filename: str | None = None, file_format: str = 'hdf5', overwrite: bool = False)
Write observation schedule to file.
The observation plan is converted to an astropy.tables.QTable. The file format can be chosen from those available within astropy.tables
- Parameters:
filename (str or Path) – filename to which observation plan is written
file_format (str or Path) – file format, according to astropy specifications
overwrite (bool) – force overwrite of already existing file if True
- Returns:
filename – filename of output file
- Return type:
str
- __init__(config=None, parent=None, **kwargs)
Class to create and store observation plans.
- add_target(target_name, target_pos, start_time, duration)
Add a new target at the end of the observation plan.
- Parameters:
name (str) – target name
target_pos (astropy.SkyCoord) – target position (ICRS or AltAz frame)
start_time (astropy.Time) – start time of observation
duration (astropy.Quantity) – duration of the observation
- classmethod from_config(**kwargs)
Read an observation plan configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.
- Parameters:
input_url (str or pathlib.Path) – path of the configuration file.
name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.
uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.
collection (str) – name of the database collection from which configuration is read
database (str) – name of the database in which the collection is stored
- Returns:
plan
- Return type:
ObservationPlan object
- get_schedule()
Return observation plan as a QTable.
- Return type:
astropy.table.QTable
- input_url
observation plan file
- name
name of ObservationPlan
- read(filename: str, file_format: str = 'hdf5')
Load an observation plan from file (to which it was previously written using ObservationPlan.write()).
- Parameters:
filename (str or Path) – filename from which to read the observation plan.
file_format (str) – file format according to astropy specifications (default: “auto”)
- schedule_coordinates_altaz(target_position_altaz, duration)
Schedule according to a set of AltAz coordinates
- schedule_isotropic(num_targets: int, start_time: ~astropy.time.core.Time, location: ~ctapointing.config.traits.AstroEarthLocation, duration: ~astropy.units.quantity.Quantity = <Quantity 10. s>, time_between_targets: ~astropy.units.quantity.Quantity = <Quantity 120. s>, altitude_limits: (<class 'astropy.units.quantity.Quantity'>, <class 'astropy.units.quantity.Quantity'>) = (<Quantity 10. deg>, <Quantity 70. deg>), magnitude_limits: (<class 'float'>, <class 'float'>) = (-3.0, 4.0))
Schedule an isotropic observation plan, i.e. aim at selecting targets such that isotropy on the (half-)sky is reached.
- Parameters:
num_targets (int) – number of targets to schedule
start_time (astropy.time.Time or str) – start time of the observations
location (AstroEarthLocation) – earth location of observer
duration (astropy.units.Quantity) – duration of each exposure
time_between_targets (astropy.units.Quantity) – time between the targets
altitude_limits (tuple of astropy.units.Quantity) – altitude lower and upper limit
magnitude_limits (tuple of float) – magnitude range for star selection
- uuid
UUID of ObservationPlan
- write(filename: str | None = None, file_format: str = 'hdf5', overwrite: bool = False)
Write observation schedule to file.
The observation plan is converted to an astropy.tables.QTable. The file format can be chosen from those available within astropy.tables
- Parameters:
filename (str or Path) – filename to which observation plan is written
file_format (str or Path) – file format, according to astropy specifications
overwrite (bool) – force overwrite of already existing file if True
- Returns:
filename – filename of output file
- Return type:
str