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-31226: Add WCSFit task #1

Merged
merged 12 commits into from Dec 16, 2022
Merged

DM-31226: Add WCSFit task #1

merged 12 commits into from Dec 16, 2022

Conversation

cmsaunders
Copy link
Collaborator

No description provided.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

I think we'll want a separate testdata package for this: I see a bunch of FITS files in tests/data/, and it looks like those take up ~5MB right now.

Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

This is a first batch of comments on the code; I will have more.

doc/lsst.drp.tasks/tasks/lsst.drp.tasks.WCSFitTask.rst Outdated Show resolved Hide resolved
doc/lsst.drp.tasks/tasks/lsst.drp.tasks.WCSFitTask.rst Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
tests/test_wcsfit.py Outdated Show resolved Hide resolved
ups/drp_tasks.table Outdated Show resolved Hide resolved
ups/drp_tasks.table Outdated Show resolved Hide resolved
Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

Since I started commenting on other things, I looked through wcsfit.py and have several requested changes.

You use a mix of camelCase and snake_case here: can you please choose one (we're moving new code to snake_case, post-RFC-623) and use it consistently? Your method names have both (and also mixes, like _load_refCat!).

python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

This looks very good to me, with some small comments, and you should resolve conversations that you think are good.

One meta-question that I think has been brought up before is the name of the task. WcsFitTask is somewhat generic, and doesn't make it clear from the name that this is based on the gbdes code. Have you considered putting this in the task name? (At the minimum the documentation overview should say in the opening paragraph that this uses gbdes to do the fitting, perhaps with a link to the relevant DES paper?). The reason I think the name is important is that we (well, myself at least) are publicly talking about moving to "using gbdes for astrometric fitting", but then there's nothing in the pipeline definition that makes that apparent.

python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
python/lsst/drp/tasks/wcsfit.py Outdated Show resolved Hide resolved
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

Some minor formatting things to be cleaned up; nothing major. One question I have is if gbdes needs specific support for every instrument, or is the name just used as a marker?

systematicError = pexConfig.Field(
dtype=float,
doc=("Systematic error padding added in quadrature for the science catalogs (marcsec). The default"
"value is equivalent to 0.02 pixels for HSC"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing period at end.

modelComponents = pexConfig.ListField(
dtype=str,
doc=("List of mappings to apply to transform from pixels to sky, in order of their application."
"Supported options are 'INSTRUMENT/DEVICE' and 'EXPOSURE'"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing period at end.

deviceModel = pexConfig.ListField(
dtype=str,
doc=("List of mappings to apply to transform from detector pixels to intermediate frame. Map names"
"should match the format 'BAND/DEVICE/<map name>'"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing period at end.

exposureModel = pexConfig.ListField(
dtype=str,
doc=("List of mappings to apply to transform from intermediate frame to sky coordinates. Map names"
"should match the format 'EXPOSURE/<map name>'"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing period at end.

# Check if all components of the device and exposure models are
# supported.
for component in self.deviceModel:
if not (('poly' in component.lower()) or ('identity' in component.lower())):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to be "that guy" who mentions that this file has a mix of single-quotes and double-quotes. Now is the time to pick one. (I personally like single quotes, but black prefers double quotes; I leave it up to you to choose which format for these files.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I kept double quotes for documentation, but standardized to single quotes otherwise.

"""
self.log.info("Gathering instrument, exposure, and field info")
# Set up an instrument object
instrument = wcsfit.Instrument(instrumentName)
Copy link
Contributor

Choose a reason for hiding this comment

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

If instrument is optional, what happens if you call this with None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in docs.


return sourceIndices, columns

def make_YAML(self, inputVisitSummary, inputFile=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be called make_yaml not make_YAML.

WCS-fitting object.
inputCatalogRefs : `list`
List of DeferredDatasetHandles pointing to visit-level source.
tables
Copy link
Contributor

Choose a reason for hiding this comment

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

The period comes on the previous line, and tables is sitting sadly alone.

@cmsaunders cmsaunders dismissed parejkoj’s stale review December 16, 2022 19:56

Eli approved this, and John is not available remove the blocker to merging.

@cmsaunders cmsaunders merged commit 0f1646c into main Dec 16, 2022
@cmsaunders cmsaunders deleted the tickets/DM-31226 branch December 16, 2022 19:57
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

4 participants