Skip to content

Commit

Permalink
update doc with treecorr v4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
PFLeget committed Oct 14, 2024
1 parent 3d81fc9 commit 63a32b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
14 changes: 8 additions & 6 deletions python/lsst/meas/algorithms/treecorrUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TreecorrConfig(Config):
The fields in this class correspond to the parameters that can be passed to
any calls to `treecorr` methods, including catalog creation and two-point
correlation function calculations. The default values set for the fields
are identical to the default values set in v4.2 of `treecorr`.
are identical to the default values set in v4.3 of `treecorr`.
A separate config class is used instead
of constructing a `~lsst.pex.config.DictField` so that mixed types can be
Expand All @@ -38,8 +38,9 @@ class TreecorrConfig(Config):
Notes
-----
This is intended to be used in CalcRhoStatistics class. It only supports
some of the fields that are relevant for rho-statistics calculations.
This is intended to be used with correlations of PSF residuals. It only supports
some of the fields that are relevant for rho-statistics calculations and the likes
of it.
"""

nbins = Field[int](
Expand Down Expand Up @@ -92,7 +93,7 @@ class TreecorrConfig(Config):
"This includes both min_sep and max_sep above, as well as the "
"units of the output distance values."
),
default="radian",
default=None,
optional=True,
allowed={
units: units for units in ["arcsec", "arcmin", "degree", "hour", "radian"]
Expand Down Expand Up @@ -202,9 +203,10 @@ class TreecorrConfig(Config):
optional=True,
)

rng_seed = Field[int](
rng = Field[int](
doc="Value to seed the treecorr random number generator with. Used to generate patches.",
default=13579,
default=None,
optional=True,
)

def validate(self):
Expand Down
14 changes: 7 additions & 7 deletions tests/test_computeExPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_comp_ex_psf(self) -> None:

np.testing.assert_allclose(output1.metric_E1, 1.0, atol=2e-1)
np.testing.assert_allclose(output1.metric_E2, 1.0, atol=2e-1)
np.testing.assert_allclose(output1.metric_Ex, 0.0, atol=1e-1)
np.testing.assert_allclose(output1.metric_Ex, 0.0, atol=2e-1)

config = ComputeExPsfTask.ConfigClass()

Expand All @@ -253,9 +253,9 @@ def test_comp_ex_psf(self) -> None:
task = ComputeExPsfTask(config)
output2 = task.run(self.de1, self.de2, ra, dec, units="arcmin")

np.testing.assert_allclose(output2.metric_E1, 0.20, atol=1e-1)
np.testing.assert_allclose(output2.metric_E2, 0.05, atol=1e-1)
np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=1e-1)
np.testing.assert_allclose(output2.metric_E1, 0.20, atol=2e-1)
np.testing.assert_allclose(output2.metric_E2, 0.05, atol=2e-1)
np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=2e-1)

config = ComputeExPsfTask.ConfigClass()

Expand All @@ -271,9 +271,9 @@ def test_comp_ex_psf(self) -> None:
task = ComputeExPsfTask(config)
output2 = task.run(self.de1, self.de2, ra, dec, units="arcmin")

np.testing.assert_allclose(output2.metric_E1, 0.0, atol=1e-1)
np.testing.assert_allclose(output2.metric_E2, 0.0, atol=1e-1)
np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=1e-1)
np.testing.assert_allclose(output2.metric_E1, 0.0, atol=2e-1)
np.testing.assert_allclose(output2.metric_E2, 0.0, atol=2e-1)
np.testing.assert_allclose(output2.metric_Ex, 0.0, atol=2e-1)


def setup_module(module):
Expand Down

0 comments on commit 63a32b2

Please sign in to comment.