Skip to content
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

Better handle source catalog saving #1497

Open
schlafly opened this issue Nov 5, 2024 · 0 comments
Open

Better handle source catalog saving #1497

schlafly opened this issue Nov 5, 2024 · 0 comments

Comments

@schlafly
Copy link
Collaborator

schlafly commented Nov 5, 2024

Presently if one runs the source catalog via:
strun romancal.steps.SourceCatalogStep image.asdf
one ends up saving the same catalog twice, once from stpipe's behavior returning the catalog and once from
https://github.com/spacetelescope/romancal/blob/main/romancal/source_catalog/source_catalog_step.py#L130
. It looks to me to be a little awkward to get the pipeline handling and step handling right there for a step that returns two objects.

The right behavior is probably to have source catalog always return a tuple with both the catalog and the segmentation image, and to handle saving those by overriding step.save_model following Webb's example here (credit to Brett for pointing this function out).
https://github.com/spacetelescope/jwst/blob/ce9a135f3bc6bba21e95dd47a91fc4d9ba5a1991/jwst/ami/ami_analyze_step.py#L29-L33
See related code in stpipe here:
https://github.com/spacetelescope/stpipe/blob/01f1956f3b3c3750a26790d5217cf909cad4b95a/src/stpipe/step.py#L924

If we did this, we would also want to get rid of the special "return_updated_model" logic in source_catalog and instead update the image metadata in the pipeline.

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

No branches or pull requests

1 participant