Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# `is_observable` is a temporary function which will eventually be a method of
# something to support caching
# Times in TimeRange can be passed in as strings, will be passed to the
# Time constructor.
constraint_list = [TimeRange("2015-05-01 18:30", "2015-05-02 05:30"),
AirmassRange(1.2), AltitudeRange(15.0*u.deg, 89.0*u.deg)]
# (AboveAirmass will be a subclass of AltitudeWindow)
# Combine a list of constraints to run on Observer, FixedTarget, and time to
# determine the observability of target
constraints = is_observable(constraint_list, obs, t1, time_obs)
# Test only a single constraint:
constraints = is_observable(AirmassRange(1.2), obs, t1, time_obs)
# AirmassRange can accept two bounding airmasses, assumes single argument is
# an upper limit, lower limit = 1.
# `constraints` will be a boolean where True=observable. For a list of
# targets, observatories, or times, `constraints` may be a booleans array
# We will eventually need a more complicated method that minimizes a cost
# function when optimizing an observing schedule given the results of
# `is_observable`.
# ======================================================
# Other useful calculations wrt an observer and a target
#=======================================================
# calculate the distance in alt and az degrees between two targets at
# first we define the conditions
from astroplan import TimeRange, AltitudeRange, AirmassRange, is_observable
# `is_observable` is a temporary function which will eventually be a method of
# something to support caching
# Times in TimeRange can be passed in as strings, will be passed to the
# Time constructor.
constraint_list = [TimeRange("2015-05-01 18:30", "2015-05-02 05:30"),
AirmassRange(1.2), AltitudeRange(15.0*u.deg, 89.0*u.deg)]
# (AboveAirmass will be a subclass of AltitudeWindow)
# Combine a list of constraints to run on Observer, FixedTarget, and time to
# determine the observability of target
constraints = is_observable(constraint_list, obs, t1, time_obs)
# Test only a single constraint:
constraints = is_observable(AirmassRange(1.2), obs, t1, time_obs)
# AirmassRange can accept two bounding airmasses, assumes single argument is
# an upper limit, lower limit = 1.
# `constraints` will be a boolean where True=observable. For a list of
# targets, observatories, or times, `constraints` may be a booleans array
# We will eventually need a more complicated method that minimizes a cost
# function when optimizing an observing schedule given the results of
# `is_observable`.
# ======================================================
# Other useful calculations wrt an observer and a target