Keck-DataReductionPipelines / MosfireDRP

http://keck-datareductionpipelines.github.io/MosfireDRP
10 stars 13 forks source link

Disabled Keyboard Keys in Interactive Fitting #110

Open kccooke opened 6 years ago

kccooke commented 6 years ago

I recently downloaded the Mosfire DRP and began working through the tutorial data, but have reached a problem during the `interactive wavelength fitting' section on page 15 of the manual in which interactive commands do not function. All previous steps regarding flats and combining files prior to wavelength calibration worked.

First, the guide instructs me to uncomment the line:

"#Wavelength.fit_lambda(maskname, band, obsfiles, obsfiles, waveops)"

Which did not produce any UI windows. Thinking this was a typo, I instead uncommented:

"#Wavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops, noninteractive=noninteractiveflag)"

This produced a plot similar to Figure. 5 in the Manual, but none of the keyboard commands (such as d for delete point, b for bypass) do anything. To troubleshoot this, I sent my tutorial files and Driver.py file to a collaborator who is using the Python 2.7 version and the interactive commands worked. Is there a known issue with the current DRP version using Python 3?

I am running versions: python version = 3.6.3 numpy version = 1.13.3 matplotlib version = 2.1.1 astropy version = 2.0.3 ccdproc version = 1.3.0

joshwalawender commented 6 years ago

@kccooke Interesting. The interactive commands are working for me (python3 installed via anaconda on macOS). What OS are you using? What was your python and DRP install method? Do you have the latest version of the DRP (that is the only one which is python 3 compatible)?

The manual is slightly out of date on that page (we need to fix that): when I run the AutoDriver step, I do not need to uncomment anything. The noninteractiveflag=False line controls whether the fitting is interactive or not.

kccooke commented 6 years ago

Thank you for bringing up AutoDriver! I think I found what the problem was. I had initially copied the default Driver file from the Drivers directory as directed by page 11 of the documentation as part of the tutorial on how to build up a driver file on my own. However, when AutoDriver makes one, an additional two lines are included at the start of the script:

import matplotlib matplotlib.use('TkAgg') # Force TkAgg backend for interactivity. This is

critical to bypass a bug in the MacOSX backend.

I see this was needed for errors back in 2016 and was subsequently fixed for others. This may be due to my older operating system. For reference, I'm running OS X Yosemite 10.10.5, and I installed Python 3 and DRP installed using the anaconda method currently on the wiki, so believe it's the most up to date method.

joshwalawender commented 6 years ago

I think this is an easy mistake to make, so I've submitted PR #114 to update the documentation. It keeps the section about the manual driver files, but makes it a sub-section of the AutoDriver discussion and explicitly states that it is for reference purposes only and that AutoDriver is the supported method.