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
DM-38432: Implement scarlet_lite stand alone package #70
Conversation
2ecb4a5
to
cd9c6c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly fine, but I have some more clarification requests and small fixes.
totalBands = len(spectrum.x) | ||
morph = FixedParameter(factorizdedData.morph) | ||
factorized = FactorizedComponent( | ||
bands=("dummy", ) * totalBands, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it surprising that the band name not matching "band" above didn't cause any problems, or are band names just labels that get ignored assuming that users keep bands in a consistent order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The labels are meaningless when the model is only used in a single band. We only care about the band names if we are looking at the full multiband models.
modelData: scl.io.ScarletModelData, | ||
catalog: SourceCatalog, | ||
band: str, | ||
redistributeImage: afwImage | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of sounds more like a boolean arg. Maybe redistributingImage
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to imageForRedistribution
.
Returns | ||
------- | ||
heavy: | ||
The footprint (possibly multiband) containing the model for the source. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is MultibandFootprint
actually a HeavyFootprintF
? If not, the return value type hint should be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be either one, thanks for pointing this out. I updated the docstring and type hint.
self.assertEqual(config.version, "lite") | ||
|
||
# Check that the PSF and other properties are the same | ||
assert_almost_equal(oldModelData.psf, modelData.psf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you expecting machine epsilon level differences or larger ones (in which case this might be too sensitive of a check)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be identical, but I made them machine level just to be safe.
self.assertTupleEqual(oldBlendData.shape, blendData.shape) | ||
self.assertTupleEqual(oldBlendData.psf_center, blendData.psf_center) | ||
self.assertTupleEqual(tuple(oldBlendData.sources.keys()), tuple(blendData.sources.keys())) | ||
assert_almost_equal(oldBlendData.psf, blendData.psf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the PSF per blend, which is different from the oldModelData.psf
above, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. oldModelData.psf
and modelData.psf
is the model PSF that all of the blends are generated in.
ca0b4c6
to
a5fdf76
Compare
a5fdf76
to
f50617d
Compare
No description provided.