-
-
Notifications
You must be signed in to change notification settings - Fork 147
Refactor common catalog properties to base class #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cgarling
wants to merge
21
commits into
astropy:main
Choose a base branch
from
cgarling:catalog-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+376
−546
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Author
|
Merge conflict resolved |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the existing catalog classes (
_StarFinderCatalog,_DAOStarFinderCatalog, and_IRAFStarFinderCatalog) to be subclasses of a new parentStarFinderCatalogBase. The purpose of this refactor is to hoist shared attributes, methods, and properties between the catalog classes into the parent class. This shouldmoments) 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.