{"action":"created","issue":{"url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/113","labels_url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/113/comments","events_url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/113/events","html_url":"https://github.com/pyspeckit/pyspeckit/pull/113","id":115562097,"number":113,"title":"specfit.measure_approximate_fwhm() emission=False fails","user":{"login":"munazzaalam","id":3017712,"avatar_url":"https://avatars.githubusercontent.com/u/3017712?v=3","gravatar_id":"","url":"https://api.github.com/users/munazzaalam","html_url":"https://github.com/munazzaalam","followers_url":"https://api.github.com/users/munazzaalam/followers","following_url":"https://api.github.com/users/munazzaalam/following{/other_user}","gists_url":"https://api.github.com/users/munazzaalam/gists{/gist_id}","starred_url":"https://api.github.com/users/munazzaalam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munazzaalam/subscriptions","organizations_url":"https://api.github.com/users/munazzaalam/orgs","repos_url":"https://api.github.com/users/munazzaalam/repos","events_url":"https://api.github.com/users/munazzaalam/events{/privacy}","received_events_url":"https://api.github.com/users/munazzaalam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-06T18:35:20Z","updated_at":"2015-11-11T14:13:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pyspeckit/pyspeckit/pulls/113","html_url":"https://github.com/pyspeckit/pyspeckit/pull/113","diff_url":"https://github.com/pyspeckit/pyspeckit/pull/113.diff","patch_url":"https://github.com/pyspeckit/pyspeckit/pull/113.patch"},"body":"I'm trying to use `measure_approximate_fwhm()` to measure FWHM for a set of absorption lines. The following code runs, but yields an extremely small measurement (`fwhm = 0.00899764977619`). \r\n   \r\n    sp = pyspeckit.Spectrum(filename)\r\n    sp.xarr.units = 'micron'\r\n    sp.xarr.xtype = 'wavelength'\r\n    sp.plotter(xmin=1.250, xmax=1.255, ymin=0, errstyle = 'fill', color='black')      \r\n    sp.specfit(plot=True, fittype='voigt', color='blue')\r\n    fwhm = sp.specfit.measure_approximate_fwhm(threshold='error', emission=True, interpolate_factor=1024, plot=True, grow_threshold=1)\r\n    sp.plotter.refresh()\r\n    print fwhm\r\n    xarr_fit_units = 'microns'\r\n    plt.ylabel('Normalized Flux')\r\n    plt.xlabel('Wavelength ($\\mu m$)')\r\n\r\nIt seems like the code is incorrectly calculating the FWHM, since the line that should be drawn at the FWHM is well below the feature (see figure below). Also, `emission=False` gives `ValueError: No valid data included in FWHM computation`.\r\n\r\n![fwhm](https://cloud.githubusercontent.com/assets/3017712/11005304/fba368ca-848a-11e5-906d-2e333e22dd1a.png)\r\n"},"comment":{"url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/comments/155793858","html_url":"https://github.com/pyspeckit/pyspeckit/pull/113#issuecomment-155793858","issue_url":"https://api.github.com/repos/pyspeckit/pyspeckit/issues/113","id":155793858,"user":{"login":"keflavich","id":143715,"avatar_url":"https://avatars.githubusercontent.com/u/143715?v=3","gravatar_id":"","url":"https://api.github.com/users/keflavich","html_url":"https://github.com/keflavich","followers_url":"https://api.github.com/users/keflavich/followers","following_url":"https://api.github.com/users/keflavich/following{/other_user}","gists_url":"https://api.github.com/users/keflavich/gists{/gist_id}","starred_url":"https://api.github.com/users/keflavich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keflavich/subscriptions","organizations_url":"https://api.github.com/users/keflavich/orgs","repos_url":"https://api.github.com/users/keflavich/repos","events_url":"https://api.github.com/users/keflavich/events{/privacy}","received_events_url":"https://api.github.com/users/keflavich/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T14:13:42Z","updated_at":"2015-11-11T14:13:42Z","body":"@munazzaalam actually, the error you're getting indicates that you are not using this branch.  See https://github.com/keflavich/pyspeckit/blob/2673896cfcd2fad434475e8e8b3521f22d3b775d/pyspeckit/spectrum/fitters.py#L1914, which is the fix to the line where you're seeing an error"}}