5.11 The Final Script

The Modular construction of the PL requires each pipe to be initiated in sequence, to remove this burden from the LT CS a simple calling program does the work. As recommended by Conroy et al. (1998) the PL is controlled by a C shell script. Steps 1-5 of the script are looped such all the FITS files are operated on individually by each of the 5 steps before the next section of the script is implemented. The remaining steps then operate on the data generated by the first 5 steps as a whole.

Step 1: SExtractor
The FITS file is operated on by SExtractor, this produces a data file containing, the x,y co-ordinates of identified objects, a frame-relative measure of the object’s brightness, a measure of the FWHM and a star/galaxy classification. This step requires only the FITS file.
Step 2: WCS Fitting
The WCS is imparted to the FITSfile using WCSTools, automated through the calling script’s C shell  structure. The input file required by the fitting routine has its data extracted from the file generated by SExtractor. It contains the x,y co-ordinates of identified objects and a relative measure of their intensity, the file is ordered in descending brightness.
Step 3: Standard Star Locating
If the file is identified as a standard then a list of objects which appear in both the object frame and the PMM catalogue is produced, this file is called “standards.match”. The file contains the catalogue RA and Dec, and the number which uniquely identifies object in the catalogue. This is accomplished by matching the PMM catalogue number, which is contained in the LT photometric catalogue to the PMM catalogue number produced during the WCS Fitting procedure. Only those objects identified as standards, in the standard frame, are passed on to the next stage of the PL.
Step 4: Create Photometry Input Files
The photometry pipe requires two input files, these are called “stars.pos” and “PSF.pos”. PSF.pos has the following header,
  • # Columns: 1 star no
    # Columns: 2:3 x[pixels]:y[pixels]
    # Columns: 4 Search radius [pixels]

it is always created from data generated by SExtractor, it contains the brightest 10 objects in the frame that are not saturated and are considered to be stellar, as determined by their FWHMs in both the x and y being equal, and not from the SExtractor star/galaxy classification.

The generation of stars.pos is different depending on whether or not it is a standards frame. Its header is always the same however,

  • # Columns: 1 star no, 2:3 x[pixels]:y[pixels]
    # Columns: 4 Search radius [pixels]
    # Columns: 5 Star/galaxy class - 0=gal; 1=star

If the frame to be reduced is a standards frame then the data are extracted from step 3 above. The star number is then the unique PMM catalogue number which identified the star. If the FITS file is a normal observation the data used to generate the file is again taken from SExtractor.

Step 5: Photometry
The photometry pipe produces a “.comb” file prefixed with the name of the FITS file, it requires the FITS file and its associated star.pos and PSF.pos. The header of this file is,
  • # OPTIMAL INFO: PSF star 8 had FWsHM (0.832508743, 1.46874928).
    # OPTIMAL INFO: Rotated at an angle of -1.532930066E-3 degrees from the vertical.
    # OPTIMAL INFO: And a search radius of 3. pixels.
    # APERTURE INFO: Aperture of 2.81488872 pixels radius.
    # APERTURE INFO: 1.40999997 detected photons per count.
    # APERTURE INFO: Radius searched for star 5. pixels.
    # Row: 1 Filter plus fillers
    # Columns: 1 Star
    # Columns: 2 Standard Star Flag/PMM Number
    # Columns: 3 Companion_flag
    # Columns: 4 Star/Galaxy Classifier
    # Columns: 5 MJD of observation
    # Columns: 6 Airmass
    # Columns: 7:8 X:Y [pixels]
    # Columns: 9 Optimal Phot. Counts, alternate aperture photometry counts
       (line starts with optimal counts)
    # Columns: 10 Optimal Phot. Errors, alternate aperture photometry errors
       (line starts with optimal errors)

The photometry code produces data for every object it is supplied with, for those objects that cannot be reduced an error code is generated in place of the magnitude and magnitude error in the file, other information flags are also generated. The flag is identified by a minus sign in front of the number. The error/info flags are:

  • -1.0: Object is too close to frame edge for optimal photometry (error).
    -2.0: Object is too close to frame edge for its position to be identified, (optimal, error).
    -3.0: The sky level cannot be fitted for optimal photometry (error).
    -4.0: The star is saturated (optimal error).
    -6.0: The sky level cannot be fitted for aperture photometry (error).
    -7.0: Object is too close to frame edge for aperture photometry (error).
    -8.0: The star is saturated (aperture error).
    -9.0: Object is too close to frame edge for its position to be identified (aperture error).
    -10.0: If column 3 of the file contains a -10.0, then it shows that the star is isolated
       enough for photometry to take place. If the star is contaminated by light from
       another object, column 3 will contain a -5_?, where ? is replaced by the number
       of the star which is doing the contaminating (info).
    -11.0: If the star being fitted is a standard star its PMM number is located in column 2,
       if not column 2 will contain a -11.0.(info).

The photometry step ends the looping section of the script, step 6 onwards operates on the data generated to this point as a whole.

Step 6: Airmass Curve Generation
The airmass curves are calculated from the data generated from standards frames, in the way described above. During this process a series of files is generated, these are listed below with their headers:
  • fullzeropoint.<filter>; each filter has a separate file as indicated by its suffix. This file holds all data generated to produce the airmass curves, with those objects removed by the fitting routine indicated by a #.
    • # This file holds data to construct airmass curves
      # Columns: 1 Band, 2 Photometry file number
      # Columns: 3:4 Cat-number:Name
      # Columns: 5 MJD, 6 airmass
      # Columns: 7:8 Zeropoint:Zeropoint Error - optimal Photometry
      # Columns: 9:10 Zeropoint:Zeropoint Error - aperture Photometry
      # Notes : Lines preceded by a # have been removed from
      # : the airmass curve and are believed to be due
      # : to bad weather
  • zeropoint.<filter>; each filter has a separate file as indicated by its suffix. This file holds the final airmass data, and also includes a new column which is the residuals of the points about the fitted airmass curve.
    • # This file holds data to construct airmass curves
      # Columns: 1 Band, 2 Photometry file number
      # Columns: 3:4 Cat-number:Name
      # Columns: 5 MJD, 6 airmass
      # Columns: 7:8 Zeropoint:Zeropoint Error - optimal Photometry
      # Columns: 9:10 Zeropoint:Zeropoint Error - aperture Photometry
      # Columns: 11 Col 7 v Col 5 residuals of Lsq fit
      # Columns: Error in Col 11 = (Error in Col.7 ) = Col.8
      # Columns: 11 was created using Optimal photometry
  • photcorrection.<filter>; each filter has a separate file as indicated by its suffix. This file holds the necessary data to generate the final magnitudes and their associated errors.
    • # This file holds the corrections to be applied
      # to the instrumental magnitudes
      # Columns: 1 Zeropoint Corrections
      # Columns: 2 MJD Corrections
      # Rows: 1 Gradient of LSF
      # Rows: 2 Error on Gradient of LSF
      # Rows: 3 Intercept of LSF
      # Rows: 4 Error on Intercept of LSF
      # Rows: 5 Standard Deviation of points about LSF
      # Rows: 6 Covariance of LSF [cov(m,c)]
      # Rows: 7 Chi2 of LSF
      # Rows: 8 Number of degrees of freedom LSF
      # Rows: 9 Reduced-Chi2 of LSF
      # Rows: 10 mean x value
      # Rows: 11 N(x /\ 2bar-xbar /\ 2)
      # This file was created using Optimal photometry
  • badmjd.<filter>; each filter has a separate file as indicated by its suffix. This file holds the MJD times of the standards that were removed from the airmass curves.
    • # This file holds the MJD values that have been
      # removed from the airmass curve.
      # Removal indicates that the calculated zeropoint
      # was outside the tolerance range.
      # Row : 1 Internal flag 1=photometric 0=non-photometric night
      # Columns: 1 The MJD value that proceeds the flagged value
      # Columns: 2 The Flagged MJD value that was removed
      # Columns: 3 The MJD value that follows the flagged value
Step 7: Calculating Magnitudes
Calculating the instrumental magnitudes is the final stage of the PL, with corrections to standard filter systems being left to the observer. The final output file consists of 8 columns, with the file header being similar to:
  • # This is the final file of the Liverpool Telescope Pipe-line
    # Notes : This is a b band file
    # Notes : The standards at this time were not photometric (optional i)
    # Columns: 1 Standard Star Flag/PMM Number
    # Columns: 2 Companion flag
    # Columns: 3 Star/Galaxy Classifier
    # Columns: 4:5:6 RA:Dec:System
    # Columns: 7: Magnitude
    # Columns: 8: magnitude Error
    # Lee Howells: Astrophysics Research Institute 29.09.2001
    # lxh@astro.livjm.ac.uk.
The lines in the header marked “optional” only occur if the standards were removed from the airmass curve at the time this frame was observed.

Column 7, the object magnitude is computed using methods explained in Chapter 2, with the associated error being constructed from data computed and recorded to file in step 6.

Recalling that the magnitude of an object is,

m =  -2.5log  (I) + zp
            10
(5.38)
where I is the intensity from the object and zp is the zeropoint, as determined at the object’s airmass. The error (Dm) associated with this quantity is then derived to be:
    2   (   2.5   )2    2      2
Dm   =   I-log--10   DI  + Dzp
             e
(5.39)
where DI is the error associated with the intensity from the object and is determined as explained in Section 5.9.5, it is read directly from the photometry file. Dzp is the error associated with the zeropoint. This is computed separately for each object at this point in the program thus: Having calculated the intercept and gradient of the airmass curve in step 6, the extrapolated (or interpolated) zeropoint value at a given airmass has an associated error generated thus;
V (zeropoint) = V(c)+  airmass2V (m) + 2(airmass)cov(m, c)
(5.40)
where V (zeropoint) is the variance on the zeropoint, V (c) and V (m) are the variance on the intercept and gradient respectively of the airmass curve, and cov(m,c) is the covariance of the intercept and gradient of the airmass curve. The variance of a term is its error squared, it describes how much a variable (x) is likely to vary from its mean value (x). The covariance of a pair of terms describes how independent the two terms are, if values of x above x tend to occur with values of y which are above y then the covariance is likely to be positive. Conversely if the large values of x are associated with small values of y the covariance is negative, this is the case for the airmass curve as the gradient is negatively valued. An anti-correlation will tend to a zero covariance. Barlow (1999) explicitly points out that if the covariance term is left out of Equation (5.40) then the computed error is too large. The covariance of two variables has units and is therefore not instantly useful in comparing correlations between different variable pairs. Therefore a correlation coefficient can be defined, dividing the covariance by the errors of the variable pairs producing a dimensionless number. For an application of this technique see Chapters 6, 7 & 8

The zeropoint derived from the MJD calculations explained in Section 5.9.6 has its error generated using the same general formula, these errors are then added in quadrature giving the final error on the magnitude.

5.11.1 Conclusion: Version 3

There have been two significant steps forward in version 3.0 of the the PL, these have been; (i) the successful implementation of a WCS and (ii) the automation of airmass curve generation. Both these steps have allowed fully autonomous use of the PL. The data used to test the PL has been repeatedly re-reduced with identical results produced each time. The details of the test data reduction are presented in the next section.