-
Notifications
You must be signed in to change notification settings - Fork 1
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-48896 : Add yaml for DRP processing with sysnthetic source injection for diffim #212
base: main
Are you sure you want to change the base?
Conversation
500e93c
to
2e810a3
Compare
injection_prefix: 'injection_' | ||
injected_prefix: 'injected_' |
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 these actually used in this YAML?
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 am thinking now that maybe they are not being used. I left them so they are clear, and explicit for the user to see.
Do you think it might be better without these?
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.
Clear for what purpose though? If we change the task default from injected_
to post_injection_
for example, the injected_prefix
here would still read injected_
. Someone might look at this thinking your injected outputs will still be injected_
.
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 these aren't being used, my recommendation would be to remove them. While we do have examples of code used for demonstration purposes in the stack(!), I've never been a fan of it myself, and I think it ultimately leads to more confusion and more unnecessary maintenance downstream.
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.
That's fine then. Since this yaml defines inputs and outputs explicitly and no dataset type templates are actually in use, I will remove these.
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 alternative is that you do use these parameters in your config over-rides below.
inject_visit: | ||
class: lsst.source.injection.inject_visit.VisitInjectTask | ||
config: | ||
external_psf: false | ||
external_photo_calib: false | ||
external_wcs: false | ||
connections.input_exposure: pvi | ||
connections.output_exposure: injected_pvi | ||
connections.output_catalog: injected_pvi_catalog | ||
selection: "np.isin(injection_catalog['visit'], {visit})" |
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.
Can I ask why you've decided to hard-code the VisitInjectTask
here, rather than dynamically create it as we do with other injection pipelines? Putting this in would be the second instance in the stack (after pipelines/_ingredients/ApPipeWithFakes.yaml
).
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.
Because dynamically creating this has a key shortcomings for our case, as it doesn't include the matching tasks, with the associated metrics tasks to verify that we have found our injections
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.
From make_injection_pipeline --help
:
-a, --additional-pipelines FILE [FILE ...]
Location(s) of additional input pipeline definition YAML file(s).Tasks
from these additional pipelines will be added to the output injection
pipeline.
This allows you to define the additional task stubs you need in their own stand-along YAML, and then build a complete SI YAML when drp_pipe
gets constructed.
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.
We faced the same issue 5 years ago in our DRP fakes pipelines. Setting them up as static and stand-alone is easier out of the gate, but the problem of having to maintain them as other aspects of the pipeline change quickly becomes onerous. It's almost certainly better for you to set up the AP synthetic pipelines as dynamic now to guard against future maintenance overhead.
connections.output_catalog: injected_pvi_catalog | ||
selection: "np.isin(injection_catalog['visit'], {visit})" | ||
injectedMatch: | ||
class: lsst.ap.pipe.matchSourceInjected.MatchPVIInjectedTask |
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.
Trying to build this pipeline for me fails with:
ImportError: Could not get attribute 'MatchPVIInjectedTask' from 'lsst.ap.pipe.matchSourceInjected' when importing 'lsst.ap.pipe.matchSourceInjected.MatchPVIInjectedTask
' (No module named 'lsst.ap.pipe.matchSourceInjected.MatchPVIInjectedTask'; 'lsst.ap.pipe.matchSourceInjected' is not a package)
Should this be MatchInitialPVIInjectedTask
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.
Perhaps not, as making that switch returns:
AttributeError: lsst.pipe.base.config.MatchInitialPVIInjectedConfigConnections has no attribute injectedPVICat
I'm on main
in drp_pipe
and ap_pipe
- do I need to set up something else?
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 made a mistake, and I was using a branch class from ap_pipe
. I think I can update this to use the current main function, as a replacement matching task is still in flux.
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 should be fixed on new version.
Add a pipeline yaml that takes DRP Diffim stage and adds injected synthetic sources, for transient discovery testing.