This program was designed to fit a standard light curve template to a poorly-sampled (gappy) light curve of a variable star, and to calculate light curve properties (intensity-mean mags, max, min, amplitude, rise time, epoch of maximum light) of the best-fit template. The program outputs a (phase, mag) file of the template that has been scaled in amplitude and zero-point shifted in magnitude to best-fit the observed data. Multiple templates can be tested, and in general, the best-fit is that with the smallest chi-squared of the observed points around the fitted template. The program also outputs the observed data with phases computed from the input period and shifted to the best-fit template (so pulsating stars have phase=0 at their maximum, and eclipsing binaries have phase=0 at the primary eclipse). A SuperMongo macro is also output for easy graphical display of the results. [see plot1]
The program is also useful for well-sampled data as it will fit your observed input data to the appropriate phase=0 and provide you with an output file with phases, a S-M plot, and computes the light curve properties (intensity-mean mags, max, min, amplitude, rise time, epoch of maximum light) from the observations themselves. You may choose whether the statistics from the observed data or fitted template affords the best representation of the variable star.
The program assumes that you know the period of the variable (for example, your star may have had extensive photographic photometry, but you are providing the first CCD-based photometry). You should also have a good idea of what type of variable it is (e.g. from that ptg photometry, or the star's color, period, location on the CMD, etc) so that you can feed the program an appropriate set of template light curves. If you do not know the star's period, I have another template-fitting program for finding periods, though a FFT approach like Period04 or VStar may be better.
This is an updated version of the original program ''stdlc_export'' (circa May 2000), which is still available here. Improvements include:
The program looks for a file named ''stdlc.setup'' to control the large set of input and output files and parameter settings. Here we will consider the files, and in the following section we will discuss the parameters.
The first two lines of stdlc.setup are comment lines.
The third line provides the name of the file (up to 20 characters long) containing the template light curves. Four files are included with this program, each is appropriate for a different type of variable star or passband (see the section below on templates), and users may generate their own template files.
Adding in new text...The six original templates for optical (V-band) RR Lyrae light curves: XXX see PDF from Layden, A.C. 1998, AJ, 115, 193.
The four other templates for optical (V-band) light curves (RRc, cosine, W UMa, Algol): XXXX see PDF from Layden, A. C. & Sarajedini, A. 2000, AJ, 119, 1760.
New templates for infrared (K-band) RR Lyrae light curves: XXX see PDF from Jones, Carney & Fulbright, 1996, AJ, ....
New templates for optical (V-band) Mira long-period variables: XXX see PDF from Lebzelter ...
New templates for optical (I-band) Ellipsoidal varialbes: XXX see PDF.
BELOW THIS IS THE ORIGINAL stdlc_export VERSION, USEFUL AS I EDIT...
This program is designed to fit a standard light curve template to a poorly-sampled (gappy) light curve of a variable star. It assumes that you know the period of the variable (if not, I have another program for finding periods). It will read in the data (e.g., Time, V magnitude, V error, ..., I magnitude, I error, ...) and fit it with 10 templates (provided). It gives statistics on the 4 best-fits and allows you to plot them using Super Mongo, and then asks you to adopt one of the fits.
It provides a final plot of the light curves in up to 3 magnitudes (e.g., both V and I) [the data points are shifted in phase to correspond with the template's maximum at phase=0] and overplots the adopted template. It also provides light curve properties (e.g., intensity-mean V and I mags, V_max, V_min, rise time, epoch of maximum light, etc) derived both from the fitted template and from the original data points (you may chose which affords the best representation of the variable star).
This program was originated for use on very sparsely sampled light curves -- for details, see Layden, A.C. 1998, AJ, 115, 193, "RR Lyrae Variables in the Inner Halo. I. Photometry".
It was further developed for the data in Layden, A. C. & Sarajedini, A. 2000, AJ, 119, 1760, "Photometry of the Globular Cluster M54 and the Sagittarius Dwaft Galaxy: the Age-Metallicity Relation" (see for details).
I will post additional updates to this site as they become available.
% stdlc_export.e Enter root name for output data files (rd.* & fd.*): sample
This creates two running output files containing the light curve parameters based on Real Data (eg, rd.export) and Fitted Data (eg, fd.export). Each new star is appended to the end of the file.
Enter name of input phot file (HJD,V; q=quit): vfe.V1
This is the observed data for the star you want to fit; vfe.V1 demonstrates the format:
- Column format: HJD, SM, Vmag, Verr, Imag, Ierr.
- (HJD is the heliocentric Julian date with 2,450,000 removed)
- (SM is a SuperMongo point style -- 2-digit integer).
Enter error ratio for bad seeing pts (eg 2.0): 2.0
This allows you to put lower weight on data taken from images taken during poor seeing (to minimize blending effects). 1.0 is unweighted, 1.0--2.0 works well for me. The program identifies seeing as good or bad based on the last digit of SM in vfe.V1: e.g., for SM=93, the 3 indicates good seeing, for SM=90, the 0 indicates poor seeing. You have to decide which images had seeing better/worse than the median for your data set, and assign values to SM accordingly.
Enter period of variable star: 0.5026525
This is the period (in the same units as HJD, days), which you know or have determined.
PROGRAM THEN DOES THE FITTING, AND SPITS SOME INFO TO THE SCREEN
Results for best 4 templates:
Islc, A, P0, Vi, chisq = 1 1.370 -0.013 18.756 0.9434E-02 Islc, A, P0, Vi, chisq = 3 1.272 -0.014 18.714 0.1429E-01 Islc, A, P0, Vi, chisq = 2 1.307 -0.004 18.779 0.1659E-01 Islc, A, P0, Vi, chisq = 5 1.193 -0.025 18.675 0.2333E-01
SM: macro read svfe.V1 lc
It has written out a SuperMongo macro called svfe.V1 which you can display using the indicated commands. Here is a plot showing the result for this example (encapsulated postscript).
Enter plot number (1-4) for final LC: 1
Enter the LINE NUMBER (not the Islc number) of the template you chose as the best light curve for your final analysis. Usually, you will enter "1", since the first line has thesmallest value of chi-squared.
Light Curve Parameters from Observed Data Points: outfile <V>o Vmaxo Vmino Amplo dPro Emaxo Nobs <I>o V-Imin err Nmin vfe.V1 18.167 17.336 18.716 1.380 0.224 897.25595 12 17.518 0.759 0.026 3 Light Curve Parameters from FIT: outfile <V>f Vmaxf Vminf Amplf dPrf Emaxf Nobs slc RMS Pshft vfe.V1 18.227 17.386 18.756 1.370 0.140 641.14426 32 1 0.097 -0.013
It has now written out the info you are really interested in -- the light curve parameters (they are also written to the files rd.sample and fd.sample -- see below for column-by-column descriptions):
SM: macro read zvfe.V1 lc
Allows you to plot V and I light curves with best fitted template superimposed on V data. Here is a plot showing the result for this example (encapsulated postscript).
Enter name of input phot file (HJD,V; q=quit): vfe.V2
Enter the vfe.* filename of the next star to fit, or quit. Note: in my notation, the variable stars are called V1, V2, etc. Anywhere you see V1 in this document, you can replace it with whatever star you are currently working on, e.g., V24.
Please email me if you have questions, comments, or problems. My appologies for the quality and legibility of the code ... I never intended for it to be "public". Nevertheless, I hope you will find it to be of value.
Acknowledgement: If you use this program in published work, I would appreciate your citing it as "Layden, A.C. 1998, AJ, 115, 193".
Best of luck,
Andy Layden
ACL -- updated 2005 Apr 14
2005 Apr 14 -- Corrected program to omit "out of bounds" magnitude/error values (e.g., 99.999 88.888) in final light curve (previous versions had trouble getting the Y-limits on the plot correct -- please inform me if there are still errors).
2001 Apr 23 -- Corrected this documentation (stdlc_export.htm) to correctly describe input file format (vfe.V1) and to describe correct entry of period into the program.
2000 May 24 -- Original version of stdlc_export.f replaced, along with associated files. It had assumed an input photometry file (dat.V01) format with a known period and estimated phase. This didn't mesh well with the period-finding template program stdlc_per10_export.f, so I changed stdlc_export.f to read the same format files (vfe.V1), and to prompt you for the period. This is useful for checking candidate periods generated with stdlc_per10_export.f .
2000 May 11 -- Installed original version of stdlc_export.f .