Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicalPowerspectrum on TESS light curve #688

Open
gjmlunaIAFE opened this issue Jan 18, 2023 · 9 comments
Open

DynamicalPowerspectrum on TESS light curve #688

gjmlunaIAFE opened this issue Jan 18, 2023 · 9 comments

Comments

@gjmlunaIAFE
Copy link

Hello,
I'm downloading a light curve from a TESS source with lightkurve, then use lc.to_stingray() to have it stingray format. My light curve is a 1 min, 70 days long ligth curve (from two sectors). When I try to build the dynamical power spectrum within Stingray with:

dps = stingray.DynamicalPowerspectrum(lc, segment_size=3)

I get the following error message:

No GTIs are equal to or longer than segment_size

the units of my time column are days, and I should have many 3-days segments. Any help is appreciated!.
thanks

@dhuppenkothen
Copy link
Member

I think this is probably an edge case we didn't find because we haven't really tested Stingray with TESS data, so thank you for reporting!

Two things:

  1. Could you print out lc.gti and tell us what that says (I think it should be None or just empty, but let's make sure)
  2. What happens if you do

dps = stingray.DynamicalPowerspectrum(lc, segment_size=3, gti=[[lc.time[0], lc.time[-1]]])

Does that help?

@gjmlunaIAFE
Copy link
Author

Hello, thanks for the prompt answer.
My bad, I'm dealing with a K2 light curve, not TESS, but they are similarly read in lightkurve.

the output of lc.gti says:
array([[2823.30596281, 2897.49293923]])
which are exactly the times that I have in my light curve. Your suggestion about gti=[[lc.time[0], lc.time[-1]]] now gives another error:

ValueError("Length of the segment is too long to create "
"any segments of the light curve!")

I have removed some NaN and outliers from the K2 curve, which might make it no evenly sampled, could this be the problem?
thanks

@dhuppenkothen
Copy link
Member

Oooh, exciting! What if you set lc.gti = None?

@dhuppenkothen
Copy link
Member

Also, stingray isn't that well set up to deal with unevenly sampled data (because Fourier methods aren't designed to work with uneven sampling), so that might cause additional issues.

@gjmlunaIAFE
Copy link
Author

lc.gti didn't solve the problem. I guess the sampling is the problem. It would have been great to be able to do the dynamical Lomb Scargle version, that is ok with unevenly sample data

@dhuppenkothen
Copy link
Member

I've opened a slightly different issue #689 to suggest a larger project of adding versions of current algorithms to work with unevenly sampled data. I don't think this'll happen in the next month or two, but I think it might make a nice Google Summer of Code project.

For your use case, do you want to share the code you used to generate the light curve? I'm happy to spend an hour debugging to see if it really is the sampling that's the issue (I'm not 100% confident of that, because I'd have expected a different error in this case), or if there's something else going on that's weird?

@gjmlunaIAFE
Copy link
Author

HI, many thanks!, I'm not very skillful in python coding, so I might have done something wrong. Here is a Jupyter notebook that I was running.
gx14_brasil.py.gz

@matteobachetti
Copy link
Member

@gjmlunaIAFE we recently added many algorithms to deal with unevenly sampled data, and made quite a number of changes to DynamicalPowerspectrum as well. Would you like to help us devise a use case that describes your needs?

@gjmlunaIAFE
Copy link
Author

@matteobachetti I think a nice case would be the dynamical power spectrum of the Kepler/K2 data of V2116 Oph, whose power spectrum I published here https://www.aanda.org/articles/aa/pdf/2023/08/aa47177-23.pdf . Please let me know what would yo need from my side to move forward with this. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants