Skip to content

SN-ICE/O2000_rex

Repository files navigation

O2K Near-IR Reduction Pipeline

This folder contains the Python-based O2K imaging pipeline plus a few helper tools for registration fixes and WCS solving.

Main workflow

From the top-level O2000_rex folder, reduce one observing night with:

python reduce.py YYYYMMDD

This does three things:

  1. reads the raw FITS files in YYYYMMDD
  2. organizes them into the MMDD reduction folder and SN subfolders
  3. runs the full Python reduction and then the HTML/JPG QA step

Example:

cd /Users/lluisgalbany/Desktop/O2000_rex
python reduce.py 20260504

The reduced products are written into the MMDD folder, for example 0504.

What the pipeline does

The default Python engine replaces the old cl < analyze.cl IRAF step. It performs:

  • dark and flat creation
  • bad-pixel correction using bpm2012.fits
  • dark and flat correction of science frames
  • sky-frame construction and subtraction
  • negative outlier replacement
  • simple cosmic-ray cleaning
  • image registration
  • final min/max-rejected combination
  • header EXPTIME update
  • QA image and HTML generation

Optional flags

Skip the QA preview step:

python reduce.py YYYYMMDD --skip-check

Use the legacy IRAF engine instead of the Python reducer:

python reduce.py YYYYMMDD --engine cl

This only works on a machine with IRAF cl available.

Registration rescue tools

If the automatic registration is not good enough, these helpers can be used on one SN folder at a time.

Measure residual registration quality:

python qc_registration.py /path/to/MMDD/SNNAME H
python qc_registration.py /path/to/MMDD/SNNAME J

Measure manual shifts by clicking the same target in each frame:

python click_register.py /path/to/MMDD/SNNAME H --prefix cr

Apply those manual shifts, rebuild xobj*, and recombine the final image:

python apply_manual_shifts.py /path/to/MMDD/SNNAME H

If the xobj* frames are already acceptable and you only want to recombine after editing listobj*, use:

python recombine_registered.py /path/to/MMDD/SNNAME H

WCS step

After reduction, copy the final science images you want to solve into finalimages/, then run:

cd /Users/lluisgalbany/Desktop/O2000_rex/finalimages
python solve_wcs.py SN2022ea_20260504_H

The script:

  • extracts the SN name from the filename
  • queries TNS for the SN coordinates
  • matches catalog and image sources interactively
  • writes a solved FITS file named <input>_wcs.fits

If needed, you can bypass TNS and pass coordinates directly:

python solve_wcs.py SN2022ea_20260504_H --ra 208.173538708 --dec 59.1578780404

Required files kept in this folder

  • reduce.py
  • organize.py
  • python_reduction.py
  • check.py
  • qc_registration.py
  • click_register.py
  • apply_manual_shifts.py
  • recombine_registered.py
  • bpm2012.fits
  • finalimages/solve_wcs.py

Python dependencies

The pipeline expects a Python environment with the packages used by the scripts, including:

  • numpy
  • scipy
  • scikit-image
  • astropy
  • photutils
  • matplotlib
  • astroquery
  • requests

Notes

  • The reduction creates fresh calibration and intermediate products inside each night folder, so old top-level generated files are not needed.
  • OBJECT names like SN2023_vcx are normalized automatically during organization.
  • If a run stops midway, rerunning reduce.py starts that night again from the organized reduction stage rather than doing a full checkpoint resume.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages