Skip to content

Commit 8b3faf5

Browse files
Merge pull request #68 from lsst-sitcom/tickets/DM-53259
Add percentiles in the colorscale limits of ShapeAzEl
2 parents da8b983 + da79ff4 commit 8b3faf5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

python/lsst/summit/extras/plotting/psfPlotting.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import numpy as np
3838
from astropy.table import Table, vstack
3939
from matplotlib.gridspec import GridSpec
40-
from matplotlib.patches import Ellipse, FancyArrowPatch, Polygon
40+
from matplotlib.patches import Circle, Ellipse, FancyArrowPatch, Polygon
4141
from mpl_toolkits.axes_grid1 import make_axes_locatable
4242
from treegp import meanify
4343

@@ -479,16 +479,24 @@ def plotData(
479479
axs[0, 1].quiverkey(qShape, X=0.08, Y=0.95, U=0.2, label="0.2", labelpos="S")
480480

481481
# FWHM plot
482-
cbar = addColorbarToAxes(axs[0, 1].scatter(x, y, c=fwhm, s=1))
482+
vmin, vmax = np.nanpercentile(fwhm, [5, 95])
483+
sc = axs[0, 1].scatter(x, y, c=fwhm, s=1, vmin=vmin, vmax=vmax)
484+
circle = Circle((0, 0), 1.75, color="red", fill=False, linestyle="--")
485+
axs[0, 1].add_patch(circle)
486+
cbar = addColorbarToAxes(sc)
483487
cbar.set_label("FWHM [arcsec]")
484488

485489
# Ellipticity plots
486-
emax = np.quantile(np.abs(np.concatenate([e1, e2])), 0.98)
490+
emax = np.quantile(np.abs(np.concatenate([e1, e2])), 0.97)
487491
axs[1, 0].scatter(x, y, c=e1, vmin=-emax, vmax=emax, cmap="bwr", s=1)
492+
circle = Circle((0, 0), 1.75, color="red", fill=False, linestyle="--")
493+
axs[1, 0].add_patch(circle)
488494
axs[1, 0].text(0.05, 0.92, "e1", transform=axs[1, 0].transAxes, fontsize=10)
489495

490496
cbar = addColorbarToAxes(axs[1, 1].scatter(x, y, c=e2, vmin=-emax, vmax=emax, cmap="bwr", s=1))
491497
cbar.set_label("e")
498+
circle = Circle((0, 0), 1.75, color="red", fill=False, linestyle="--")
499+
axs[1, 1].add_patch(circle)
492500
axs[1, 1].text(0.89, 0.92, "e2", transform=axs[1, 1].transAxes, fontsize=10)
493501

494502
# FWHM hist

0 commit comments

Comments
 (0)