Commit 252ef96e authored by bepinat's avatar bepinat

Bug correction: initial intensity is now null for non fitted lines to avoid false lines

parent 9ce864e2
......@@ -464,7 +464,7 @@ def elspectrum(p, wave=None, lines=None, psf=None, degc=None):
wlines = lines.reshape(lines.size, 1)
dlines = (p[1:lines.size + 1] * lines).reshape(lines.size, 1)
coefs = (p[lines.size + 1:lines.size * 2 + 1] * p[lines.size *2 + 1:lines.size * 3 + 1]).reshape(lines.size, 1)
coefs = (p[lines.size + 1:lines.size * 2 + 1] * p[lines.size *2 + 1:lines.size * 3 + 1]).reshape(lines.size, 1)
slines = (coefs * np.exp( -0.5 * (wavel - wlines * (p[0] + 1)) ** 2 / (dlines ** 2 + psf ** 2))).sum(axis=0)
return (continuum + slines)
......@@ -679,7 +679,7 @@ def buildmaps(conf, cube, hdr, var=None, plot=False, debug=False, free_ratio=Fal
#parinfo[2 * els.index + 1 + i]['limited'] = [0, 0]
#parinfo[2 * els.index + 1 + i]['value'] = params[2 * els.index + 1 + i] = 1
#parinfo[els.index + 1 + i]['fixed'] = 0
#ipdb.set_trace()
logger.info(' Buildmaps: initial parameters % s' % (str(params)) )
#Continuum parametres
......@@ -710,7 +710,7 @@ def buildmaps(conf, cube, hdr, var=None, plot=False, debug=False, free_ratio=Fal
fac_prev = np.int((counter / number_of_pixels) * 100)
sys.stdout.write("Progress => {:3d}%\r".format(fac_prev))
sys.stdout.flush()
if (counter / 10.) == np.int(counter / 10.): logger.debug('pixel %i / %i'%(counter, number_of_pixels))
#if (counter / 10.) == np.int(counter / 10.): logger.debug('pixel %i / %i'%(counter, number_of_pixels))
counter += 1
fa['spectrum'] = cube[indok,y,x] # Spectrum
......@@ -728,8 +728,8 @@ def buildmaps(conf, cube, hdr, var=None, plot=False, debug=False, free_ratio=Fal
#Line intensity initisalisation
for i in range(els.index):
p[els.index + 1 + i] = 2 * std
if parinfo[els.index + 1 + i]['fixed'] == 0: p[els.index + 1 + i] = 2 * std
#Inititalisation of continuum (degree 0)
p[1 + els.index * 3] = np.median(fa['spectrum'])
for z in np.arange(zzmin, zzmax, zstep):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment