def tweakml_PS_NUMBER(lcs, spline):
     return twk.tweakml_PS(lcs,
                           spline,
                           B_PARAM,
                           f_min=1 / 300.0,
                           psplot=False,
                           verbose=False,
                           interpolation='linear')
示例#2
0
def tweakml_PS_4(lcs, spline):
    return twk.tweakml_PS(lcs,
                          spline,
                          0.12500000000000003,
                          f_min=1 / 300.0,
                          psplot=False,
                          verbose=False,
                          interpolation='linear',
                          A_correction=0.9883240534172314)
示例#3
0
def tweakml_PS_3(lcs, spline):
    return twk.tweakml_PS(lcs,
                          spline,
                          1.5499999999999998,
                          f_min=1 / 300.0,
                          psplot=False,
                          verbose=False,
                          interpolation='linear',
                          A_correction=0.9497062988061292)
示例#4
0
def tweakml_PS_2(lcs, spline):
    return twk.tweakml_PS(lcs,
                          spline,
                          0.12500000000000003,
                          f_min=1 / 300.0,
                          psplot=False,
                          verbose=False,
                          interpolation='linear',
                          A_correction=1.0439695004938903)
示例#5
0
def tweakml_PS_1(lcs, spline):
    return twk.tweakml_PS(lcs,
                          spline,
                          0.12500000000000003,
                          f_min=1 / 300.0,
                          psplot=False,
                          verbose=False,
                          interpolation='linear',
                          A_correction=1.0385175125538744)
示例#6
0
 def tweakml_PS(lcs, spline, B, A_correction):
     return twk.tweakml_PS(lcs,
                           spline,
                           B,
                           f_min=1 / 300.0,
                           psplot=False,
                           save_figure_folder=None,
                           verbose=self.verbose,
                           interpolation='linear',
                           A_correction=A_correction)
示例#7
0
for l in lcs:
    ml.append(l.ml.spline.copy())

B_vec = np.linspace(0.1, 1.0, 10)
for B in B_vec:
    #set back the original microelnsing :

    for i, l in enumerate(lcs):
        l.ml.spline = ml[i]
        # lcs[i].ml.spline.display()

    twk.tweakml_PS([lcs[0]],
                   spline,
                   B,
                   f_min=1 / 300.0,
                   save_figure_folder='./',
                   psplot=False,
                   verbose=True,
                   interpolation='linear')
    twk.tweakml_PS([lcs[1]],
                   spline,
                   B,
                   f_min=1 / 300.0,
                   save_figure_folder='./',
                   psplot=False,
                   verbose=True,
                   interpolation='linear')
    twk.tweakml_PS([lcs[2]],
                   spline,
                   B,
                   f_min=1 / 300.0,
示例#8
0
picklepath = "../Simulation/" + object + '_' + dataname + '/' + 'spl1_ks%i_splml_ksml_%i/' % (
    kntstp, ml_kntstep)

picklename = "initopt_%s_ks%i_ksml%i.pkl" % (dataname, kntstp, ml_kntstep)
curve = 0

(lcs, spline) = pycs.gen.util.readpickle(picklepath + picklename)

A = 1.0  #this is the maximum frequency you want to add (in unit of the Nymquist frequency of your signal)
B = [0.1]  #this is the scaling of the power spectrum

# #To check what does the microlensing curve looks like
rls = pycs.gen.stat.subtract(lcs, spline)
# lcs[0].ml.spline.display()
# lcs[1].ml.spline.display()
# lcs[2].ml.spline.display()
print "Nb coefficient before tweak :", len(lcs[curve].ml.spline.c)
print "before tweak :", pycs.gen.stat.resistats(rls[0])
twk.tweakml_PS(lcs[curve],
               spline,
               B,
               f_min=1 / 300.0,
               save_figure_folder='./',
               psplot=True,
               verbose=True,
               interpolation='linear')
# lcs[0].ml.spline.display()
# lcs[1].ml.spline.display()
# lcs[2].ml.spline.display()
print "Nb coefficient after tweak :", len(lcs[curve].ml.spline.c)