Closed zhexingli closed 5 years ago
Thanks for this excellent question and sorry for the late reply. Since the feature could be frequently requested, I have enhanced the code. plot
returns now the figure object, which can be modified.
So after creating the gls object (here the standard example):
>>> from gls import *
>>> time = np.random.uniform(54000., 56000., 1000)
>>> flux = 0.15 * np.sin(2. * np.pi * time / 10.)
Add some noise
>>> error = 0.5 * np.ones(time.size)
>>> flux += np.random.normal(0, error)
>>> gls = Gls((time, flux, error))
one can do now:
>>> fig = gls.plot()
>>> fig.get_axes()[0].axhline(gls.powerLevel(0.01), linewidth=0.5, color='r', dashes=(16, 16))
>>> fig.get_axes()[0].axhline(gls.powerLevel(0.001), linewidth=0.5, color='r', dashes=(16, 8))
This produces
It might be convenient to have a FAP
argument in the plot function. However, I guess people want to change at least styles, so that more arguments are required.
Thank you so much!!!
Finally, I implemented in 73af7bc a fap
plot option.
You can do now:
>>> gls.plot(fap=0.01)
This is awesome, thank you!
Hello, apologize for bringing this topic back up again. I recently moved to a new device and redownloaded GLS and found errors are returning after running the periodogram. It seems the 'fap' variable within
gls.plot(fap=0.01)
is no longer working? plot funciton doesn't include fap anymore?
I tried to plot fap with another way:
fig = gls.plot(block=True,period=True)
fig.get_axes()[0].axhline(gls.powerLevel(0.01), linewidth=0.5, color='r', dashes=(16, 16))
But it returns this error:
AttributeError: module 'matplotlib.pyplot' has no attribute 'get_axes'
which is extremely odd to me. Any workarounds? Thanks.
The FAP level argument is still there: https://github.com/mzechmeister/GLS/blob/281a964b3f13b0fba1e6f6946ddf8d88e69d9d6c/python/gls.py#L465
Did you follow the install instruction on https://github.com/mzechmeister/GLS/tree/master/python?
Or did you got https://github.com/mzechmeister/python/blob/master/gls.py, which is not synchronised and outdated?
Oh sorry about that! Yes I got it directly from the github master directory. I'll follow the install instruction. Thanks.
Hello,
Is there any way to show a FAP = 1%, 10.% etc or similar overplotted on the periodogram? Thank you.
Best,
Zhexing