Skip to content

Commit

Permalink
Add a plot of 'collapse_smooth' (fixes #157)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopasra committed Nov 30, 2017
1 parent c60d228 commit 61bcbf9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion megaradrp/recipes/calibration/flat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import numpy
from astropy.io import fits

import matplotlib.pyplot as plt
from numina.core import Product

from megaradrp.core.recipe import MegaraBaseRecipe
Expand Down Expand Up @@ -130,6 +130,14 @@ def obtain_fiber_flat(self, rss_wl, wlcalib, col1=1900, col2=2100, window=31, de
# Smooting works bad very near the border (overshooting)
collapse_smooth = savgol_filter(collapse, window, degree)
collapse_smooth[mask_noinfo] = 1.0

if self.intermediate_results:
xx = numpy.arange(collapse.shape[0])
plt.scatter(xx, collapse)
plt.plot(xx, collapse_smooth)
plt.savefig('collapsed_smooth.png')
plt.close()

# Divide each fiber in rss_wl by spectrum
gmean = col_good_mean.mean()
data1 = rss_wl[0].data / collapse_smooth
Expand Down

0 comments on commit 61bcbf9

Please sign in to comment.