Пример #1
0
p0, cov, a, b, c = auto.leastsq(auto.fitting,
                                x0,
                                full_output=1,
                                args=(feat, wl, wl1, wl2, f1, f2, gamma1,
                                      gamma2, lsf, fn, fne, [1547, 1553]))

auto.plot_model(p0, feat, wl, fn, wl1, wl2, f1, f2, gamma1, gamma2, lsf,
                [1547, 1553])  #normally [1547, 1553]
print(p0)

# In[468]:

N1, N2 = auto.make_features(p0, feat, wl, wl1, wl2, lsf, gamma1, gamma2)
Ne1 = auto.nfle2Nev(fn, fne, f1, wl1)
Ne2 = auto.nfle2Nev(fn, fne, f2, wl2)
auto.plot_features(wl, wl1, wl2, N1, N2, Ne1, Ne2, [-500, 500])

print(p0)

# In[469]:

N1r, N2r = auto.add_residual(p0, N1, N2, feat, wl, wl1, wl2, f1, f2, gamma1,
                             gamma2, lsf, fn)
auto.plot_features(wl, wl1, wl2, N1r, N2r, Ne1, Ne2, [-500, 500])

# In[471]:

strong_flag = auto.mask_v(
    wl, wl1,
    [0, 25])  # add masking for any regions not to be used in combined data
weak_flag = auto.mask_v(wl, wl2, [-100, 0, 300, 400])
Пример #2
0
x0 = [13.5, 20.3, auto.Wave2V(1548.5, wl1)] + [13, 20.3, auto.Wave2V(1548, wl1)] + [13.5, 20.3, auto.Wave2V(1548.8, wl1)] + [13, 20.3, auto.Wave2V(1550.5, wl2)] #+ [13, 20.3, auto.Wave2V(1548.2, wl1)] + [13.2, 20.3, auto.Wave2V(1547.2, wl1)] #+ [13, 20.3, auto.Wave2V(1549.6, wl2)] #+ [13, 20.3, auto.Wave2V(1551.67, wl2)] 
feat = [0, 0, 1, 2] #which features used to model 0 - both, 1 - strong, 2 - weak
p0, cov, a, b, c = auto.leastsq(auto.fitting, x0, full_output=1, args=(feat, wl, wl1, wl2, f1, f2, gamma1, gamma2, lsf, fn, fne, [1547, 1553]))

auto.plot_model(p0, feat, wl, fn, wl1, wl2, f1, f2, gamma1, gamma2, lsf, [1547, 1553]) #normally [1547, 1553]
print(p0)


# In[41]:


p0[10] = 10
N1, N2 = auto.make_features(p0, feat, wl, wl1, wl2, lsf, gamma1, gamma2)
Ne1 = auto.nfle2Nev(fn, fne, f1, wl1)
Ne2 = auto.nfle2Nev(fn, fne, f2, wl2)
auto.plot_features(wl, wl1, wl2, N1, N2, Ne1, Ne2, [-300, 400])


print(p0)


# In[42]:


N1r, N2r = auto.add_residual(p0, N1, N2, feat, wl, wl1, wl2, f1, f2, gamma1, gamma2, lsf, fn)
auto.plot_features(wl, wl1, wl2, N1r, N2r, Ne1, Ne2, [-400, 400])


# In[45]: