This folder contains the Python-based O2K imaging pipeline plus a few helper tools for registration fixes and WCS solving.
From the top-level O2000_rex folder, reduce one observing night with:
python reduce.py YYYYMMDDThis does three things:
- reads the raw FITS files in
YYYYMMDD - organizes them into the
MMDDreduction folder and SN subfolders - runs the full Python reduction and then the HTML/JPG QA step
Example:
cd /Users/lluisgalbany/Desktop/O2000_rex
python reduce.py 20260504The reduced products are written into the MMDD folder, for example 0504.
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
EXPTIMEupdate - QA image and HTML generation
Skip the QA preview step:
python reduce.py YYYYMMDD --skip-checkUse the legacy IRAF engine instead of the Python reducer:
python reduce.py YYYYMMDD --engine clThis only works on a machine with IRAF cl available.
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 JMeasure manual shifts by clicking the same target in each frame:
python click_register.py /path/to/MMDD/SNNAME H --prefix crApply those manual shifts, rebuild xobj*, and recombine the final image:
python apply_manual_shifts.py /path/to/MMDD/SNNAME HIf the xobj* frames are already acceptable and you only want to recombine after editing listobj*, use:
python recombine_registered.py /path/to/MMDD/SNNAME HAfter 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_HThe 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.1578780404reduce.pyorganize.pypython_reduction.pycheck.pyqc_registration.pyclick_register.pyapply_manual_shifts.pyrecombine_registered.pybpm2012.fitsfinalimages/solve_wcs.py
The pipeline expects a Python environment with the packages used by the scripts, including:
numpyscipyscikit-imageastropyphotutilsmatplotlibastroqueryrequests
- The reduction creates fresh calibration and intermediate products inside each night folder, so old top-level generated files are not needed.
OBJECTnames likeSN2023_vcxare normalized automatically during organization.- If a run stops midway, rerunning
reduce.pystarts that night again from the organized reduction stage rather than doing a full checkpoint resume.