Skip to content

Move key-binding descriptions from class docstring to pypeit_show_1dspec description#2089

Open
kbwestfall wants to merge 3 commits intopypeit:releasefrom
kbwestfall:spec1d_docs
Open

Move key-binding descriptions from class docstring to pypeit_show_1dspec description#2089
kbwestfall wants to merge 3 commits intopypeit:releasefrom
kbwestfall:spec1d_docs

Conversation

@kbwestfall
Copy link
Collaborator

As titled. This is primarily a documentation PR that is directly to release, and it includes some changelog comments related to #2079.

I'll tag and release version 2.0.1, assuming this passes tests.

@kbwestfall
Copy link
Collaborator Author

@ejeschke Somewhat related to this, the connect_to_ginga function in pypeit/display/display.py will call

subprocess.Popen(['ginga', f'--rcport={port}',  '--modules=RC,SlitWavelength'])

If it can't connect to an already open ginga window. Should this instead be:

subprocess.Popen(['ginga', f'--rcport={port}',  '--modules=RC,SlitWavelength,Spec1dView'])

?

Copy link
Collaborator

@debora-pe debora-pe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kbwestfall!


This is a short-cut of sorts to pull the object you want without
typing in its name.
Enter the mode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this @kbwestfall!
One thing that I keep forgetting when I use pypeit_show_1dspec is how to show the help screen on the side with all the relevant bindings.
Do you mind adding here that, after entering the mode, by typing h in the plot window ginga will show the help on the side?

@@ -107,7 +122,7 @@ def main(cls, args):
if args.obj is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

        if args.obj is not None:
            exten = np.where(sobjs.NAME == args.obj)[0][0]
        else:
            exten = args.exten-1 # 1-index in FITS file
        if exten < 0:
            raise PypeItError(f"Bad input extension/object name: {args.obj}")

See :ref:`pypeit_show_1dspec_interact` for interactivity implemented here.
"""

# Needs to be set by reference viewer (via set_shell_ref) before any
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbwestfall , I don't think you should remove this help docstring. It is used by Ginga to show help for that pypeit special mode when a person types 'h'. I suppose we could add a special command to fetch the help from somewhere else, but I would be a little concerned that we bypassed the internal help system.

@ejeschke
Copy link
Collaborator

If it can't connect to an already open ginga window. Should this instead be:

subprocess.Popen(['ginga', f'--rcport={port}', '--modules=RC,SlitWavelength,Spec1dView'])

?

No, doesn't need to because Spec1dView registers itself via PypeIt as a plugin, and the plugin is available and invoked by pypeit_show_1dspec. I think SlitWavelength could probably be treated the same way, if we modify the relevant pypeit "show_" scripts. The RC plugin needs to be passed with --modules because it is not set to auto-start by default. That also very likely could be automated in the "show" scripts; I could take a look at that.

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

Successfully merging this pull request may close these issues.

4 participants