diff --git a/python/lvmdrp/core/spectrum1d.py b/python/lvmdrp/core/spectrum1d.py index 8131dec1..82fab291 100644 --- a/python/lvmdrp/core/spectrum1d.py +++ b/python/lvmdrp/core/spectrum1d.py @@ -3481,8 +3481,8 @@ def obtainGaussFluxPeaks(self, pos, sigma, replace_error=1e10, plot=False): yyv = numpy.linspace(pos_t-kernel_width, pos_t+kernel_width, 2*kernel_width+1, endpoint=True) # nfibers x kernel_size pixel values v = numpy.exp(-0.5 * ((yyv-pos) / sigma) ** 2) / (fact * sigma) - yyv = yyv.T.flatten() - v = v.T.flatten() / self._error[yyv.astype(numpy.int32)] + yyv = yyv.T.ravel() + v = v.T.ravel() / self._error[yyv.astype(numpy.int32)] B = sparse.csc_matrix((v, (yyv, xx)), shape=(len(self._data), nfibers)) # invert the projection matrix and solve diff --git a/python/lvmdrp/functions/imageMethod.py b/python/lvmdrp/functions/imageMethod.py index 59f76962..18b339be 100644 --- a/python/lvmdrp/functions/imageMethod.py +++ b/python/lvmdrp/functions/imageMethod.py @@ -4238,8 +4238,8 @@ def create_pixelmask(in_short_dark, in_long_dark, out_pixmask, in_flat_a=None, i fig, ax = create_subplots(to_display=display_plots, figsize=(10,5)) fig.suptitle(os.path.basename(out_pixmask)) ax.axvspan(flat_low, flat_high, color="0.7", alpha=0.3) - ax.hist(flat_a._data.flatten(), bins=1000, color="tab:blue", alpha=0.5, label=f"flat A ({os.path.basename(in_flat_a)})") - ax.hist(flat_b._data.flatten(), bins=1000, color="tab:red", alpha=0.5, label=f"flat B ({os.path.basename(in_flat_b)})") + ax.hist(flat_a._data.ravel(), bins=1000, color="tab:blue", alpha=0.5, label=f"flat A ({os.path.basename(in_flat_a)})") + ax.hist(flat_b._data.ravel(), bins=1000, color="tab:red", alpha=0.5, label=f"flat B ({os.path.basename(in_flat_b)})") ax.axvline(ratio_med, lw=1, ls="--", color="0.2") ax.set_xscale("log") ax.set_yscale("log") diff --git a/python/lvmdrp/functions/run_twilights.py b/python/lvmdrp/functions/run_twilights.py index dffb0498..167a7d3e 100644 --- a/python/lvmdrp/functions/run_twilights.py +++ b/python/lvmdrp/functions/run_twilights.py @@ -359,7 +359,7 @@ def fit_fiberflat(in_twilight: str, out_flat: str, out_twilight: str, axs[2].set_ylabel("Flat-fielded flat (%)") axs[2].set_xlim(1, twilight._fibers) - x = (flat_twilight._data/flat_twilight._data[0]).flatten() + x = (flat_twilight._data/flat_twilight._data[0]).ravel() axs[3].axvspan(np.nanmean(x) - np.nanstd(x), np.nanmean(x) + np.nanstd(x), lw=0, alpha=0.1, color="0.2") axs[3].hist(x, bins=1000, range=(0.95, 1.05), color="tab:orange") axs[3].tick_params(labelleft=False)