Skip to content

Commit 19c50df

Browse files
authored
Merge pull request #2207 from larrybradley/build-epsf
Make build_epsf method public
2 parents 30874e1 + 62b4ed8 commit 19c50df

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

docs/whats_new/3.0.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,6 @@ a future version. Update your code to use the new name::
470470
Breaking Changes
471471
----------------
472472

473-
The ``EPSFBuilder.build_epsf()`` method has been removed. Use the
474-
``EPSFBuilder`` callable interface instead (i.e., ``builder(stars)``).
475-
476473
The ``norm_radius`` keyword has been removed from
477474
:class:`~photutils.psf.EPSFBuilder`. This keyword is no
478475
longer relevant because the ePSF is now built directly as an

photutils/psf/epsf_builder.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ def __call__(self, stars):
11331133
result : `EPSFBuildResult`
11341134
The result of the ePSF building process.
11351135
"""
1136-
return self._build_epsf(stars)
1136+
return self.build_epsf(stars)
11371137

11381138
def _validate_fitter_maxiters(self, fitter_maxiters):
11391139
"""
@@ -1968,17 +1968,22 @@ def _finalize_build(self, epsf, stars, progress_reporter, iter_num,
19681968
excluded_star_indices=excluded_star_indices,
19691969
)
19701970

1971-
def _build_epsf(self, stars, *, epsf=None):
1971+
def build_epsf(self, stars, *, epsf=None):
19721972
"""
19731973
Build iteratively an ePSF from star cutouts.
19741974
1975+
This method builds an ePSF from an initial model when ``epsf``
1976+
is provided, or from scratch when ``epsf`` is `None`. In the
1977+
latter case, it is equivalent to invoking an `EPSFBuilder`
1978+
instance on the input ``stars``.
1979+
19751980
Parameters
19761981
----------
19771982
stars : `EPSFStars` object
19781983
The stars used to build the ePSF.
19791984
19801985
epsf : `ImagePSF` object, optional
1981-
The initial ePSF model. If not input, then the ePSF will be
1986+
The initial ePSF model. If `None`, then the ePSF will be
19821987
built from scratch.
19831988
19841989
Returns

photutils/psf/tests/test_epsf_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ def __call__(self, model, *_args, **_kwargs):
16491649

16501650
def test_build_tracks_excluded_indices(self, epsf_test_data):
16511651
"""
1652-
Test that _build_epsf properly tracks excluded star indices.
1652+
Test that build_epsf properly tracks excluded star indices.
16531653
"""
16541654
stars = extract_stars(epsf_test_data['nddata'],
16551655
epsf_test_data['init_stars'][:10], size=11)

0 commit comments

Comments
 (0)