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

Revert "DM-38974: Move photometric repeatability metrics from faro to analysis_tools" #134

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ repos:
rev: v4.4.0
hooks:
- id: check-yaml
args:
- "--unsafe"
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
language_version: "python3.10"
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
50 changes: 0 additions & 50 deletions pipelines/matchedVisitQualityCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,3 @@ tasks:
atools.stellarAstrometricRepeatability3.process.calculateActions.rms.threshAD: 30
python: |
from lsst.analysis.tools.atools import *
analyzeMatchedVisitExtended:
class: lsst.analysis.tools.tasks.AssociatedSourcesTractAnalysisTask
config:
connections.outputName: matchedVisitExtended
atools.modelPhotRepStarSn5to10: StellarPhotometricRepeatability
atools.modelPhotRepStarSn5to10.fluxType: gaussianFlux
atools.modelPhotRepStarSn5to10.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 5
atools.modelPhotRepStarSn5to10.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 10
atools.modelPhotRepStarSn5to10.produce.plot: NoPlot

atools.modelPhotRepStarSn10to20: StellarPhotometricRepeatability
atools.modelPhotRepStarSn10to20.fluxType: gaussianFlux
atools.modelPhotRepStarSn10to20.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 10
atools.modelPhotRepStarSn10to20.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 20
atools.modelPhotRepStarSn10to20.produce.plot: NoPlot

atools.modelPhotRepStarSn20to40: StellarPhotometricRepeatability
atools.modelPhotRepStarSn20to40.fluxType: gaussianFlux
atools.modelPhotRepStarSn20to40.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 20
atools.modelPhotRepStarSn20to40.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 40
atools.modelPhotRepStarSn20to40.produce.plot: NoPlot

atools.modelPhotRepStarSn40to80: StellarPhotometricRepeatability
atools.modelPhotRepStarSn40to80.fluxType: gaussianFlux
atools.modelPhotRepStarSn40to80.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 40
atools.modelPhotRepStarSn40to80.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 80
atools.modelPhotRepStarSn40to80.produce.plot: NoPlot

atools.psfPhotRepStarSn5to10: StellarPhotometricRepeatability
atools.psfPhotRepStarSn5to10.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 5
atools.psfPhotRepStarSn5to10.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 10
atools.psfPhotRepStarSn5to10.produce.plot: NoPlot

atools.psfPhotRepStarSn10to20: StellarPhotometricRepeatability
atools.psfPhotRepStarSn10to20.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 10
atools.psfPhotRepStarSn10to20.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 20
atools.psfPhotRepStarSn10to20.produce.plot: NoPlot

atools.psfPhotRepStarSn20to40: StellarPhotometricRepeatability
atools.psfPhotRepStarSn20to40.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 20
atools.psfPhotRepStarSn20to40.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 40
atools.psfPhotRepStarSn20to40.produce.plot: NoPlot

atools.psfPhotRepStarSn40to80: StellarPhotometricRepeatability
atools.psfPhotRepStarSn40to80.process.filterActions.perGroupStdevFiltered.selectors.sn.minimum: 40
atools.psfPhotRepStarSn40to80.process.filterActions.perGroupStdevFiltered.selectors.sn.maximum: 80
atools.psfPhotRepStarSn40to80.produce.plot: NoPlot
python: |
from lsst.analysis.tools.atools import *
from lsst.analysis.tools.interfaces import *
8 changes: 4 additions & 4 deletions python/lsst/analysis/tools/actions/vector/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ def setDefaults(self):
class RangeSelector(VectorAction):
"""Selects rows within a range, inclusive of min/exclusive of max."""

vectorKey = Field[str](doc="Key to select from data")
key = Field[str](doc="Key to select from data")
maximum = Field[float](doc="The maximum value", default=np.Inf)
minimum = Field[float](doc="The minimum value", default=np.nextafter(-np.Inf, 0.0))

def getInputSchema(self) -> KeyedDataSchema:
yield self.vectorKey, Vector
yield self.key, Vector

def __call__(self, data: KeyedData, **kwargs) -> Vector:
"""Return a mask of rows with values within the specified range.
Expand All @@ -206,10 +206,10 @@ def __call__(self, data: KeyedData, **kwargs) -> Vector:
result : `Vector`
A mask of the rows with values within the specified range.
"""
values = cast(Vector, data[self.vectorKey])
values = cast(Vector, data[self.key])
mask = (values >= self.minimum) & (values < self.maximum)

return cast(Vector, mask)
return np.array(mask)


class SnSelector(SelectorBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ def setDefaults(self):

# Select only sources with magnitude between 17 and 21.5
self.process.filterActions.coord_ra = DownselectVector(vectorKey="coord_ra")
self.process.filterActions.coord_ra.selector = RangeSelector(
vectorKey="mags", minimum=17, maximum=21.5
)
self.process.filterActions.coord_ra.selector = RangeSelector(key="mags", minimum=17, maximum=21.5)
self.process.filterActions.coord_dec = DownselectVector(
vectorKey="coord_dec", selector=self.process.filterActions.coord_ra.selector
)
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/analysis/tools/atools/diffMatched.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def configureMetrics(
for minimum in range(self._mag_low_min, self._mag_low_max + 1):
action = getattr(self.process.calculateActions, f"{name}{minimum}")
action.selector_range = RangeSelector(
vectorKey=x_key,
key=x_key,
minimum=minimum,
maximum=minimum + self._mag_interval,
)
Expand Down Expand Up @@ -180,7 +180,7 @@ def setDefaults(self):
CalcBinnedStatsAction(
key_vector=key,
selector_range=RangeSelector(
vectorKey=key,
key=key,
minimum=minimum,
maximum=minimum + self._mag_interval,
),
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/analysis/tools/atools/photometricRepeatability.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
LoadVector,
MultiCriteriaDownselectVector,
PerGroupStatistic,
RangeSelector,
ResidualWithPerGroupStatistic,
SnSelector,
ThresholdSelector,
Expand Down Expand Up @@ -94,9 +93,10 @@ def setDefaults(self):
op="ge",
threshold=3,
)
self.process.filterActions.perGroupStdevFiltered.selectors.sn = RangeSelector(
self.process.filterActions.perGroupStdevFiltered.selectors.sn = ThresholdSelector(
vectorKey="perGroupSn",
minimum=200,
op="ge",
threshold=200,
)
self.process.filterActions.perGroupStdevFiltered.selectors.extendedness = ThresholdSelector(
vectorKey="perGroupExtendedness",
Expand Down
Loading