DM-54555: Move bright star stamps code into pipe_tasks#469
Conversation
c4ff3eb to
0ad6449
Compare
|
I would have liked to be involved a bit in the design discussion here because I don't like that meas_algorithms now has two types of stamps and some of those inherit from the shared base class and others are completely independent. There was a concept of a generic stamps hierarchy with a trampoline so that people didn't need to know in advance which type of stamp they were serializing. Am I missing that this still exists? |
|
Happy to talk more, but I was keen to make progress on this ticket and not hold up progress on our bright star wings effort. As far as I know, there isn't an If you have plans to write and support something more generic with As bright star stamps haven't yet been widely adopted, switching to |
84afdf3 to
7526f53
Compare
|
I very much want to separate the bright star use case from the cutout service (and I think that's true of most other "stamp" use cases); I think the apparent similarities are really incidental duplication. But I take @timj's point about confusion, especially within a single package. If we can separate the names I think that would help a lot. |
|
I created the Stamps class to act as a generic hierarchy for handling collections of MaskedImage with unified I/O schemes and allowing metadata extensions for specializations. This concept disappears if we now write a separate independent Stamps-like class for each specialization. I understand that inheritance vs traits might not have been the best choice but I don't think the idea is a bad one that people have some unified model for how we utilize collections of masked images. |
|
These are highly-specialized collections of stamps however. They've been warped, calibrated, had their mask planes modified, and we attach the PSF kernel image alongside each one. FWIW, following a discussion with @TallJimbo on this earlier, I'm currently working on moving this code out of |
|
Ok. Your description still sounds consistent with my concept for Stamps. I'm sorry I didn't catch this discussion earlier. |
|
Yes, likewise for me when you discussed this yesterday. If you'd rather keep |
|
My concern is that if we have similarities now and factor them into a common base class, if that factorization needs to change in the future (because needs diverge), then both classes/format break (or need extra work to avoid breakage) instead of only one. I am sympathetic to the idea that it's good for users if the interfaces are as similar as possible (just so people don't have to remember two different ways of writing similar things), but I really don't the implementations or file formats coupled too tightly. |
|
It was designed to have a pretty loose coupling. The reader code was generic because it would look at the FITS headers to work out the Stamps specialization class and then ask that class to load the file. The writer code also gave people a way to specialize whilst calling a base class that made sure you wrote all the EXTNAME/EXTVER headers correctly (which is critically important for Stamps and people easily get wrong). |
|
I assume that in lsst.images we would have a concept in the FITS serializer for asking for a Stamp at a time so that the HDUs can be written with correct EXTNAME/EXTVER with EXTVER incrementing for each Stamp. |
|
I can't speak to the future plans for stamps in What is in scope for this ticket is what we do prior to testing of bright star subtraction. I don't want to begin large scale testing in an old format that will quickly become outdated. I'd much prefer to have these data output in If your concern @timj is potential confusion to the end-user that these may be considered a form of "stamp", I've already suggested above that I'm happy to switch to a different naming convention. Bright star cutouts are intended to be an internal dataset for consumption by |
This script was previously located in meas_algorithms. The decision to move it into pipe_tasks was two-fold: 1. Use of lsst.images format inside bright star stamps introduced a cyclical dependency issue. lsst.images depends on meas_extensions_psfex and meas_extensions_piff (optionally) because it has wrappers for those and needs to be able to import the legacy modules to test them. Moving the bright star stamp storage classes into pipe_tasks resolves this issue in the short term. 2. Having the storage classes located alongside the consuming pipeline tasks helps to streamline development, keeping edits contained within a single package. N.B.: this commit essentially undoes the prior two commits. However, they are being persisted here to aid assessment of what edits were made to the original scripts.
7526f53 to
28995e6
Compare
No description provided.