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-33960: Add astrometry residuals with refcat plots #22
Conversation
__all__ = ["CatalogMatchTaskConfig", "CatalogMatchTask"] | ||
|
||
|
||
class AstropyMatchTaskConfig(pexConfig.Config): |
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 a task is called AstropyMatchTask
, convention is to call the corresponding config AstropyMatchConfig
. (I saw a couple places where this convention was not followed in analysis_drp
so I'm guessing you just copied and pasted from there).
ConfigClass = AstropyMatchTaskConfig | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) |
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.
This __init__
doesn't do anything different than super
's __init__
. Whole method unnecessary.
|
||
separations = d2d[goodMatches] | ||
|
||
return refMatchIndices, targetMatchIndices, separations |
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.
run methods in Tasks should return a Struct.
return pipeBase.Struct(refMatchIndices=refMatchIndices,
targetMatchIndices=targetMatchIndices
separations=separations)
The Task frameowrk expects shit. Reasons for this is that is that devs can extend the method to return more later without breaking any calling code. Default runQuantum
tries writes the keys of the Struct as output.
pipelines/coaddQAPlots.yaml
Outdated
"y": "$Dec_{target} - Dec_{ref}$ (marcsec)"} | ||
python: | | ||
from lsst.analysis.drp.dataSelectors import CoaddPlotFlagSelector, StarIdentifier | ||
from lsst.analysis.drp.calcFunctors import AstromDiff |
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.
needs a newline
"_target" for duplicated column names, plus a column with the | ||
angular separation between matches. | ||
""" | ||
|
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 seen a few of violations of:
- https://developer.lsst.io/python/numpydoc.html#docstrings-of-methods-and-functions-should-not-be-preceded-or-followed-by-a-blank-line
- https://developer.lsst.io/python/numpydoc.html#docstrings-of-classes-should-be-followed-but-not-preceded-by-a-blank-line
Not going to comment on every one.
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.
Argh, I can never remember which is right!
# Join the catalogs for the matched catalogs | ||
refMatches = self.refCat.iloc[refMatches].reset_index() | ||
sourceMatches = targetCatalog.iloc[targetMatches].reset_index() | ||
matchedCat = sourceMatches.join(refMatches, lsuffix='_target', rsuffix='_ref') |
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.
What's it joining on if there's no index or "on" arg?
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 default for 'on' is to join on the index.
self.refCat = refCat.asAstropy().to_pandas() | ||
|
||
|
||
class CatalogMatchVisitTaskConnections(pipeBase.PipelineTaskConnections, dimensions=("visit", "skymap"), |
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.
@natelust Out of curiosity, why we need skymap here? Is it to get the refCat
shards to be found?
""" | ||
|
||
ConfigClass = CatalogMatchVisitTaskConfig | ||
_DefaultName = "catalogMatchTask" |
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.
convention is "catalogMatch" for the DefaultNames. lowercase. Leave off the word Task.
inputs = butlerQC.get(inputRefs) | ||
|
||
dataFrame = inputs["catalog"].get() | ||
inputs['catalog'] = dataFrame |
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.
Ooof, I just realized that you're reading in the entire objectTable_tract
and making a copy of the whole thing. Don't deferLoad if you're going to read in the whole thing, but I'm going to think about alternatives to this, because this not the way if we want the analysis_drp
to be fast and memory efficient.
# dataframe | ||
skyCircle = self.refObjLoader.loadSkyCircle(center, | ||
radius, | ||
'i', |
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.
intentionally hardcoded band?
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.
Yes, the band is ignored by a config, but you apparently have to put in something.
2f1f2f1
to
35b873a
Compare
pipelines/matchVisitCatalogs.yaml
Outdated
selectorActions.flagSelector: VisitPlotFlagSelector | ||
sourceSelectorActions.sourceSelector.band: "" | ||
python: | | ||
from lsst.analysis.drp.dataSelectors import VisitPlotFlagSelector |
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.
needs newline.
216cd9b
to
e3797a2
Compare
925d0de
to
73f0207
Compare
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.
Looks fine. This is next on the list of plots/metrics to migrate to analysis_tools as an example
73f0207
to
2b0d7e3
Compare
No description provided.