Package ivs :: Package observations :: Module visibility
[hide private]
[frames] | no frames]

Module visibility

source code

This module allows to calculate the altitude and airmass of an object in the sky, to determine whether it is 'observable' during day or night time, and to get the separation to the moon.

Examples:

Plot the visibility of an object for 10 days, every 10 minutes.

>>> eph = Ephemeris()
>>> eph.set_objects(objects=['HD50230'])
>>> eph.set_date(startdate='2011/09/27 12:00:00.0',dt=10.,days=10)
>>> eph.set_site(sitename='lapalma')
>>> eph.visibility()
>>> eph.plot(fmt='bo')

]]include figure]]severalnightsvisibility.png]

You can get the same behaviour in less commands:

>>> eph = Ephemeris(objects=['HD50230'],startdate='2011/09/27 12:00:00.0',dt=10.,days=10,sitename='lapalma')
>>> eph.visibility()

Or, equivalently,

>>> eph = Ephemeris()
>>> eph.visibility(objects=['HD50230'],startdate='2011/09/27 12:00:00.0',dt=10.,days=10)

Get the visibility of 2 objects and the moon only for a certain date:

>>> eph = Ephemeris(objects=['HD163506','HD143454'])
>>> eph.visibility(startdate=2456084.01922,days=1,sitename='palomar')
>>> eph.plot(moon=True,lw=2)

]]include figure]]nightvisibility.png]

One can also get the visibility of an object in a random capital at the middle of the night throughout the year:

>>> eph = Ephemeris(objects=['V* V441 Her'])
>>> eph.visibility(midnight=True,sitename='Paris')
>>> eph.plot(moon=False)

]]include figure]]yearvisibility.png]

Calculate visibility for a list of objects, sites and times:

>>> eph = Ephemeris()
>>> days = np.array([2456084.0,2456085.02,2456085.29,2456085.55,2456095.6321])
>>> objectnames = np.array(['HD163506','HD163506','HD163506','HD143454','HD143454'])
>>> sitenames = np.array(['lapalma','lapalma','palomar','palomar','lapalma'])
>>> eph.visibility(multiple=True,startdate=days,objects=objectnames,sitename=sitenames)
>>> eph.plot(moon=True)

]]include figure]]multiple1.png]

Note that only the last point is plotted, this is because the other given times correspond to day time. This can be deduced from the color ordering of the day (yellow) and night (grey) which are plotted nevertheless. Mixing sites can result in ugly plots quite rapidly. So we can also just keep the site fixed (also works for the objects and times):

>>> eph = Ephemeris()
>>> days = np.array([2456084.73,2456085.58,2456085.69,2456085.74,2456095.8321,2456132.978])
>>> objectnames = np.array(['HD163506','HD163506','HD163506','HD143454','HD143454','HD163506'])
>>> eph.visibility(multiple=True,startdate=days,objects=objectnames,sitename='palomar')
>>> eph.plot(moon=True)

]]include figure]]multiple2.png]

Note that in this case, the last point is not plotted although the color coding says it corresponds to night time. Logically, this is because the object is simply below the horizon.

Classes [hide private]
  Ephemeris
Variables [hide private]
  logger = logging.getLogger("OBS.VIS")