NOTE: lightcurve has been deprecated as of CIAO 3.0; users are
	encouraged to migrate to dmextract ("ahelp dmextract").
	Development on this tool has stopped, but any new bugs found
	will be reported on the CIAO bugs page.
      
      
         `lightcurve' will first get the good time intervals from the GTI
         (Good Time Interval) extension of the source file.  From these it 
         determines the data start time (start_time) and data stop time 
         (stop_time) as the beginning of the first good time interval, and the 
         end of the last good time interval.  If the input source file does not
         have the GTI extension, start_time will be set to TSTART (listed in
         the header of the source file), and stop_time will be set to TSTOP
         (also listed in the header of the source file).
      
      
         After getting the good time intervals from the source file, lightcurve
         will determine the bin size according to the "nbins", "binlength",
         and "counts_per_bin" user parameters.  
      
      
         There are three binning options in lightcurve.  The user can
         bin by one
         of the following options: 
      
      
         1) total number of bins ("nbins" greater than 0):
         binlength = (stop_time - start_time) / (nbins)
      
      
         2) bin length in seconds ("binlength" greater than 0, and
         "nbins" less or equal to 0):  nbins = (stop_time -
         start_time)/(binlength) + 1
      
      
         3) minimum number of counts per bin ("counts_per_bin" greater
         than 0; and "nbins" less or equal to 0; and "binlength" less
         or equal to 0): This option requires the tool to find out how
         many events are in the source file, and how many events are
         in the background file (if specified).  NOTE: If command line
         filtering is applied on the input files, this option is not
         recommended because it requires going through the whole file
         to find out the total number of events and this is time
         consuming.
      
      
         The total number of bins, and bin length can
         then be determined from the following equations:
         
binlength=(counts_per_bin/total_net_counts) * exposure
where total_net_cnts=total_source_cnts - source_area/bkgd_area * bkgfactor* bkgd_source_cnts
         (Note that bkgfactor is the background normalization factor
         entered by the user, and the default value is 1.)
         
nbins = (stop_time - start_time) / (bin_length) + 1
 
      
         `lightcurve' proceeds as follows for each bin: a)Read and sum
         the first bin of data from the source file.  b)Read and sum
         the first bin of data from the background file if there is a
         background file.  c)Determine the good exposure in the first
         bin.  This is just the time in the bin that also lies within
         the good time intervals.  d)Calculate the net counts, net
         count error, net count rate, and net count rate error in the
         bin.  Note: Net count rate = (net counts in the bin)/(good
         exposure in the bin).  Also Note: There are 2 different
         methods used for calculating the uncertainties on counts (or
         count rate), namely Poisson statistics and Gaussian
         statistics.  User can pick either method by setting the
         "errtype" user parameter.  For Poisson statistics (set
         errtype= poisson): error=1+sqrt(counts + 0.75) For Gaussian
         statistics (set errtype=gaussian): error=sqrt(counts) e)Write
         the results to the output lightcurve file.
      
      
         Chandra event files contain data blocks which represent the
         "good-time intervals" - or GTIs - for an observation, and
         each ACIS chip can have a different set of GTIs. For
         pipeline-produced data, the GTIs give the time periods when
         the mission time line parameters fell within acceptable
         ranges (see "ahelp mtl" for more information). Additional
         temporal filtering by the user - such as to remove background
         flare events - can further restrict these periods; the data
         subspace of a file (see "ahelp subspace") lists the GTI
         ranges that have been applied to it.
      
      
         For single-chip data, the event file should be filtered on
         the ccd_id (ACIS) column to ensure that the correct GTI is
         used. This can be done either before passing the file to
         lightcurve or by using the DM virtual-file syntax for the
         infile parameter, e.g.
      
      
         infile="acis_evt2.fits[ccd_id=7]"
       
      
         to select the data, and GTI, for ACIS-S3. If no filtering on
         chip number has been applied, then the GTI for the aim-point
         chip will be used.
      
      
         The situation is much-more complicated for regions that span
         chips. In most cases the GTI ranges for the different chips
         will not be significantly different, so the use of a single
         GTI (lightcurve will use the GTI for the chip at the
         aim-point) will not significantly affect the result. If there
         are significant differences in the GTI ranges between chips,
         then great care must be taken, such as analysing chips
         individually. For ACIS data, the ONTIME series of keywords in
         the header of the event file list the exposure times of the
         different chips.
      
    
   
   There have been no changes made in 'lightcurve' for CIAO 3.0.
   As of CIAO 3.0, 'lightcurve' will no longer be actively maintained
   or enhanced.  Users instead are encouraged to create lightcurves
   with the new lightcurve functionality of 'dmextract', which more
   carefully and accurately applies good time interval (GTI)
   information.  For users choosing bin option 2 above, i.e., binning
   by setting a bin length in seconds, 'dmextract' is the recommended
   choice.  For users choosing binning method 1 (i.e., binning by
   total number of bins), or method 3 (i.e., binning by a minimum number
   of counts per bin), 'lightcurve' is still viable, as
   'dmextract' does not directly support those options.