Skip to content

Commit 4c70b79

Browse files
ivhclaude
andcommitted
Remove broken ProgressPlot from curvature step
The plot-level-2 animation was non-functional. The working ProgressPlot in extract.py is preserved. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ef37d6a commit 4c70b79

1 file changed

Lines changed: 0 additions & 70 deletions

File tree

pyreduce/slit_curve.py

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -33,66 +33,6 @@
3333
logger = logging.getLogger(__name__)
3434

3535

36-
class ProgressPlot: # pragma: no cover
37-
def __init__(self, ncol, width, title=None):
38-
plt.ion()
39-
40-
fig, (ax1, ax2, ax3) = plt.subplots(ncols=3)
41-
42-
plot_title = "Curvature in each order"
43-
if title is not None:
44-
plot_title = f"{title}\n{plot_title}"
45-
fig.suptitle(plot_title)
46-
47-
(line1,) = ax1.plot(np.arange(ncol) + 1)
48-
(line2,) = ax1.plot(0, 0, "d")
49-
ax1.set_yscale("log")
50-
51-
self.ncol = ncol
52-
self.width = width * 2 + 1
53-
54-
self.fig = fig
55-
self.ax1 = ax1
56-
self.ax2 = ax2
57-
self.ax3 = ax3
58-
self.line1 = line1
59-
self.line2 = line2
60-
61-
def update_plot1(self, vector, peaks, offset=0):
62-
data = np.ones(self.ncol)
63-
data[offset : len(vector) + offset] = np.clip(vector, 1, None)
64-
self.line1.set_ydata(data)
65-
peaks = np.atleast_1d(peaks)
66-
self.line2.set_xdata(peaks)
67-
self.line2.set_ydata(data[peaks])
68-
self.ax1.set_ylim((data.min(), data.max()))
69-
self.fig.canvas.draw()
70-
self.fig.canvas.flush_events()
71-
72-
def update_plot2(self, img, model, p1, p2, peak):
73-
self.ax2.clear()
74-
self.ax3.clear()
75-
76-
self.ax2.imshow(img)
77-
self.ax3.imshow(model)
78-
79-
nrows, _ = img.shape
80-
middle = nrows // 2
81-
y = np.arange(-middle, -middle + nrows)
82-
x = peak + (p1 + p2 * y) * y
83-
y += middle
84-
85-
self.ax2.plot(x, y, "r")
86-
self.ax3.plot(x, y, "r")
87-
88-
self.fig.canvas.draw()
89-
self.fig.canvas.flush_events()
90-
91-
def close(self):
92-
plt.close()
93-
plt.ioff()
94-
95-
9636
class Curvature:
9737
def __init__(
9838
self,
@@ -499,10 +439,6 @@ def _determine_curvature_all_lines(self, original):
499439
# Fit curvature from peak positions
500440
p1, p2 = self._fit_curvature_from_positions(peaks, positions, offsets)
501441

502-
if self.plot >= 2: # pragma: no cover
503-
for peak in peaks:
504-
self.progress.update_plot1(vec, peak, cr[0])
505-
506442
all_peaks.append(peaks)
507443
all_p1.append(p1)
508444
all_p2.append(p2)
@@ -699,16 +635,10 @@ def execute(self, original):
699635

700636
self._fix_inputs(original)
701637

702-
if self.plot >= 2: # pragma: no cover
703-
self.progress = ProgressPlot(ncol, self.window_width, title=self.plot_title)
704-
705638
peaks, p1, p2, vec = self._determine_curvature_all_lines(original)
706639

707640
coef_p1, coef_p2 = self.fit(peaks, p1, p2)
708641

709-
if self.plot >= 2: # pragma: no cover
710-
self.progress.close()
711-
712642
if self.plot: # pragma: no cover
713643
self.plot_results(ncol, peaks, vec, p1, p2, coef_p1, coef_p2)
714644

0 commit comments

Comments
 (0)