{"action":"created","issue":{"url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/20","labels_url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/20/comments","events_url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/20/events","html_url":"https://github.com/Mosfire-DataReductionPipeline/MosfireDRP/issues/20","id":72293528,"number":20,"title":"ValueError during interactive wavelength fitting","user":{"login":"athoag","id":5640004,"avatar_url":"https://avatars.githubusercontent.com/u/5640004?v=3","gravatar_id":"","url":"https://api.github.com/users/athoag","html_url":"https://github.com/athoag","followers_url":"https://api.github.com/users/athoag/followers","following_url":"https://api.github.com/users/athoag/following{/other_user}","gists_url":"https://api.github.com/users/athoag/gists{/gist_id}","starred_url":"https://api.github.com/users/athoag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athoag/subscriptions","organizations_url":"https://api.github.com/users/athoag/orgs","repos_url":"https://api.github.com/users/athoag/repos","events_url":"https://api.github.com/users/athoag/events{/privacy}","received_events_url":"https://api.github.com/users/athoag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T22:04:59Z","updated_at":"2015-04-30T22:48:24Z","closed_at":null,"body":"Hi, this is my first attempt to reduce MOSFIRE data using the pipeline now available on GitHub (downloaded today 4/30/2015). I have been able to successfully reduce data previously using and older release of the DRP, which I downloaded in December 2013.\r\n\r\nI am currently running OS X 10.9.5 with Ureka python 1.5.1. I also see the issue see on OS X 10.9.2  (laptop) with the same version of Ureka installed.\r\n\r\nI am following through the documentation (https://mosfire-datareductionpipeline.github.io/MosfireDRP/MOSFIRE_DRP_Manual.docx) available for the current DRP release, and I see expected behavior up to the interactive wavelength fitting step described on pages 10-13 of the documentation.\r\n\r\nThe issue arises when I run the following line in the driver file that I have been editing: \r\nWavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops)\r\n\r\nI get what looks like a healthy initialization of this funciton, where the offset files are loaded:\r\n\r\nLoading: Offset_1.25.txt\r\nLoading: Offset_-1.25.txt\r\n\r\nand then a list of files contained in the offset files is printed (I will not show them for brevity), followed by the lines:\r\n\r\nStarted interactive solution\r\nExtracting at 1990 \r\nLaunching graphics display.    \r\nWaiting\r\n\r\nThe python figure pops up and I see a spectrum in the correct band with a bunch of easily recognizable sky lines and red vertical lines. All of the key options that appear upon pressing the \"h\" key appear to work normally except for the fitting buttons, which are listed as \"f\" and \"/\". In the documentation (https://mosfire-datareductionpipeline.github.io/MosfireDRP/MOSFIRE_DRP_Manual.docx) under \"MAJOR BUGFIXES\" on page 1, it appears that \"/\" is now the preferred key to fit the spectrum, whereas \"f\" was preferred in the previous release I was using.\r\n\r\nWhen I press \"/\" only the x,y pair at the cursor location is returned and no fit is performed; I do not see any points appear in the bottom subfigure, which remains blank white. Pressing \"f\" also prints the x,y pair, but also returns the following long traceback, ultimately leading to a ValueError in one of numpy's core modules:\r\n\r\nf 9792.98764132 62.8975535168\r\nFitting\r\nException in Tkinter callback\r\nTraceback (most recent call last):\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/lib-tk/Tkinter.py\", line 1470, in __call__\r\n    return self.func(*args)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/backends/backend_tkagg.py\", line 484, in key_press\r\n    FigureCanvasBase.key_press_event(self, key, guiEvent=event)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/backend_bases.py\", line 1816, in key_press_event\r\n    self.callbacks.process(s, event)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/cbook.py\", line 540, in process\r\n    proxy(*args, **kwargs)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/cbook.py\", line 415, in __call__\r\n    return mtd(*args, **kwargs)\r\n  File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1930, in __call__\r\n    actions_mouseless[kp](x, y)\r\n  File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1879, in fit_event\r\n    self.spec, self.options)\r\n  File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1454, in find_known_lines\r\n    error=istd)\r\n  File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Fit.py\", line 153, in mpfitpeak\r\n    return mpfit.mpfit(gaussian_residuals, parinfo=parinfo, functkw=fa, quiet=1)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 1158, in __init__\r\n    delta, wa1, wa2, par=par)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 2088, in lmpar\r\n    [r, x, sdiag] = self.qrsolv(r, ipvt, wa1, qtb, sdiag)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 1915, in qrsolv\r\n    numpy.put(x, ipvt, wa)\r\n  File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/numpy/core/fromnumeric.py\", line 444, in put\r\n    return a.put(ind, v, mode)\r\nValueError: put: output array is read-only\r\n\r\n\r\n\r\nI have been able to get around this by altering my \"fromnumeric.py\" function, turning the error-causing line:\r\n\r\nreturn a.put(ind,v,mode)\r\n\r\ninto a try, except ValueError pair. However, I do not like this as a permanent solution as it involves changing a function external to the DRP, particularly one that I use a lot elsewhere. And while the fitting after this \"fix\" appears to work, I get a slew of warnings and the next step in the Driver file fails anyway.\r\n\r\nSincerely,\r\nAustin Hoag"},"comment":{"url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/comments/97992382","html_url":"https://github.com/Mosfire-DataReductionPipeline/MosfireDRP/issues/20#issuecomment-97992382","issue_url":"https://api.github.com/repos/Mosfire-DataReductionPipeline/MosfireDRP/issues/20","id":97992382,"user":{"login":"lucarizzi","id":524957,"avatar_url":"https://avatars.githubusercontent.com/u/524957?v=3","gravatar_id":"","url":"https://api.github.com/users/lucarizzi","html_url":"https://github.com/lucarizzi","followers_url":"https://api.github.com/users/lucarizzi/followers","following_url":"https://api.github.com/users/lucarizzi/following{/other_user}","gists_url":"https://api.github.com/users/lucarizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/lucarizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucarizzi/subscriptions","organizations_url":"https://api.github.com/users/lucarizzi/orgs","repos_url":"https://api.github.com/users/lucarizzi/repos","events_url":"https://api.github.com/users/lucarizzi/events{/privacy}","received_events_url":"https://api.github.com/users/lucarizzi/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T22:48:24Z","updated_at":"2015-04-30T22:48:24Z","body":"Dear Austin\nI am currently on vacation but I will be able to help you soon. \nQuick question: did you download the official released version which is linked from the misfire webpage we host at keck, or did you clone the development version directly from github ? \nIn this second case, may I advise that you try again with the official release ?\n\nThank you \nLuca Rizzi\n\n\n> On Apr 30, 2015, at 12:04 PM, Austin Hoag <notifications@github.com> wrote:\n> \n> Hi, this is my first attempt to reduce MOSFIRE data using the pipeline now available on GitHub (downloaded today 4/30/2015). I have been able to successfully reduce data previously using and older release of the DRP, which I downloaded in December 2013.\n> \n> I am currently running OS X 10.9.5 with Ureka python 1.5.1. I also see the issue see on OS X 10.9.2 (laptop) with the same version of Ureka installed.\n> \n> I am following through the documentation (https://mosfire-datareductionpipeline.github.io/MosfireDRP/MOSFIRE_DRP_Manual.docx) available for the current DRP release, and I see expected behavior up to the interactive wavelength fitting step described on pages 10-13 of the documentation.\n> \n> The issue arises when I run the following line in the driver file that I have been editing: \n> Wavelength.fit_lambda_interactively(maskname, band, obsfiles,waveops)\n> \n> I get what looks like a healthy initialization of this funciton, where the offset files are loaded:\n> \n> Loading: Offset_1.25.txt\n> Loading: Offset_-1.25.txt\n> \n> and then a list of files contained in the offset files is printed (I will not show them for brevity), followed by the lines:\n> \n> Started interactive solution\n> Extracting at 1990 \n> Launching graphics display.\n> \n> Waiting\n> \n> The python figure pops up and I see a spectrum in the correct band with a bunch of easily recognizable sky lines and red vertical lines. All of the key options that appear upon pressing the \"h\" key appear to work normally except for the fitting buttons, which are listed as \"f\" and \"/\". In the documentation (https://mosfire-datareductionpipeline.github.io/MosfireDRP/MOSFIRE_DRP_Manual.docx) under \"MAJOR BUGFIXES\" on page 1, it appears that \"/\" is now the preferred key to fit the spectrum, whereas \"f\" was preferred in the previous release I was using.\n> \n> When I press \"/\" only the x,y pair at the cursor location is returned and no fit is performed; I do not see any points appear in the bottom subfigure, which remains blank white. Pressing \"f\" also prints the x,y pair, but also returns the following long traceback, ultimately leading to a ValueError in one of numpy's core modules:\n> \n> f 9792.98764132 62.8975535168\n> Fitting\n> Exception in Tkinter callback\n> Traceback (most recent call last):\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/lib-tk/Tkinter.py\", line 1470, in call\n> return self.func(args)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/backends/backend_tkagg.py\", line 484, in key_press\n> FigureCanvasBase.key_press_event(self, key, guiEvent=event)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/backend_bases.py\", line 1816, in key_press_event\n> self.callbacks.process(s, event)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/cbook.py\", line 540, in process\n> proxy(args, *kwargs)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/matplotlib-1.4.2-py2.7-macosx-10.6-x86_64.egg/matplotlib/cbook.py\", line 415, in call\n> return mtd(args, **kwargs)\n> File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1930, in call\n> actions_mouselesskp\n> File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1879, in fit_event\n> self.spec, self.options)\n> File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Wavelength.py\", line 1454, in find_known_lines\n> error=istd)\n> File \"/Users/Austin/MOSFIRE/DRP_CODE/MOSFIRE/Fit.py\", line 153, in mpfitpeak\n> return mpfit.mpfit(gaussian_residuals, parinfo=parinfo, functkw=fa, quiet=1)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 1158, in init\n> delta, wa1, wa2, par=par)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 2088, in lmpar\n> [r, x, sdiag] = self.qrsolv(r, ipvt, wa1, qtb, sdiag)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/stsci.tools-3.2.2-py2.7.egg/stsci/tools/nmpfit.py\", line 1915, in qrsolv\n> numpy.put(x, ipvt, wa)\n> File \"/Users/Austin/progs/Ureka/python/lib/python2.7/site-packages/numpy/core/fromnumeric.py\", line 444, in put\n> return a.put(ind, v, mode)\n> ValueError: put: output array is read-only\n> \n> I have been able to get around this by altering my \"fromnumeric.py\" function, turning the error-causing line:\n> \n> return a.put(ind,v,mode)\n> \n> into a try, except ValueError pair. However, I do not like this as a permanent solution as it involves changing a function external to the DRP, particularly one that I use a lot elsewhere. And while the fitting after this \"fix\" appears to work, I get a slew of warnings and the next step in the Driver file fails anyway.\n> \n> Sincerely,\n> Austin Hoag\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}