Skip to content

Commit

Permalink
Merge pull request #1701 from larrybradley/minmaxcut-depr
Browse files Browse the repository at this point in the history
Handle renamed keywords in astropy visualization
  • Loading branch information
larrybradley committed Feb 1, 2024
2 parents 6e447c1 + 9337f5e commit b545c04
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions photutils/psf/griddedpsfmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import warnings
from functools import lru_cache

import astropy
import numpy as np
from astropy.io import fits, registry
from astropy.io.fits.verify import VerifyWarning
from astropy.modeling import Fittable2DModel, Parameter
from astropy.nddata import NDData, reshape_as_blocks
from astropy.utils import minversion
from astropy.visualization import simple_norm

from photutils.utils._parameters import as_pair
Expand Down Expand Up @@ -136,7 +138,10 @@ def plot_grid(self, *, ax=None, vmax_scale=None, peak_norm=False,
vmax_scale = 0.03
vmax = data.max() * vmax_scale
vmin = -vmax
norm = simple_norm(data, 'linear', min_cut=vmin, max_cut=vmax)
if minversion(astropy, '6.1.dev'):
norm = simple_norm(data, 'linear', vmin=vmin, vmax=vmax)
else:
norm = simple_norm(data, 'linear', min_cut=vmin, max_cut=vmax)
else:
if cmap is None:
cmap = cm.viridis.copy()
Expand All @@ -145,8 +150,12 @@ def plot_grid(self, *, ax=None, vmax_scale=None, peak_norm=False,
vmax_scale = 1.0
vmax = data.max() * vmax_scale
vmin = vmax / 1.0e4
norm = simple_norm(data, 'log', min_cut=vmin, max_cut=vmax,
log_a=1.0e4)
if minversion(astropy, '6.1.dev'):
norm = simple_norm(data, 'log', vmin=vmin, vmax=vmax,
log_a=1.0e4)
else:
norm = simple_norm(data, 'log', min_cut=vmin, max_cut=vmax,
log_a=1.0e4)

# Set up the coordinate axes to later set tick labels based on
# detector ePSF coordinates. This sets up axes to have, behind the
Expand Down

0 comments on commit b545c04

Please sign in to comment.