Observer#

class tilepy.include.PointingTools.Observer(longitude, latitude, elevation, run_duration, minimal_run_duration, max_sun_altitude, max_moon_altitude, max_moon_phase)[source] [edit on github]#

Bases: object

Class to store information and handle operation related to the observatory used for the observations.

Initialize an Observer instance.

Parameters:
  • longitude (float) – Longitude of the observatory (degrees).

  • latitude (float) – Latitude of the observatory (degrees).

  • elevation (float) – Elevation of the observatory (meters).

  • run_duration (datetime.timedelta) – Duration of each observing run.

  • minimal_run_duration (datetime.timedelta) – Minimum duration for an observing run.

  • max_sun_altitude (float) – Maximum allowed altitude of the Sun (degrees).

  • max_moon_altitude (float) – Maximum allowed altitude of the Moon (degrees).

  • max_moon_phase (float) – Maximum allowed Moon phase (illumination fraction).

Methods Summary

compute_interval_intersection(time_range_1, ...)

Compute the intersection of two time ranges.

compute_run_start_time(valid_time_range)

Compute the start times for each run within a valid time range.

get_moon_constraint_time_interval(...)

Get the time interval for the moon constraint.

get_moon_phase(observation_time)

Get the moon phase at a given observation time.

get_risings_and_settings(celestial_body, ...)

Get the rise and set times of a celestial body within a given time range.

get_sun_constraint_time_interval(start_time, ...)

Get the time interval for the sun constraint.

get_time_window(start_time, nb_observation_night)

Calculate the time window for observations.

Methods Documentation

compute_interval_intersection(time_range_1, time_range_2)[source] [edit on github]#

Compute the intersection of two time ranges.

Parameters:
  • time_range_1 (list) – The first time range.

  • time_range_2 (list) – The second time range.

Returns:

The intersection of the two time ranges.

Return type:

list

compute_run_start_time(valid_time_range)[source] [edit on github]#

Compute the start times for each run within a valid time range.

Parameters:

valid_time_range (list) – The valid time range.

Returns:

The start times for each run.

Return type:

list

get_moon_constraint_time_interval(start_time, stop_time)[source] [edit on github]#

Get the time interval for the moon constraint.

Parameters:
  • start_time (datetime.datetime) – The start time of observations.

  • stop_time (datetime.datetime) – The stop time of observations.

Returns:

The time interval for the moon constraint.

Return type:

list

get_moon_phase(observation_time)[source] [edit on github]#

Get the moon phase at a given observation time.

Parameters:

observation_time (datetime.datetime) – The time of observation.

Returns:

The moon phase at the given observation time.

Return type:

float

get_risings_and_settings(celestial_body, horizon, start_time, stop_time)[source] [edit on github]#

Get the rise and set times of a celestial body within a given time range.

Parameters:
  • celestial_body (str) – The celestial body.

  • horizon (float) – The horizon to consider as risen or set (degrees).

  • start_time (datetime.datetime) – The start time.

  • stop_time (datetime.datetime) – The stop time.

Returns:

  • list of datetime.datetime – The rise times of the celestial body.

  • list of datetime.datetime – The set times of the celestial body.

get_sun_constraint_time_interval(start_time, stop_time, nb_observation_night)[source] [edit on github]#

Get the time interval for the sun constraint.

Parameters:
  • start_time (datetime.datetime) – The start time of observations.

  • stop_time (datetime.datetime) – The stop time of observations.

  • nb_observation_night (int) – The number of observation nights.

Returns:

The time interval for the sun constraint.

Return type:

list

get_time_window(start_time, nb_observation_night)[source] [edit on github]#

Calculate the time window for observations.

Parameters:
  • start_time (datetime.datetime) – Earliest time to start observations. If no timezone is provided, UTC is assumed.

  • nb_observation_night (int) – Number of observation nights.

Returns:

The start times for each run within the valid time range.

Return type:

list of datetime.datetime