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-47084: getOverlappingExposures docs and other cleanups #346

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

parejkoj
Copy link
Contributor

No description provided.

Copy link

@christinawilliams christinawilliams left a comment

Choose a reason for hiding this comment

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

Thanks! I left some comments including minor typos and also some places where I thought more clarification would be useful (but I defer to the developers whether these should be included in order to stick with convention for documentation)

"""Return a data structure containing the coadds that overlap the
specified bbox projected onto the sky, and a corresponding data
structure of their dataIds.
These are the appropriate inputs to this task's `run` method.

The spatial index in the registry has generous padding and often

Choose a reason for hiding this comment

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

I think I don't understand what "spatial index" here is referring to. If this is one of the inputs maybe its worth explaining which?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please have another look at this text: I reworked it a bit to hopefully be more clear?


The spatial index in the registry has generous padding and often
supplies patches near, but not directly overlapping the detector.
Filters inputs so that we don't have to read in all input coadds.
This filters the inputs so that we don't have to read in all
possibly-matching coadds.

Choose a reason for hiding this comment

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

By "read in" does it mean load all the images in the input list (to check for overlap)? Perhaps this stems from my confusion over "spatial index in the registry" (does this mean butler registry, i.e. is referring to how all the images are indexed in the database?


Parameters
----------
inputs : `dict` of task Inputs, containing:
- coaddExposures : `list` \
[`lsst.daf.butler.DeferredDatasetHandle` of \
`lsst.afw.image.Exposure`]
Data references to exposures that might overlap the detector.
Data references to exposures that might overlap the desired
region.

Choose a reason for hiding this comment

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

I think I was sending it a dictionary containing a list of data references? I find info on the format needed to be useful but I defer to developers the correct way to document these things

Copy link
Contributor Author

@parejkoj parejkoj Nov 5, 2024

Choose a reason for hiding this comment

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

As noted in the docstring, this is a list of datarefs. See the type listing above this line.

RFC-1052 is about refactoring this method (and run) to take specific arguments instead of a dict.

- wcs : `lsst.afw.geom.SkyWcs`
Template WCS onto which to resample the coaddExposures.
Template WCS onto which the coadds will be resampled, .

Choose a reason for hiding this comment

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

an extra comma at the end of the -wcs explanation

Choose a reason for hiding this comment

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

Also separate question: does this function only work on coadds, or is it possible this would be used for calexp files also (i.e. perhaps more generic reference to input images rather than specifically coadds would make sense?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Coadds are organized per tract/patch, other exposures are not. That tract/patch organization is a requirement here.

Copy link

@christinawilliams christinawilliams left a comment

Choose a reason for hiding this comment

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

Looks good! Much improved (at least from the perspective of someone trying to learn how to use this). Just flagged one typo.

name=BaseSkyMap.SKYMAP_DATASET_TYPE_NAME,
dimensions=("skymap", ),
storageClass="SkyMap",
)
# TODO DM-31292: Add option to use global external wcs from jointcal
# Needed for DRP HSC
coaddExposures = pipeBase.connectionTypes.Input(
doc="Input template to match and subtract from the exposure",
doc="Coadds that may overlap the desired region, as possible inputs to the template."
" Will be restricted to those that directly overlap the projected bounding box.",
dimensions=("tract", "patch", "skymap", "band"),

Choose a reason for hiding this comment

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

extra space before "Will"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's necessary, so that there is a space after the period on the previous line.

@parejkoj parejkoj force-pushed the tickets/DM-47084 branch 3 times, most recently from 7b194d7 to 4b4ca87 Compare November 8, 2024 17:34
It's clearer to pull out the `inputs` from the loop, and we only need
to test that the wcs is not None once, not in the loop.
@parejkoj parejkoj merged commit bd46683 into main Nov 13, 2024
2 checks passed
@parejkoj parejkoj deleted the tickets/DM-47084 branch November 13, 2024 03:16
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.

2 participants