Skip to content

Conversation

@cgarling
Copy link

This PR refactors the existing catalog classes (_StarFinderCatalog, _DAOStarFinderCatalog, and _IRAFStarFinderCatalog) to be subclasses of a new parent StarFinderCatalogBase. The purpose of this refactor is to hoist shared attributes, methods, and properties between the catalog classes into the parent class. This should

  1. reduce duplication of code,
  2. make it easier to create new subclasses representing new catalog formats,
  3. provide an easy way to implement more calculations of morphological parameters / summary statistics (e.g., moments) that don't depend on the finding algorithm. By implementing these methods on the base class, all other catalog classes will get these methods via inheritance.

Points 2 and 3 came up in the context of planning for the development of a Roman-specific crowded-field photometry package which @eteq suggested could be built on top of photutils. This seemed like a reasonable way to start making progress towards a more general interface for the catalog classes.

Copilot AI and others added 20 commits January 28, 2026 11:26
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
All these detection methods require kernels, and it's easier to do the setup (mainly calculating `cutout_shape`) in the __init__ function of the super class. Additionally, with the kernel in the object we can add other methods that depend on the kernel into the base class.
A minimial set of columns that should be derivable / defined for all subtypes. Can be extended later if desired.
_StarFinderCatalog now sets self.shape from kernel.shape for compatibility
with slices property, and includes kernel in _get_init_attributes.

Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Reverts copilot's attempt at fixing `_StarFinderCatalog` and just uses self.cutout_shape in the `slices` method
The 'shape' attribute no longer exists after switching to use 'cutout_shape'.
Updated _get_init_attributes to only include 'kernel' which sets cutout_shape.

Co-authored-by: cgarling <20730107+cgarling@users.noreply.github.com>
Add `cutout_shape` to `init_attributes` of `_StarFinderCatalog
@cgarling
Copy link
Author

cgarling commented Feb 3, 2026

Merge conflict resolved

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.

2 participants