JKTEBOP - for analysing light curves of detached eclipsing binaries
JKTEBOP version 28 is now available.
(1) All floating-point variables are now double precision to avoid compiler-dependent issues with defauly numerical precision.
(2) The subroutine ECQUADPHASES has been improved and now correctly returns eclipse times and quadrature phases.
(3) All print*, and write(*, statements are now write(6, to avoid a problem with functions and the Intel fortran compiler.
(4) JKTEBOP has been re-dimensioned to code with up to 999,999 datapoints (previously this was 99,999 datapoints).
The JKTEBOP code is used to fit a model to the light curves of detached eclipsing binary stars in order to derive the radii of the stars as well as various other quantities. It is very stable and has a lot of additional goodies, including extensive Monte Carlo or bootstrapping error analysis algorithms, so is pretty much all you need to analyse an eclipsing binary light curve. It is also excellent for transiting extrasolar planetary systems.
All input and output is done by text files, making its operation as simple as possible. JKTEBOP has not been givena graphical interface or plotting capability; I prefer to use IDL or GNUPLOT to create plots from the JKTEBOP output.
JKTEBOP is written in almost-standard FORTRAN 77 using first the g77 compiler and now the ifort compiler. It was presented, along with the Monte Carlo algorithm implementation, in my papers on V453 Cyg, V621 Per and WW Aur (see my publication record), and has been used and gradually extended in quite a few papers since.
Features of JKTEBOP
- The light curve mode used is essentially the same as was presented in the EBOP (Eclipsing Binary Orbit Program) code, which was written by Paul B Etzel. This models the projection of each star as a biaxial ellipsoid and calculates light curves by numerical integration of concentric circles over each star. It is very fast and has extremely low numerical noise, but is only suited to eclipsing binaries where the stars are fairly well separated. JKTEBOP will tell you if the stars are too distorted for it to give you accurate results.
- To find the best-fitting model for a dataset I use the Levenberg-Marquardt optimisation algorithm (MRQMIN from Press et al. 1993), which is fairly fast and does not diverge.
- JKTEBOP can fit for orbital period and reference time of minimum light (see my work on the eclipsing system ψ Centauri).
- Nonlinear limb darkening is now included. The available limb darkening laws are: (1) linear, (2) quadratic, (3) square-root, (4) logarithmic, (5) cubic. See my papers on β Aurigae and transiting planets for more details.
- Times of minimum light, spectroscopic light ratios, third light values, and orbital eccentricity information can be included directly as observed quantities to constrain the solution. The huge advantage of this approach is that you put them in the parameter file, they are automatically taken care of in a consistent way, and the error analysis algorithms deal with them correctly. See my papers on β Aurigae and WASP-19.
- Monte Carlo simulations can be used to determine robust uncertainties in the parameters JKTEBOP derives. See Press et al. 1993 for further details. This algorithm was introduced in my work on V453 Cyg and V621 Per, and in my analysis of WW Aur I have confirmed that it gives reliable results.
- Bootstrapping simulations (Press et al. 1993) can be used to determine robust uncertainties in the parameters JKTEBOP derives. I have not used the bootstrapping algorithm much.
- An approximate global search algorithm has been implemented, which simply does a lot of fits with a wide range of starting parameters.
- An algorithm for checking the importance of correlated noise is available. It uses the residual-shift method, which is not the most statistically correct algorithm but has the advantage of directness and simplicity. It is described in my first paper on homogeneous studies of transiting planetary systems.
- Input and output is does solely by text file so is very simple. The output files are set up so they are easy to plot using any decent plotting package.
- Long exposure times can be dealt with by numerically integrating over a specified exposure time interval.
There are various comments in the code, but documentation is otherwise very limited *my apologies) so you will need to have a decent idea what you're doing. The original EBOP user manual is useful if you are able to get hold of a photocopy, and I hope to make it available electronically at some point. The code takes care of almost everything, so you are only required to ensure that you've given it decent data and reasonable initial parameter estimates.
The source code is available on its own as a text file or with example input and output files in a tarfile. The examples included are WW Aurigae (eclipsing binary) and WASP-4 (transiting planet). The previously available versions of the code are available for reference: v10, v15, v21 and v25.
I compile the code using the command
ifort -o jktebop jktebop.f
and then run it (on my Linux system) at the command line using
(omitting the square brackets). An empty input file can be created for you to enter parameters in the correct places by typing
Input files: (1) a file containing the initial parameter values, and (2) a file with the observational data. The parameter file needs various parameters to be entered at the start of each line, and examples are available for download above. The input datafile contains the light curve to be fitted. Each line should contain a time and a magnitude. JKTEBOP tests the datafile to see if it has three columns of data, and if so the third column is read in and assumed to contain the observational error for each datapoint.
Output files: (1) a file containing the output parameters and other results, (2) a file with the best-fitting model light curve, (3) a file giving the input data and their residuals around the best fit. Some of the error analysis algorithms produce file (1) and a second file containing the results of every simulation.
JKTEBOP is based on the EBOP code written by Paul B Etzel. In my publications I generally cite Popper & Etzel (1981AJ.....86..102), Etzel (1981psbs.conf..111E), and/or Nelson & Davis (1972ApJ...174..617N). The latter reference is for the original model, which was significantly modified for EBOP by Paul Etzel.
Relevant references for JKTEBOP include:
- Southworth et al. (2004MNRAS.351.1277S): introduction of the Monte Carlo algorithm and first specific mention of JKTEBOP
- Southworth et al. (2005MNRAS.363..529S): shows that the Monte Carlo analysis gives reliable results
- Bruntt et al. (2006A&A...456..651B): fitting for orbital period and time of minimum light
- Southworth et al. (2007A&A...467.1215S): non-linear limb darkening, and inclusion of spectroscopic light ratios and times of minimum light as observations
- Southworth et al. (2007MNRAS.379L..11S): linear limb darkening is inadequate for the fitting the HST photometry of the transiting extrasolar planetary system HD 209458
- Southworth (2008MNRAS.386.1644S): correlated noise algorithm, cubic-law limb darkening, and a detailed investigation of fourteen transiting extrasolar planetary systems using JKTEBOP
- Southworth et al. (2009ApJ...707..167S): inclusion of ecosω and esinω as fitted parameters
- Southworth (2010MNRAS.408.1689S): specification of measured values of third light
- Southworth (2011MNRAS.417.2166S): numerical integration
Examples of the use of JKTEBOP can be found in most of my papers on detached eclipsing binaries and transiting extrasolar planetary systems.
- Task 1
- This task inputs the effective temperatures and surface gravities of two stars and outputs limb darkening coefficients for them. The actual code for this has actually been split off and is now in a separate program (JKTLD). Task 1 is now just a system call to JKTLD.
- Task 2
- This inputs a parameter file and calculates a synthetic light curve (10000 points between phases 0 and 1) using the parameters you put in the file.
- Task 3
- This inputs a parameter file (containing estimated parameter values) and an observed light curve. It fits the light curve using MRQMIN and produces an output parameter file, a file of residuals of the observations, and file containing the best fit to the light curve (as in Task 2). The parameter values have formal errors (from the covariance matrix in MRQMIN) but these are NOT overall uncertainties. You will need to run other tasks to get reliable parameter uncertainties.
- Task 4
- This inputs a parameter file and finds the best fit to the light curve. It then rejects datapoints which are distant from the fit (using a sigma value which you gave it) and refits the data.
- Task 5
- This inputs a parameter file and light curve and tries to find the global minimum by refitting the light curve many times from quite different sets of initial parameters (based on the ones you gave it).
- Task 6
- This inputs a parameter file and light curve and finds the best fit. For each adjusted parameter it then studies how the quality of fit changes as the parameter value is varied. This is a good way to find robust errors.
- Task 7
- This task inputs a parameter file, finds the best fit, and then uses bootstrapping to estimate the uncertainties in the parameters. An excellent description of bootstrapping can be found in Press et al (1993), chapter 15. Here, the light curve is randomly resampled (with replacement) many times and the resulting datasets individually refitted. The range in parameter values found gives the uncertainty in that parameter. I recommend using 10000 datasets (1000 is enough for many analyses).
- Task 8
- This inputs a parameter file, finds the best fit, and then uses Monte Carlo simulations to estimate the uncertainties in the parameters (again, see Press et al (1993), chapter 15. Here, the best-fitting light curve model is re-evaluated at the phases of the actual observations. Gaussian simulated observational noise is added and the result refitted. This process is repeated (again, I recommend 10000 times for final results) and the range in parameter values found gives the uncertainty in that parameter. Task 8 differs from Task 7 in that it explicitly assumes that the best fit to the observations is a good fit, but this is normally a decent assumption.
- Task 9
- This inputs a parameter file, finds the best fit, and then assesses the importance of correlated "red" noise on the parameters of the fit. The residual-shift method is used, where the residuals around the best fit are shifted point-by-point through the observational data (with ones which fall off the end of the dataset wrapping over to the beginning). After each shift a new best fit is calculated. Thus you end up with the same number of best fits as the light curve has datapoints. The 1σ errors are calculated, as with the Monte Carlo algorithm, by sorting the best fits and taking values which correspond to the central 68.3%. Each best shifted fit is outputted to a file and can therefore be plotted to see what actually happened - these plots can be very interesting.
Frequently Asked Questions
A page of Frequently Asked Questions is now available and is the first place to consult if you have problems.
ALCFIT: a user-friendly interface written by Pierre Maxted
Dr Pierre Maxted has written a FORTRAN interactive interface to the JKTEBOP code. This is a good way to introduce undergraduates to light curve fitting, or to get initial values for the main parameters before a more complete analysis with JKTEBOP. ALCFIT is available from here and requires a FORTRAN compiler and the PGPLOT graphics library for installation.
Last modified: 01/03/2012 John Southworth (Keele University, UK)