Skip to content

Commit

Permalink
Fix the science spectrum linelist not updating when recalculating it …
Browse files Browse the repository at this point in the history
…from within the UI.
  • Loading branch information
Olesja Smirnova committed May 14, 2024
1 parent b29150a commit 1ce35ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions geminidr/interactive/fit/wavecal.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def __init__(self, visualizer, fitting_parameters, domain=None,
kwargs["default_model"] = meta["init_models"][0]

self.spectrum = bm.ColumnDataSource(spectrum_data_dict)
self.spectrum_linelist = meta["linelist"]

# Data for the reference plot
self.show_refplot = False
Expand Down Expand Up @@ -914,7 +915,7 @@ def identify_line(self, key, x, y, peak=None):

# Find all unidentified arc lines that this could be, maintaining
# monotonicity
all_lines = self.model.meta["linelist"].wavelengths(
all_lines = self.spectrum_linelist.wavelengths(
in_vacuo=self.visualizer.ui_params.in_vacuo, units="nm"
)

Expand Down Expand Up @@ -1050,7 +1051,7 @@ def identify_lines(self):
dw = linear_model.c1 / np.diff(linear_model.domain)[0]
matching_distance = abs(self.model.meta["fwidth"] * dw)

all_lines = self.model.meta["linelist"].wavelengths(
all_lines = self.spectrum_linelist.wavelengths(
in_vacuo=self.visualizer.ui_params.in_vacuo, units="nm"
)

Expand Down Expand Up @@ -1217,6 +1218,7 @@ def reconstruct_points_additional_work(self, data):
else:
spectrum.data['spectrum'] = this_dict["meta"]["spectrum"]

self.panels[i].spectrum_linelist = this_dict["meta"]["linelist"]
try:
self.panels[i].refplot_spectrum.data['wavelengths'] = this_dict["meta"]["refplot_spec"][:,0]
self.panels[i].refplot_spectrum.data['refplot_spectrum'] = this_dict["meta"]["refplot_spec"][:,1]
Expand Down

0 comments on commit 1ce35ec

Please sign in to comment.