Skip to content

Commit

Permalink
BUG: Fix astropy version check
Browse files Browse the repository at this point in the history
for filter_non_finite in modeling within aper phot plugin.
  • Loading branch information
pllim committed Oct 24, 2022
1 parent c76e9fb commit 1fb038f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ Cubeviz
Imviz
^^^^^

- Fixed Simple Aperture Photometry plugin compatibility with astropy v5.1.1. [#1768]

Mosviz
^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ def vue_do_aper_phot(self, *args, **kwargs):
gs = Gaussian1D(amplitude=y_max, mean=0, stddev=std,
fixed={'mean': True, 'amplitude': True},
bounds={'amplitude': (y_max * 0.5, y_max)})
if Version(astropy.__version__) <= Version('5.1'):
fitter_kw = {}
else:
if Version(astropy.__version__) > Version('5.1'):
fitter_kw = {'filter_non_finite': True}
else:
fitter_kw = {}
with warnings.catch_warnings(record=True) as warns:
fit_model = fitter(gs, x_data, y_data, **fitter_kw)
if len(warns) > 0:
Expand Down

0 comments on commit 1fb038f

Please sign in to comment.