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-31611: Improve reproducibility in ellipKPM test_te1 #119

Merged
merged 1 commit into from
Jan 31, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/lsst/faro/measurement/TractMeasurementTasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ class TExConfig(Config):
column = Field(
doc="Column to use for shape moments", dtype=str, default="slot_Shape"
)
brute = Field(
doc="Run treecorr in brute-force mode for improved reproducibility in tests",
dtype=bool,
default=False
)
# Eventually want to add option to use only PSF reserve stars


Expand Down
1 change: 1 addition & 0 deletions python/lsst/faro/utils/tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def calculateTEx(data: List[CalibratedCatalog], config):
min_sep=config.minSep,
max_sep=config.maxSep,
sep_units="arcmin",
brute=config.brute
)
rhoStatistics = RhoStatistics(
config.column,
Expand Down
2 changes: 1 addition & 1 deletion tests/data/TE1_expected_0_i.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ identifier: cb5f325dc52f4ef794b3165b406c6fa4
metric: TE1
notes: {}
unit: ''
value: 0.0005146044101963828
value: 0.0004407316609029412
3 changes: 2 additions & 1 deletion tests/test_ellipKPM.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ def test_te1(self):
# This is what makes it TE1
config.minSep = 0.25
config.maxSep = 1.0
config.brute = True
task = TExTask(config=config)
for band in ('i',):
catalog, expected = self.load_data(('TE1', band))
result = task.run('TE1', {'i': [CalibratedCatalog(catalog), ]})
log.debug('result: ', result)
log.debug('expected: ', expected)
self.assertEqual(result.measurement, expected)
self.assertAlmostEqual(result.measurement, expected, places=10)


if __name__ == "__main__":
Expand Down