Skip to content

Commit

Permalink
debug saving of parameters after FFM
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémy Neveu committed Jan 24, 2024
1 parent 6cf4eb6 commit 7189b32
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions spectractor/extractor/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,14 +933,13 @@ def run_ffm_minimisation(w, method="newton", niter=2):
parameters.SAVE = False

# Propagate parameters
A1, A2, A3, D2CCD, dx0, dy0, angle, B, rot, pressure, temperature, airmass, *poly_params_all = w.params.values
w.spectrum.rotation_angle = angle
w.spectrum.spectrogram_bgd *= B
w.spectrum.spectrogram_bgd_rms *= B
w.spectrum.spectrogram_x0 += dx0
w.spectrum.spectrogram_y0 += dy0
w.spectrum.x0[0] += dx0
w.spectrum.x0[1] += dy0
w.spectrum.rotation_angle = w.params.values[get_index("angle [deg]")]
w.spectrum.spectrogram_bgd *= w.params.values[get_index("B")]
w.spectrum.spectrogram_bgd_rms *= w.params.values[get_index("B")]
w.spectrum.spectrogram_x0 += w.params.values[get_index("shift_x [pix]")]
w.spectrum.spectrogram_y0 += w.params.values[get_index("shift_y [pix]")]
w.spectrum.x0[0] += w.params.values[get_index("shift_x [pix]")]
w.spectrum.x0[1] += w.params.values[get_index("shift_y [pix]")]
w.spectrum.header["TARGETX"] = w.spectrum.x0[0]
w.spectrum.header["TARGETY"] = w.spectrum.x0[1]
w.spectrum.header['MEANFWHM'] = np.mean(np.array(w.spectrum.chromatic_psf.table['fwhm']))
Expand Down

0 comments on commit 7189b32

Please sign in to comment.