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-22643: convert visualizeVisit to gen3 #366
Conversation
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.
Please consider how this interacts with and or suppliments, and or can make use of the Mosaic functionality in afw.display.utils.Mosaic class. You man be able to simplify some things, and use just as a framework for working with the butler.
pipelines/VisualizeVisit.yaml
Outdated
binning: 8 | ||
connections.inputExp: 'calexp' | ||
connections.outputExp: 'calexpBin' | ||
moz: |
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.
maybe use more descriptive labels for these tasks
) | ||
|
||
|
||
class VisBinTask(pipeBase.PipelineTask, |
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 is more verbose, but I think our coding standards perfer longer descriptive names, so something like VisualizeBinTask. On that note, I am not sure what the "bin" is in this name, maybe be more descriptive there.
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.
Makes sense to me. Renamed to Visualize{Action}ExpTask, as they are tasks that Bin/Mosaic Exposure data for Visualization.
|
||
class VisBinTask(pipeBase.PipelineTask, | ||
pipeBase.CmdLineTask): | ||
"""Task for focal plane visualization. |
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.
Please expand this doc string just a bit, maybe some what/and or how
pipelines/VisualizeVisit.yaml
Outdated
config: | ||
binning: 8 | ||
connections.inputExp: 'calexp' | ||
connections.outputExp: 'calexpBin' |
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.
Do you need to set these since it appears you are using the default names?
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.
Probably not. It's likely an artifact from me changing those defaults before making the PR.
|
||
binned = inputExp.getMaskedImage() | ||
binned = afwMath.binImage(binned, self.config.binning) | ||
outputExp = afwImage.makeExposure(binned) |
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.
if this is going to be an exposure, you should copy all the associated info from an exposure, ie the exposure info and such.
if hasattr(image, "getImage"): | ||
image = image.getImage() | ||
|
||
image = afwMath.rotateImageBy90(image, detector.getOrientation().getNQuarter()) |
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.
You should check if they actually need rotated or put a comment saying that rotateImageBy90 does the check, It would be a shame to do lots of linear algebra with identity matrices
pipelineConnections=VisMosaicConnections): | ||
"""Configuration for focal plane visualization. | ||
""" | ||
binning = pexConfig.Field( |
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.
So this is binning done on the focal plane exposure that is done from binned exposures? So if you bin exposures by 8, and then set this binning to 8 the final is 64 times smaller? This seems a bit unclear. If I am correct (or if I am not) please write more doc string to describe this, and maybe put it in comments. Someone just reading the configs might guess that this value must be set to match the other from the other task for some reason.
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 is multiplicative. I'll update the docstring to make that clear, and to mention why this is a good thing.
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.
I've updated the docstring again to fix my incorrect understanding, after some additional testing from Yusra and Lee. The two numbers must agree between tasks, and so I've added a contract enforcing that to the default pipeline.
8c03013
to
28444d3
Compare
description: Visualize full visit/focal plane with binned and mosaic images. | ||
tasks: | ||
binning: | ||
class: lsst.pipe.tasks.visualizeVisit.VisualizeBinExpTask |
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.
You should not even need to specify class here, just do binning: lsst.pipe.tasks.visualizeVisit.VisualizeBinExpTask
Add gen3 implementation of visualizeVisit.