Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix treatment of Nan values in filter scan fit #1153

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lstchain/tools/lstchain_fit_intensity_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def setup(self):

for chan in self.gain_channels:
# verify that the median signal is inside the asked range
median_charge = np.median(mon.flatfield.charge_median[chan])
median_charge = np.nanmedian(mon.flatfield.charge_median[chan])

if median_charge > self.signal_range[chan][1] or median_charge < self.signal_range[chan][0]:
self.log.debug(
Expand Down Expand Up @@ -275,7 +275,7 @@ def finish(self):
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
ax.yaxis.set_major_locator(plt.MultipleLocator(1))

plt.plot(np.median(self.signal[chan], axis=0), self.selected_runs[chan], "o")
plt.plot(np.nanmedian(self.signal[chan], axis=0), self.selected_runs[chan], "o")
plt.xlabel(r'$\mathrm{\overline{Q}-\overline{ped}}$ [ADC]')
plt.ylabel(r'Runs used in the fit')

Expand Down