Skip to content

Commit

Permalink
Merge pull request #1540 from pypeit/view_fits_changes
Browse files Browse the repository at this point in the history
Added docs and embed option.
  • Loading branch information
jhennawi authored Feb 16, 2023
2 parents f095313 + af0d351 commit 7d9d748
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pypeit/scripts/show_2dspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pypeit import slittrace
from pypeit import specobjs
from pypeit import io
from pypeit import utils

from pypeit.display import display
from pypeit.images.imagebitmask import ImageBitMask
Expand Down Expand Up @@ -284,7 +285,8 @@ def main(args):
{})

if args.embed:
embed()
embed(header=utils.embed_header())


# Playing with some mask stuff
#out = shell.start_operation('TVMask')
Expand Down
11 changes: 9 additions & 2 deletions pypeit/scripts/view_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from IPython import embed

from pypeit.scripts import scriptbase
from pypeit import utils


class ViewFits(scriptbase.ScriptBase):
Expand All @@ -33,11 +34,14 @@ def get_parser(cls, width=None):
help='Show a FITS extension in the raw file. Note --proc and --mosaic '
'will not work with this option.')
parser.add_argument('--det', type=str, default='1', nargs='*',
help='Detector(s) to show. If more than one, the list of detectors '
'must be one of the allowed mosaics hard-coded for the selected '
help='Detector(s) to show. If more than one, the list of detectors, i.e. --det 4 8 '
'to show detectors 4 and 8. This combination must be one of the allowed '
'mosaics hard-coded for the selected '
'spectrograph. Using "mosaic" for gemini_gmos, keck_deimos, or '
'keck_lris will show the mosaic of all detectors.')
parser.add_argument('--chname', type=str, default='Image', help='Name of Ginga tab')
parser.add_argument('--embed', default=False, action='store_true',
help='Upon completion embed in ipython shell')
return parser

@staticmethod
Expand Down Expand Up @@ -126,3 +130,6 @@ def main(args):
display.show_image(img, chname=args.chname)


if args.embed:
embed(header=utils.embed_header())

0 comments on commit 7d9d748

Please sign in to comment.