COSMOGRAIL / PyCS

Python Curve Shifting
http://www.cosmograil.org
GNU General Public License v3.0
4 stars 4 forks source link

Offsets computed in magnitude but not flux? #14

Open chto opened 7 years ago

chto commented 7 years ago

Hi @mtewes !

I am learning pycs with @drphilmarshall, while working through the SLTimer notebooks that Milan wrote this summer. It looks as though the offsets found by optimizing a spline model are only in magnitude, and not also in flux - is this a bug or a feature?

Thanks!

Chun-Hao

def spl(lcs):
    spline = pycs.spl.topopt.opt_rough(lcs, nit=5, knotstep=50)
    for l in lcs:
        l.resetml()
    spline = pycs.spl.topopt.opt_rough(lcs, nit=5, knotstep=30)
    spline = pycs.spl.topopt.opt_fine(lcs, nit=10, knotstep=20)
    return spline

spline = spl(lcs)

print(lcs[1].longinfo())

Trial/B 192 points (total), 0 of which are masked 4 seasons (gap: >60), gap length : 164.0 +/- 33.8 days Sampling : median 4.0, mean 4.4, max 25.1, min 0.83 days Shifts : (27.97498,-0.64693,0.00) [days, mag, flux] Colour : blue Common properties : All properties : Comments : Imported from trialcurves.txt, columns (1, 4, 5)

vbonvin commented 7 years ago

Hi @chto ,

It's a feature. The functions you are using to optimize the models (opt_rough and opt_fine) do not contain, by choice, any flux optimization. If you think you need some, the best thing to do is to define an optimizing function yourself and add the flux optimization in it. To do that, you can use the built-in function pycs.spl.multiopt.opt_fluxshift.

drphilmarshall commented 7 years ago

Thanks @vbonvin ! I guess under the assumption that the image brightnesses are being affected lensing (either by the macro model or microlensing by the stars), then its the magnitude shift that is important (because lens magnification applies a multiplicative factor in flux, and so an additive offset in magnitude). I like what you write in the online documentation, that a shift in flux corresponds to a deformation in the light curve in magnitudes - so it makes sense that we are only interested in magnitude shifts. Thanks!

mtewes commented 7 years ago

Hi all, and thanks @vbonvin for answering while I was travelling ! Indeed, I would not worry about flux shifts in this first approach. Also because it's a bit tricky to optimize them.

We implemented them as we do see apparent "flux shifts" in a few real datasets (if interested, see the J1001 light curves http://arxiv.org/abs/1306.5105). This can be due to "contamination" of the individual quasar image photometry by some additional light source (say the lens galaxy, although we try to avoid this of course), or by the combination of microlensing and quasar structure (e.g., ML could bring differential magnification between time-variable blobs around the central engine).