panoptes.pocs.scheduler package

Subpackages

Submodules

panoptes.pocs.scheduler.constraint module

class panoptes.pocs.scheduler.constraint.AlreadyVisited(*args, **kwargs)[source]

Bases: BaseConstraint

Simple Already Visited Constraint

A simple already visited constraint that determines if the given observation has already been visited before. If given observation has already been visited then it will not be considered for a call to become the current observation.

get_score(time, observer, observation, **kwargs)[source]
class panoptes.pocs.scheduler.constraint.Altitude(horizon=None, obstructions=None, *args, **kwargs)[source]

Bases: BaseConstraint

Implements altitude constraints for a horizon

get_score(time, observer, observation, **kwargs)[source]
class panoptes.pocs.scheduler.constraint.BaseConstraint(weight=1.0, default_score=0.0, *args, **kwargs)[source]

Bases: PanBase

get_score(time, observer, target, **kwargs)[source]
class panoptes.pocs.scheduler.constraint.Duration(horizon=None, *args, **kwargs)[source]

Bases: BaseConstraint

get_score(time, observer, observation, **kwargs)[source]
class panoptes.pocs.scheduler.constraint.MoonAvoidance(separation=<Quantity 15. deg>, *args, **kwargs)[source]

Bases: BaseConstraint

get_score(time, observer, observation, **kwargs)[source]

panoptes.pocs.scheduler.dispatch module

class panoptes.pocs.scheduler.dispatch.Scheduler(*args, **kwargs)[source]

Bases: BaseScheduler

get_observation(time=None, show_all=False, constraints=None, read_file=False)[source]

Get a valid observation.

Parameters:
  • time (astropy.time.Time, optional) – Time at which scheduler applies, defaults to time called

  • constraints (list of panoptes.pocs.scheduler.constraint.Constraint, optional) – The constraints to check. If None (the default), use the scheduler.constraints.

  • show_all (bool, optional) – Return all valid observations along with merit value, defaults to False to only get top value

  • constraints – The constraints to check. If None (the default), use the scheduler.constraints

  • read_file (bool, optional) – If the fields file should be reread before scheduling occurs, defaults to False.

Returns:

A tuple (or list of tuples) with name and score of ranked observations

Return type:

tuple or list

panoptes.pocs.scheduler.field module

class panoptes.pocs.scheduler.field.Field(name, position, equinox='J2000', *args, **kwargs)[source]

Bases: FixedTarget, PanBase

property field_name

Flattened field name appropriate for paths

classmethod from_altaz(name, alt, az, location, time=None, *args, **kwargs)[source]

Create a Field form AltAz coords, a location, and optional time.

panoptes.pocs.scheduler.scheduler module

class panoptes.pocs.scheduler.scheduler.BaseScheduler(observer, fields_list=None, fields_file=None, constraints=None, *args, **kwargs)[source]

Bases: PanBase

add_observation(observation_config, **kwargs)[source]

Adds an Observation to the scheduler.

Parameters:

observation_config (dict) – Configuration dict for Field and Observation.

clear_available_observations()[source]

Reset the list of available observations

property current_observation

The observation that is currently selected by the scheduler

Upon setting a new observation the seq_time is set to the current time and added to the observed_list. An old observation is reset (so that it can be used again - see ~pocs.scheduelr.observation.reset). If the new observation is the same as the old observation, nothing is done. The new observation can also be set to None to specify there is no current observation.

property fields_file

Field configuration file

A YAML list of config items, specifying a minimum of name and position for the ~pocs.scheduler.field.Field. `Observation`s will be built from the list of fields.

A file will be read by ~pocs.scheduler.priority.read_field_list upon being set.

Note

Setting a new fields_file will clear all existing fields

property fields_list

List of field configuration items

A YAML list of config items, specifying a minimum of name and position for the ~pocs.scheduler.field.Field. `Observation`s will be built from the list of fields.

A file will be read by ~pocs.scheduler.priority.read_field_list upon being set.

Note

Setting a new fields_list will clear all existing fields

abstract get_observation(*args, **kwargs)[source]

Get a valid observation.

property has_valid_observations
observation_available(observation, time)[source]

Check if observation is available at given time

Parameters:
  • observation (pocs.scheduler.observation) – An Observation object

  • time (astropy.time.Time) – The time at which to check observation

property observations

Returns a dict of ~pocs.scheduler.observation.Observation objects with ~pocs.scheduler.observation.Observation.field.field_name as the key

Note

read_field_list is called if list is None

read_field_list()[source]

Reads the field file and creates valid Observations.

remove_observation(field_name)[source]

Removes an Observation from the scheduler

Parameters:

field_name (str) – Field name corresponding to entry key in observations

reset_observed_list()[source]

Reset the observed list

set_common_properties(time)[source]

Sets some properties common to all observations, such as end of night, moon, etc.

property status

Module contents

panoptes.pocs.scheduler.create_constraints_from_config(config=None) List[BaseConstraint][source]
panoptes.pocs.scheduler.create_scheduler_from_config(config=None, observer=None, iers_url=None, *args, **kwargs) BaseScheduler | None[source]

Sets up the scheduler that will be used by the observatory