Skip to content

Commit

Permalink
Changed FitTrace to use a linear fitter (LinearLSQFitter) when fittin…
Browse files Browse the repository at this point in the history
…g a linear trace model.
  • Loading branch information
hpparvi committed Nov 26, 2024
1 parent 8b0cd21 commit 2292795
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions specreduce/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,13 @@ def _fit_trace(self, img):
y_bins = y_bins[y_finite]

# use given model to bin y-values; interpolate over all wavelengths
fitter = (fitting.SplineSmoothingFitter()
if isinstance(self.trace_model, models.Spline1D)
else fitting.LMLSQFitter())
if isinstance(self.trace_model, models.Spline1D):
fitter = fitting.SplineSmoothingFitter()

Check warning on line 398 in specreduce/tracing.py

View check run for this annotation

Codecov / codecov/patch

specreduce/tracing.py#L398

Added line #L398 was not covered by tests
elif self.trace_model.linear:
fitter = fitting.LinearLSQFitter()
else:
fitter = fitting.LMLSQFitter()

Check warning on line 402 in specreduce/tracing.py

View check run for this annotation

Codecov / codecov/patch

specreduce/tracing.py#L402

Added line #L402 was not covered by tests

self.trace_model_fit = fitter(self.trace_model, x_bins, y_bins)

trace_x = np.arange(img.shape[self._disp_axis])
Expand Down

0 comments on commit 2292795

Please sign in to comment.