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

Issue with TOI-561 data: Stage 20 #24

Closed
mar-palt opened this issue Nov 17, 2023 · 5 comments · Fixed by #23
Closed

Issue with TOI-561 data: Stage 20 #24

mar-palt opened this issue Nov 17, 2023 · 5 comments · Fixed by #23
Labels
bug Something isn't working

Comments

@mar-palt
Copy link

Hi Sebastian! I am trying to run TOI-561 data that recently became available on MAST (proposal ID = 17192), but I'm running into an error at stage 20. I am attaching a screenshot of the error.
Screen Shot 2023-11-17 at 11 16 44 AM

The issue with the particular dataset is that the guide star was lost halfway through the observation, and then recovered. The result was that some of the images did not contain a spectrum, and some of them did contain a spectrum, but it was off-centered. Even after I removed these images from the data directory, I am still getting the same error.

@mar-palt
Copy link
Author

Hi again! I think it might have something to do with how PACMAN is finding the trace. I had the same issue with TOI-1201, it seems to not be able to find the trace correctly for most targets in the 17192 program. I have trted changing cmin and cmax in the code, but that didn't change anything: the trace was still incorrect and the error was still present. I'm uploading an image of the trace as well.

trace_0

@n-bachmann
Copy link
Contributor

Hi, I had a similar problem with a different data set and found a solution for which I put in a pull request. In my case the coordinate of the reference pixel ('CRPIX' in the file header) wasn't the same for the direct and the spectral images. To account for that, I had to modify the code for stage 10 where the offset is set. I just changed the variables 'LTV1' and LTV2' to:
LTV1 = ima[1].header['LTV1'] + int(abs(ima[1].header['CRPIX1'] - sp[1].header['CRPIX1']))
LTV2 = ima[1].header['LTV2'] + int(abs(ima[1].header['CRPIX1'] - sp[1].header['CRPIX1']))
For that to work you have to load one spectral image before:
files_sp = meta.files_sp # spectra files
sp = fits.open(files_sp[0]) # opens first spectral file
This than also modifies the cmin and cmax in stage 20 and I got the right trace position in the end.
Maybe this will work for your data too.

@sebastian-zieba
Copy link
Owner

Hi @mar-palt ,
thanks for the issue! I've been trying to resolve your previous issue #21 and this one (#24) but I haven't been successful yet. But it looks like @n-bachmann found a solution!
I will test it on some datasets to see if it works.
In the meantime, you could try @n-bachmann 's fix and see if it helps.

@mar-palt
Copy link
Author

Hi all,

Thank you for your responses! I tried @n-bachmann's solution and it worked! This is what my trace looks like at the moment.

trace_0

The trace for TOI-1201 relating to issue #21 was also corrected, I will upload an image of the trace there. I'm still having an issue with Stage 30, however. When trying to perform either the white light curve or the spectroscopic light curve for TOI-561, I'm getting this error:

Screen Shot 2023-11-21 at 12 27 04 PM

Could I have some help with this as well? Thank you!

@sebastian-zieba
Copy link
Owner

Oh that's great!
Perfect! I will test it on some other datasets in the next few hours and update PACMAN to a new version.

@mar-palt , for the new fit problem you mentioned, could you create a new issue? This issue here will be closed after I merge the PR by @n-bachmann . In the new issue, please also attach your pcf and fit_par file. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants