Skip to content
/ Phot Public

Phot is a Python pipeline aimed to reduce and analyze optical images through differential photometry.

License

Notifications You must be signed in to change notification settings

ivxa/Phot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phot

Phot is a pipeline aimed to reduce and analyze optical images through differential photometry. The input files are the calibration images and the multi-night science images. The output files are the corrected light curves. The code is aimed for multi-night data and it averages the nightly data in one single point. If you only have one single shot per night you should modify the offset.py file (it's straightforward).

WARNING: the pipeline creates and deletes temporary folders and this might be dangerous if you make any mistake setting up the file and directory tree (see Requirements). Make sure that you have a backup of your data images before running the pipeline for the first time.

The main steps of the pipeline are:

  1. Calibration
  2. Cropping of the images (Astropy)
  3. Astrometric reduction (Astrometry.net: tan-sip fit; valid for large field of views)
  4. Saturation and centering control
  5. Non-linearity correction (optional; disable at param.py)
  6. Shutter map correction (optional; disable at param.py)
  7. Standard calibration (bias, darks, flats; PyRAF)
  8. Nightly standard deviation versus magnitude plot
  9. Analysis
  10. Source extraction (SExtractor)
  11. Quality control
  12. Matching between catalogs (Astropy)
  13. Mean differential photometry correction
  14. (not implemented yet) Quality control using optical catalogs
  15. (not implemented yet) XY fitting
  16. (not implemented yet) Long term detrending of the light curves
  17. Multi-night standard deviation versus magnitude plot
  18. Artificial offset to the mean magnitude and error estimation
  19. Plotting

This software has been developed during my PhD thesis (University of Barcelona) to reduce and analyze the optical images of some amazing galactic objects called gamma-ray binaries. I would like to thank and give the appropriate credit to my thesis supervisors Marc Ribó and Valentí Bosch-Ramon, without their guide and discussions none of this would have been possible. I also want to thank to Octavi Fors and Daniel del Ser for the very valuable discussions on the technical implementation, and to Benito Marcote and Javier Moldón for their useful Python tips. The pipeline involves several steps and uses external tools and Python packages such as Astropy, PyIRAF, Astrometry.net and SExtractor, finally I want to give credit to the authors and people who contributed to these tools.

The following papers have been published in refereed journals using a previous version of this software:

astropy

Author

Xavier Paredes-Fortuny (xparedesfortuny@gmail.com)

License

See the LICENSE file for license rights and limitations (MIT).

Usage

  1. Install all of the required dependencies
  2. Create the directory tree (see below)
  3. Edit the param.py file
  4. Edit the se.sex file (see external SExtractor documentation)
  5. Run python main.py param.py

Requirements

Dependencies

  • Astrometry.net and the catalog files
  • SExtractor
  • Some Python packages including PyIRAF (the easiest way to install PyIRAF is installing the Ureka distribution; see the requirements.txt file)
  • LaTeX (optional: for nice plots)
  • epstool (optional: to perform a tight crop when using LaTeX, it can be disabled at plots.py)

Input

  • {$YYYYMMDD}/
    • flats_link (symbolic link or folder with the flat field images)
    • bias_no_cal/ (folder with the bias images)
    • org_completed (needed for linking with an external download script which is not included. You can create a dummy file: "touch org_completed")
    • shutter_map_link (optional: you can disable shutter map correction at param.py)
    • linearity_map_link (optional: you can disable linearity correction at param.py)
    • {$field_name}/ (same field name as in param.py)
      • cal_completed (created at first run after calibration)
      • not_first_run (created at first run)
      • raw_no_cal/
        • 20*.fits
  • {$output_path}/ (defined at param.py)

Output

  • {$YYYYMMDD}/phot/

    • {$field_name}/
      • master_flat
      • mater_bias
      • master_dark
      • shutter_map
      • linearity_map_A
      • linearity_map_B
      • std_*.eps
      • cal/
      • tmp/ (tmp)
        • bias
        • darks
        • flats
        • linear
        • science
        • shutter
      • cat/ (tmp)
  • output_path/

    • frame_list.txt
    • maximum_number_of_stars_per_night-qc.eps
    • nightly_LC/
      • {$YYYYMMDD}-MJD-{$field_name}-target.eps
      • {$YYYYMMDD}-PHA-{$field_name}-target.eps
      • {$YYYYMMDD}-MJD-{$field_name}-ref_stars_self_corrected.eps
      • {$YYYYMMDD}-MJD-{$field_name}-ref_stars_not_self_corrected.eps
    • std_multi_night_plots/
      • std_{$field_name}multi_night_.eps
    • multi_night_LC/
      • MJD-{$field_name}-target-all_frames.eps
      • MJD-{$field_name}-target-nightly_average.eps
      • MJD-{$field_name}-target-nightly_average_cycles.eps
      • PHA-{$field_name}-target-all_frames.eps
      • PHA-{$field_name}-target-nightly_average.eps
      • PHA-{$field_name}-target-nightly_average_cycles.eps
      • MJD-{$field_name}-ref_stars_self_corrected.eps
      • MJD-{$field_name}-ref_stars_not_self_corrected.eps
    • data/
      • MJD_MAG_ERR-{$field_name}-all_frames.dat
      • MJD_MAG_ERR-{$field_name}-nightly_average.dat
      • param.py (copy of the input param file)
      • se.param (copy)
      • se.sex (copy)

About

Phot is a Python pipeline aimed to reduce and analyze optical images through differential photometry.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages