Transit/eclipse prediction charts

Contents:


Routines to make a chart of upcoming transit events. The main function to call is transitChart(), which has an example in its documentation. A fully automated chart-maker can be found in makeCharts()

REQUIREMENTS:

PyEphem – http://rhodesmill.org/pyephem/

Numpy – http://numpy.org/

Numerical analysis routines – For importing planet-class objects.

SEE ALSO:

http://var2.astro.cz/EN/tresca/index.php

TO-DO LIST:

Print uncertainties in ephemeris when they’re sufficiently large

2010-10-11 23:06 IJC: Updated with La Palma location.

2010-03-23 09:37 IJC: Written by IJC to duplicate Josh Winn’s page @ MIT.

2011-08-09 13:21 IJMC: Copied over jd2gd() and gd2jd().

2011-09-30 11:01 IJMC: Added moon separation.


transittime.gd2jd(datestr)[source]
Convert a string Gregorian date into a Julian date using Pylab.
If no time is given (i.e., only a date), then noon is assumed. Timezones can be given, but UTC is assumed otherwise.
Examples :
print gd2jd('Aug 11 2007')   #---------------> 2454324.5
print gd2jd('Aug 11 2007, 12:00 PST')  #-----> 2454324.29167
print gd2jd('12:00 PM, January 1, 2000')  #--> 2451545.0
Requirements :

matplotlib

See ALSO:

jd2gd()

transittime.getAirmassAndSunAlt(jd, target, obs)[source]

Return airmass and sun altitude at a set of times. INPUTS:

JD – a sequence of times target – an ephem.star-class object obs – an ephem.Observer-class object

Objects w/airmass>9.99 (or below the horizon) are set to 9.99

transittime.getMoonAngle(jd, target, obs)[source]

Returns the angle between a target and the moon (in radians).

Inputs :
jd : float or 1D numpy array

Julian Dates of times

target : ephem.star

target being observed

obs : ephem.Observer

observatory with latitude, longitude, and elevation set

transittime.getPerimeter(a, ecc)[source]

Compute perimeter of an ellipse given its semimajor axis and eccentricity. This is only accurate to a few percent.

transittime.getTransitDuration(p)[source]

Compute duration of transit, in days. Units of inputs should be:

Rp – Jupiter Radii

depth – (none)

a – AU

ecc– (none)

P – days

inc– degrees

transittime.getTransitTimes(planet, *arg, **kw)[source]

If no arguments passes, get info for the next 10 transits. If one (Julian) Date entered, print transits until that date. If two (Julian) Dates entered, print transits between those dates.

If keyword eclipse==True, get the Eclipse times instead.

transittime.isGoodPlanet(planet)[source]

Check if planet object has the necessary fields, and that they are non-empty.

transittime.jd2gd(juldat)[source]
Convert a numerial Julian date into a Gregorian date using Pylab.
Timezone returned will be UTC.
Examples :
print jd2gd(2454324.5)  #--> 2007-08-12 00:00:00
print jd2gd(2451545)    #--> 2000-01-01 12:00:00
See ALSO:

gd2jd()

transittime.makeCharts(path='/Users/ianc/temp/', obs=['lick', 'keck', 'cerropachon'], eclipse=[True, False], months=18, clobber=False, kw=None)[source]

Make transit charts for specified observatories for all planets.

Options :
path : str

directory in which to write text output

obs : list of str

observatories, acceptable to transitChart()

eclipse : list of bool

whether to compute eclipses (if True) or transits (if False). Note that eclipse predictions assume circular orbits!

months : int

Number of (31-day) months from present date for computations

clobber : bool

If true, overwrite file if it already exists. Otherwise, don’t.

kw : dict or None

dict of keywords to pass to transitChart()

Requirements :

Numerical analysis routines, datetime, os

See_also :

transitChart()

transittime.nextEclipse(planet, jd=None, dt0=0.0)[source]

Return JD of the next eclipse of a planet after a given JD. If jd==None, the current date is used.

Note that this only works for planets on circular orbits – eccentric orbits will be given an incorrect Eclipse time!

transittime.nextTransit(planet, jd=None, dt0=0.0)[source]

Return JD of the next transit of a planet after a given JD. If jd==None, the current date is used.

transittime.transitChart(planets, date1, date2, obs='lick', airmax=2.5, twilight=12, tpad=1, cutoff=3, eclipse=False, delim=' ', chron=False, dt0=0.0)[source]
Inputs :
planets – objects with the following fields:

.per (period/days)

.tt (transit ephemeris, JD)

.t14 (transit duration, days)

.ra_string (string; RA of target in hh:mm:ss)

.dec_string (string; Dec of target in dd:mm:ss)

date1, date2 – date strings (e.g., of the form “YYYY-MM-DD”)

obs – (str)
‘lick’ or ‘keck’ or ‘lapalma’ or ‘mtgraham’ or ‘andersonmesa’

or ‘kpno’ or ‘ctio’ or ‘cerropachon’ or ‘palomar’ or ‘cerroparanal’ or ‘lasilla’ or ‘calaralto’ or ‘lascampanas’

airmax – (float) maximum “good” airmass

twilight – (float) how many degrees below the horizon the sun should be

tpad – (float) number of hours to pad ingress and egress

cutoff – (int), 0-5 inclusive. 5 will only show fully visible

transits, while 0 will show ALL transits (even, e.g., those during daylight)

eclipse – (bool) – if True, print times of eclipses, not of transits.

delim – (str) – character to use for output table delimiting

chron – (bool) – if False, print events for each planet.

if True, sort all events by mid-event time.

dt0 – (float) – number of days by which to shift transit

center time. Positive values mean the code predicts transits to occur later than the planet object says they should.

Example :
import transittime as tt
class planet:  % Simplest valid planet class
    def __init__(self):
        return

p = planet()
p.per = 1.58040482
p.tt, p.t14 = 2454980.7487955, 0.03661806
p.ra_string, p.dec_string = '17:15:18.94', '04:57:49.70'
p.name = 'GJ 1214 b'
text = tt.transitChart(p, '2010-01-01','2010-06-30')
Example :
import analysis as an  # requires :doc:`analysis`
import transittime as tt
from numpy import array

planet_names = an.getobj()
all_planets = map(an.getobj, planet_names)
transit_flag = array([p.transit==1 for p in all_planets])
transiters = array(all_planets)[transit_flag]

text = tt.transitChart(transiters, '2011-06-01', '2012-08-01')
Notes :

Always check transit predictions with at least two independent tools!

Previous topic

Transit light curve routines

Next topic

Various spectroscopy routines

This Page