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

DM-37819: Fix crosstalk measurement issues #200

Merged
merged 5 commits into from Jun 25, 2023
Merged

DM-37819: Fix crosstalk measurement issues #200

merged 5 commits into from Jun 25, 2023

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Jun 15, 2023

No description provided.

@@ -29,9 +29,10 @@
from lsstDebug import getDebugFrame
from lsst.afw.detection import FootprintSet, Threshold
from lsst.afw.display import getDisplay
from lsst.pex.config import Field, ListField
from lsst.pex.config import Field, ListField, ConfigurableField
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this repo doesn't use isort, but alphabetical ordering would be great regardless.

@@ -579,7 +609,9 @@ def measureCrosstalkCoefficients(self, ratios, ordering, rejIter, rejSigma):
if ii == jj:
values = [0.0]
else:
values = np.array(ratios[ordering[ii]][ordering[jj]])
# ratios is ratios[Target][Source]
# use jj for Target, use ii for Source, to match ip_isr.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly beyond the scope, but using indices like source_idx and target_idx, or even something like ss and tt instead of ii and jj could avoid a lot of confusion overall.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such an obvious improvement that simply never occurred to me. I've made this change here and in ip_isr, so this won't confuse people in the future.

@@ -109,6 +110,10 @@ class CrosstalkExtractConfig(pipeBase.PipelineTaskConfig,
default=True,
doc="Is the input exposure trimmed?"
)
background = ConfigurableField(
target=SubtractBackgroundTask,
doc="Configuration for initial background estimation",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite a configuration in the sense of a set of parameters. May be a better doc would be "Initial background estimation task"?

self.log.debug(" Target amplifier: %s", targetAmpName)

targetAmpImage = CrosstalkCalib.extractAmp(targetIm.image,
targetAmpImage = CrosstalkCalib.extractAmp(targetIm,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any changes to the extractAmp signature, so I don't follow how it is now able to take targetIm instead of targetIm.image.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see that it can take either an Image instance or a MaskedImage instance and returns an object of the same type(?) I don't see why that change was necessary though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I wanted to look at the mask planes while I was debugging things.

@arunkannawadi
Copy link
Member

The "Fix flake8 error" should be squashed with "Use better background modelling" commit and the last "Switch to less confusing iterator names" does more than what the commit message says. It should be broken down and the changes related to imports and docstrings should be squashed with appropriate previous commits as well.

@czwa czwa changed the title DM-37819: Analyse new crosstalk data from 2023-01-31 DM-37819: Fix crosstalk measurement issues Jun 25, 2023
@czwa czwa merged commit 1aeccd3 into main Jun 25, 2023
1 check passed
@czwa czwa deleted the tickets/DM-37819 branch June 25, 2023 21:22
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.

None yet

2 participants