Skip to content

Commit a61a6f4

Browse files
committed
Fix all uses of snake_case in camelCase file
1 parent 51c53bb commit a61a6f4

File tree

1 file changed

+44
-37
lines changed

1 file changed

+44
-37
lines changed

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

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def plotData(
444444
prefix : `str`, optional
445445
The prefix to be added to the column names of the rotated shapes.
446446
"""
447-
table_downsampled = randomRowsPerDetector(table, minPointsPerDetector)
447+
tableDownsampled = randomRowsPerDetector(table, minPointsPerDetector)
448448
table = randomRowsPerDetector(table, maxPointsPerDetector)
449449

450450
x = table[prefix + "x"]
@@ -454,29 +454,29 @@ def plotData(
454454
e = table["e"]
455455
fwhm = table["FWHM"]
456456

457-
x_downsampled = table_downsampled[prefix + "x"]
458-
y_downsampled = table_downsampled[prefix + "y"]
459-
e1_downsampled = table_downsampled[prefix + "e1"]
460-
e2_downsampled = table_downsampled[prefix + "e2"]
461-
e_downsampled = table_downsampled["e"]
457+
xDownsampled = tableDownsampled[prefix + "x"]
458+
yDownsampled = tableDownsampled[prefix + "y"]
459+
e1Downsampled = tableDownsampled[prefix + "e1"]
460+
e2Downsampled = tableDownsampled[prefix + "e2"]
461+
eDownsampled = tableDownsampled["e"]
462462

463463
# Quiver plot
464-
quiver_kwargs = {
464+
quiverKwargs = {
465465
"headlength": 0,
466466
"headaxislength": 0,
467467
"scale": QUIVER_SCALE,
468468
"pivot": "middle",
469469
}
470470

471-
shape_angle = 0.5 * np.arctan2(e2_downsampled, e1_downsampled) # spin-2
472-
Q_shape = axs[0, 0].quiver(
473-
x_downsampled,
474-
y_downsampled,
475-
e_downsampled * np.cos(shape_angle),
476-
e_downsampled * np.sin(shape_angle),
477-
**quiver_kwargs,
471+
shapeAngle = 0.5 * np.arctan2(e2Downsampled, e1Downsampled) # spin-2
472+
qShape = axs[0, 0].quiver(
473+
xDownsampled,
474+
yDownsampled,
475+
eDownsampled * np.cos(shapeAngle),
476+
eDownsampled * np.sin(shapeAngle),
477+
**quiverKwargs,
478478
)
479-
axs[0, 1].quiverkey(Q_shape, X=0.08, Y=0.95, U=0.2, label="0.2", labelpos="S")
479+
axs[0, 1].quiverkey(qShape, X=0.08, Y=0.95, U=0.2, label="0.2", labelpos="S")
480480

481481
# FWHM plot
482482
cbar = addColorbarToAxes(axs[0, 1].scatter(x, y, c=fwhm, s=1))
@@ -559,7 +559,7 @@ def plotHigherOrderMomentsData(
559559
y = table[prefix + "y"]
560560
kurtosis = table["kurtosis"]
561561

562-
quiver_kwargs = {
562+
quiverKwargs = {
563563
"headlength": 5,
564564
"headaxislength": 5,
565565
"scale": 1,
@@ -568,42 +568,49 @@ def plotHigherOrderMomentsData(
568568
}
569569

570570
coords = np.vstack([x, y]).T
571-
mean_coma = {}
571+
meanComa = {}
572572
for i in (1, 2):
573573
binning = meanify(binSpacing)
574574
binning.add_field(coords, table[f"coma{i}"])
575575
binning.meanify()
576-
mean_coma[i] = binning.params0
576+
meanComa[i] = binning.params0
577577

578-
mean_coma_angle = np.arctan2(mean_coma[2], mean_coma[1])
579-
mean_coma_amplitude = np.hypot(mean_coma[2], mean_coma[2])
580-
Q_coma = axs[0].quiver(
578+
meanComaAngle = np.arctan2(meanComa[2], meanComa[1])
579+
meanComaAmplitude = np.hypot(meanComa[2], meanComa[2])
580+
qComa = axs[0].quiver(
581581
binning.coords0[:, 0],
582582
binning.coords0[:, 1],
583-
mean_coma_amplitude * np.cos(mean_coma_angle),
584-
mean_coma_amplitude * np.sin(mean_coma_angle),
585-
**quiver_kwargs,
583+
meanComaAmplitude * np.cos(meanComaAngle),
584+
meanComaAmplitude * np.sin(meanComaAngle),
585+
**quiverKwargs,
586586
)
587-
axs[0].quiverkey(Q_coma, X=0.1, Y=0.88, U=0.05, label="0.05", labelpos="S")
587+
axs[0].quiverkey(qComa, X=0.1, Y=0.88, U=0.05, label="0.05", labelpos="S")
588588

589-
mean_trefoil = {}
589+
meanTrefoil = {}
590590
for i in (1, 2):
591591
binning = meanify(binSpacing)
592592
binning.add_field(coords, table[f"trefoil{i}"])
593593
binning.meanify()
594-
mean_trefoil[i] = binning.params0
594+
meanTrefoil[i] = binning.params0
595595

596-
mean_trefoil_angle = np.arctan2(mean_trefoil[2], mean_trefoil[1]) / 3 # spin-3
597-
mean_trefoil_amplitude = np.hypot(mean_trefoil[2], mean_trefoil[1])
598-
SCALE_TRIANGLE = 500
599-
axs[1].scatter(1.8, 1.7, s=0.1 * SCALE_TRIANGLE, marker=(3, 0, 30), lw=0.1, color="black")
596+
meanTrefoilAngle = np.arctan2(meanTrefoil[2], meanTrefoil[1]) / 3 # spin-3
597+
meanTrefoilAmplitude = np.hypot(meanTrefoil[2], meanTrefoil[1])
598+
scaleTriangle = 500
599+
axs[1].scatter(1.8, 1.7, s=0.1 * scaleTriangle, marker=(3, 0, 30), lw=0.1, color="black")
600600
axs[1].text(1.6, 1.35, "0.1")
601-
for idx in range(len(mean_trefoil_amplitude)):
602-
_t = mean_trefoil_amplitude[idx]
603-
_ta = mean_trefoil_angle[idx] * 180 / np.pi
604-
_xcen = binning.coords0[idx, 0]
605-
_ycen = binning.coords0[idx, 1]
606-
axs[1].scatter(_xcen, _ycen, marker=(3, 0, 30 + _ta), s=_t * SCALE_TRIANGLE, lw=0.1, color="black")
601+
for idx in range(len(meanTrefoilAmplitude)):
602+
tVal = meanTrefoilAmplitude[idx]
603+
trefoilAngleDeg = meanTrefoilAngle[idx] * 180 / np.pi
604+
xCenter = binning.coords0[idx, 0]
605+
yCenter = binning.coords0[idx, 1]
606+
axs[1].scatter(
607+
xCenter,
608+
yCenter,
609+
marker=(3, 0, 30 + trefoilAngleDeg),
610+
s=tVal * scaleTriangle,
611+
lw=0.1,
612+
color="black",
613+
)
607614

608615
pos = axs[1].get_position() # get current position [left, bottom, width, height]
609616
axs[1].set_position([pos.x0, pos.y0, pos.width * 0.931, pos.height])

0 commit comments

Comments
 (0)