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-33966: Create a fractional residual action for PSF size residuals #640

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions python/lsst/pipe/tasks/dataFrameActions/_actions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

__all__ = ("SingleColumnAction", "MultiColumnAction", "CoordColumn", "MagColumnDN", "SumColumns", "AddColumn",
"DivideColumns", "SubtractColumns", "MultiplyColumns", "MagColumnNanoJansky",)
"DivideColumns", "SubtractColumns", "MultiplyColumns", "FractionalResidualColumns",
"MagColumnNanoJansky",)

from typing import Iterable

Expand Down Expand Up @@ -121,14 +122,22 @@ def __call__(self, df, flux_column=None, flux_mag_err=None, **kwargs):
"colB": SingleColumnAction},
docstring=_docs)

_docs = """This is a `MultiColumnAction` that is designed to multiply two columns
_docs = """This is a `MultiColumnAction` that is designed to divide two columns
together and return the result.
"""
DivideColumns = makeColumnExpressionAction("DivideColumns", "colA/colB",
exprDefaults={"colA": SingleColumnAction,
"colB": SingleColumnAction},
docstring=_docs)

_docs = """This is a `MultiColumnAction` that is designed to divide two columns
together, subtract one and return the result.
"""
FractionalResidualColumns = makeColumnExpressionAction("FractionalResidualColumns", "(colA-colB)/colB",
exprDefaults={"colA": SingleColumnAction,
"colB": SingleColumnAction},
docstring=_docs)
Comment on lines +136 to +139
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I guess this is why you only need to specify ixx and iyy in the pipeline yaml, and not ixy. I don't know if that is the correct thing to do scientifically, but at least I understand why it doesn't crash now! :)

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is not why not specifying ixy didn't crash the pipeline (too many negatives!). The real reason was this.



class AddColumn(DataFrameAction):
aggregator = ConfigurableActionField(doc="This is an instance of a Dataframe action that will be used "
Expand Down