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

Add a way to have interact export the mask #265

Closed
gully opened this Issue Sep 25, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@gully
Copy link
Contributor

gully commented Sep 25, 2018

The new .interact() is great! It would be even better to have an option that allows reuse of the mask that was generated in the process. Issue #264 addresses conceivable ways that the mask could be saved.

@gully

This comment has been minimized.

Copy link
Contributor

gully commented Nov 8, 2018

Currently thinking about default names for saving the mask:

import os

fn = tpf.hdu.filename()
base = os.path.basename(fn)
outname = base.rsplit('_')[0] + '_custom_mask.fits'

results in: ktwo210690913-c13_custom_mask.fits

Demerit: makes strong assumption for TPF file names (there is exactly one underscore).

@JeffLCoughlin

This comment has been minimized.

Copy link
Member

JeffLCoughlin commented Nov 8, 2018

Maybe replace the .fits on the end with _custom_mask.fits ? Then there's no assumption on delimeters in the filename.

outname = base.rsplit('.fits')[0] + '_custom_mask.fits'

@barentsen

This comment has been minimized.

Copy link
Member

barentsen commented Nov 8, 2018

At the risk of being verbose, I like base.rsplit('.fits')[0] + '-custom-aperture-mask.fits'

Real-world example:

> from lightkurve import search_targetpixelfile
> tpf = search_targetpixelfile("TRAPPIST-1").download()
> print(os.path.basename(tpf.path).rsplit('.fits')[0] + '-custom-aperture-mask.fits')
ktwo246199087-c12_lpd-targ-custom-aperture-mask.fits
@gully

This comment has been minimized.

Copy link
Contributor

gully commented Nov 8, 2018

Do you think it's misleading to include targ, since the output file is no longer a target pixel file?

@barentsen

This comment has been minimized.

Copy link
Member

barentsen commented Nov 8, 2018

I'm not worried about that, personally!

@barentsen

This comment has been minimized.

Copy link
Member

barentsen commented Dec 14, 2018

The interact() tool now has a Save lightcurve button which saves both the custom light curve and the aperture mask as a FITS file (cf. #329). Closing!

@barentsen barentsen closed this Dec 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment