How to use the astroplan.is_observable function in astroplan

To help you get started, we’ve selected a few astroplan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github astropy / astroplan / dev / planning-example.py View on Github external
# `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
github astropy / astroplan / dev / planning-example.py View on Github external
# 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