Skip to content

Release v1.0.17: merge dev into main#84

Merged
charliekilpatrick merged 7 commits into
mainfrom
dev
Jun 23, 2026
Merged

Release v1.0.17: merge dev into main#84
charliekilpatrick merged 7 commits into
mainfrom
dev

Conversation

@charliekilpatrick

@charliekilpatrick charliekilpatrick commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Merge dev into main for v1.0.17 (~47 commits, 86 files changed). This release hardens the reduction pipeline for production use: photutils 3.x compatibility, robust photometry/zeropoint error handling, configurable per-frame background subtraction, improved WCS/alignment options, and a substantially expanded test suite.

Photometry & flux calibration

  • photutils 3.x compatibility: normalize DAOStarFinder / ApertureStats column names (x_centroid vs xcentroid); guard empty catalogs and missing APPPHOT.
  • PhotometryError: photloop now raises on failure instead of silently continuing to zeropoint; absphot.find_zeropoint returns False with clear logging when APPPHOT is missing.
  • FWHM estimation fixes: stop aperture-radius feedback that inflated FWHM; measure FWHM in a compact aperture; cap ePSF cutout size; fit Moffat on PSF core only; fall back to catalog FWHM when ePSF fit is unreliable.
  • Regression tests for production trace failures (tests/test_photometry_regressions.py, tests/test_main_pipeline_photometry.py).

Background subtraction

  • New --bkg-sub CLI option: local (default 2D mesh), constant (single sigma-clipped median per frame), or none.
  • --skip-skysub remains as an alias for --bkg-sub none.
  • BKGSUB header keyword records mode per frame.

Instruments & file discovery

  • Registry-based instrument_getter: single instrument list in __all__; centralized aliases (BINOBINOSPEC, MMIRMMIRS); UnknownInstrumentError with supported-instrument hints.
  • --proc fits generalized across instruments via base Instrument.raw_format() / discover_raw_files().
  • Transparent logging of search paths and glob patterns during file sorting.

WCS, alignment & stacking

  • --skip-external-astrometry: use header WCS only (skip astrometry.net + fine catalog alignment).
  • --fine-align-catalog: Gaia, Pan-STARRS, SDSS, Legacy, 2MASS, SkyMapper.
  • --relative-calibration: SExtractor + RA/Dec cross-match relative flux scaling before stack combine.
  • WCS header sanitization for calibration frames; improved Gaia alignment fallback handling.
  • Robust NIR master-sky creation with iterative sigma clipping.

Calibration & image processing

  • Streamlined calibration frame loading (_read_calibration_ccd); header cleanup to avoid invalid WCS in master bias/flat/dark.
  • Improved cosmic-ray / masking / error-image handling; satellite trail masking preserved through alignment.

Tests, CI & docs

  • New/updated tests: background subtraction, instruments, WCS, options, absphot, image procs, photometry.
  • .gitignore: examples/, .coverage.
  • Documentation and API reference updates; paper revisions.

Breaking / behavior changes

  • Failed photometry now stops the pipeline before zeropoint (previously could KeyError on missing APPPHOT).
  • Default optical background behavior unchanged (--bkg-sub local); use --bkg-sub constant for single-level subtraction per frame.
  • Instrument alias resolution moved into potpyri.instruments.resolve_instrument_name().

Test plan

  • pytest tests/ — 116 passed locally (1 integration download test may skip/fail on network)
  • pytest -m "not integration" — full non-integration suite passes
  • Re-run a known-good GMOS/BINOSPEC reduction end-to-end
  • Verify --bkg-sub constant on extended-source fields (e.g. galaxy targets)
  • Confirm photometry FWHM and zeropoint on a recent production stack

Version

Target release: v1.0.17 (dev currently at 1.0.17.dev27).

- Updated the `raw_format` method in the F2 class to return a glob pattern for discovering raw F2 files based on the `proc` argument.
- Added support for uncompressed FITS files when `proc` is set to "fits", ".fits", or "uncompressed".
- Expanded unit tests to validate the new functionality for the F2 instrument's raw_format method.
- Introduced a new method `discover_raw_files` in the `Instrument` class to handle raw file discovery across specified directories.
- Enhanced the `raw_format` method to return appropriate glob patterns based on the `proc` argument, allowing for flexible file matching.
- Updated instrument subclasses (F2, GMOS, MOSFIRE, etc.) to utilize the new `_default_raw_format` method for consistency in raw file pattern handling.
- Added a human-readable summary method `format_raw_discovery_message` to report search paths and matched files.
- Improved error handling in `handle_files` to log discovery messages when no files are found, enhancing user feedback.
- Expanded unit tests to validate the new functionality and ensure robust handling of raw file discovery across instruments.
- Introduced a new method `apply_optical_background_subtraction` in the `Instrument` class to handle different background subtraction modes: 'local', 'constant', and 'none'.
- Updated the `process_science` method to incorporate the new background subtraction options, replacing the deprecated `skip_skysub` parameter.
- Enhanced command-line options in `init_options` to allow users to specify background subtraction mode via `--bkg-sub`.
- Modified the `image_proc` function to accept and pass the new `bkg_sub` parameter.
- Added unit tests to ensure correct behavior of the new background subtraction features and their integration with existing functionality.
…options

- Updated the `process_science` method to fully integrate the new `apply_optical_background_subtraction` functionality, replacing the deprecated `skip_skysub` parameter.
- Enhanced command-line options in `init_options` to allow users to specify background subtraction modes via `--bkg-sub`.
- Modified the `image_proc` function to accept and pass the new `bkg_sub` parameter for improved flexibility.
- Added unit tests to ensure the correct behavior of the updated background subtraction features and their integration with existing functionality.
…ents

- Updated `extract_aperture_stats` to include a new parameter `fwhm_measure_radius` for measuring FWHM in a compact aperture, improving accuracy.
- Refined the logic for determining the flux aperture radius based on the FWHM measurements.
- Introduced a new helper function `_radial_fwhm_from_array` to estimate FWHM from a 2D profile, enhancing the robustness of FWHM extraction.
- Modified `extract_fwhm_from_epsf` to fit the Moffat2D model only to the core of the ePSF, preventing overestimation of FWHM from extended wings.
- Added unit tests to validate the new FWHM measurement functionality and ensure correct behavior across different scenarios.
…nd-line options

- Updated the `process_science` method to fully integrate the `apply_optical_background_subtraction` functionality, replacing the deprecated `skip_skysub` parameter.
- Enhanced command-line options in `init_options` to allow users to specify background subtraction modes via `--bkg-sub`.
- Modified the `image_proc` function to accept and pass the new `bkg_sub` parameter for improved flexibility.
- Added unit tests to ensure the correct behavior of the updated background subtraction features and their integration with existing functionality.
@charliekilpatrick charliekilpatrick merged commit bc5263a into main Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant