stephtdouglas / k2-pix

Overlay a sky survey image on a K2 target pixel stamp
MIT License
3 stars 4 forks source link

Notes from a usability discussion with JJ Hermes #8

Open gully opened 6 years ago

gully commented 6 years ago

I'm talking with JJ Hermes about making some usability improvements to this tool:

gully commented 6 years ago

Note, I'll be working on some of these in my fork. Another goal would be to either make this a standalone tool, or integrate it into an existing tool like PyKE or k2-flix.

gully commented 6 years ago

Working on this with @mirca right now. We are making a setup.py file to make this a standalone CLI.

gully commented 6 years ago

Woohoo! we got it working as a command line interface (CLI).

You can now do, for example:

k2pix ../ktwo211348409-c05_lpd-targ.fits.gz --survey='DSS'

The default argparse behavior needs to be tweaked, and that's on our radar (see above also), but just having the tool "pip installable" is useful.

pip install k2pix

Huge thanks to Ze for helping me navigate the subtleties of setup.py entrypoints.

$ k2pix --help
usage: k2pix [-h] [-v] [--output FILENAME] [--survey SURVEY]
             [--stretch STRETCH] [--min_percent %] [--max_percent %]
             [--cmap CMAP] [--contour_color CONTOUR_COLOR]
             tpf_filename [tpf_filename ...]

Plots a co-added Target Pixel File (TPF) from NASA's Kepler/K2/TESS with a
survey image overlaid.

positional arguments:
  tpf_filename          path to one or more Target Pixel Files (TPF)

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  --output FILENAME     .gif or .mp4 output filename (default: gif with the
                        same name as the input file)
  --survey SURVEY       survey (available in skyview) to overlay on the K2
                        image.
  --stretch STRETCH     type of contrast stretching: "linear", "sqrt",
                        "power", "log", or "asinh" (default is "log")
  --min_percent %       minimum cut percentile (default: 1.0)
  --max_percent %       maximum cut percentile (default: 95)
  --cmap CMAP           matplotlib color map name (default: gray)
  --contour_color CONTOUR_COLOR
                        matplotlib color name (default: red)