Keck-DataReductionPipelines / MosfireDRP

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

Keep getting out of bound index errors while trying to reduce longslit data in K #111

Closed apetric2017 closed 6 years ago

apetric2017 commented 6 years ago

I installed the most recent pipeline version a few weeks ago so am using the 2018 version on a mac running OS X 10.11.6 . I installed python 3.6 with anaconda as advised in the MOSFIRE DRP documentation.

My data are K longslit. I first got this error:

File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Flats.py", line 228, in make_pixel_flat flat[i,hpps[0]:hpps[1]] = v IndexError: index 2048 is out of bounds for axis 0 with size 2048

I changed # for i in np.arange(bottom-1, top): to for i in np.arange(0, top-bottom):

which did the trick.

I then restarted the driver and hit on a similar error this time in Wavelength.py

File "Red_Morg1a.py", line 47, in Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Wavelength.py", line 925, in apply_lambda_simple sigs[lp[j],:] = lm[j]

I was advised to only use the Ne lamps so I commented the Ar.text references and the wavenames2='Ar.txt' from the Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, wavenames2=‘Ar.txt') and tried to do the wavelength calibration interactively.

I did this but the error persisted and the code in Wavelength.py is not as obvious to me as the one in Flats.py.

Would you advise I try to modify the Wavelength.py code or am I doing something else wrong?

Many thanks in advance.

lucarizzi commented 6 years ago

Hi Thank you for this report

Can you tell us which night/mask you are trying to reduce ?

We can try to reproduce the issue and look into it

On Mar 13, 2018, at 8:43 PM, apetric2017 notifications@github.com wrote:

I installed the most recent pipeline version a few weeks ago so am using the 2018 version on a mac running OS X 10.11.6 . I installed python 3.6 with anaconda as advised in the MOSFIRE DRP documentation.

My data are K longslit. I first got this error:

File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Flats.py", line 228, in make_pixel_flat flat[i,hpps[0]:hpps[1]] = v IndexError: index 2048 is out of bounds for axis 0 with size 2048

I changed # for i in np.arange(bottom-1, top): to for i in np.arange(0, top-bottom):

which did the trick.

I then restarted the driver and hit on a similar error this time in Wavelength.py

File "Red_Morg1a.py", line 47, in Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Wavelength.py", line 925, in apply_lambda_simple sigs[lp[j],:] = lm[j]

I was advised to only use the Ne lamps so I commented the Ar.text references and the wavenames2='Ar.txt' from the Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, wavenames2=‘Ar.txt') and tried to do the wavelength calibration interactively.

I did this but the error persisted and the code in Wavelength.py is not as obvious to me as the one in Flats.py.

Would you advise I try to modify the Wavelength.py code or am I doing something else wrong?

Many thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

apetric2017 commented 6 years ago

Many thanks Luca, I’m trying to reduce longslit data taken 2017sep10, K-band.

On Mar 14, 2018, at 6:06 PM, lucarizzi notifications@github.com wrote:

Hi Thank you for this report

Can you tell us which night/mask you are trying to reduce ?

We can try to reproduce the issue and look into it

On Mar 13, 2018, at 8:43 PM, apetric2017 notifications@github.com wrote:

I installed the most recent pipeline version a few weeks ago so am using the 2018 version on a mac running OS X 10.11.6 . I installed python 3.6 with anaconda as advised in the MOSFIRE DRP documentation.

My data are K longslit. I first got this error:

File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Flats.py", line 228, in make_pixel_flat flat[i,hpps[0]:hpps[1]] = v IndexError: index 2048 is out of bounds for axis 0 with size 2048

I changed # for i in np.arange(bottom-1, top): to for i in np.arange(0, top-bottom):

which did the trick.

I then restarted the driver and hit on a similar error this time in Wavelength.py

File "Red_Morg1a.py", line 47, in Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Wavelength.py", line 925, in apply_lambda_simple sigs[lp[j],:] = lm[j]

I was advised to only use the Ne lamps so I commented the Ar.text references and the wavenames2='Ar.txt' from the Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, wavenames2=‘Ar.txt') and tried to do the wavelength calibration interactively.

I did this but the error persisted and the code in Wavelength.py is not as obvious to me as the one in Flats.py.

Would you advise I try to modify the Wavelength.py code or am I doing something else wrong?

Many thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373254351, or mute the thread https://github.com/notifications/unsubscribe-auth/AcXbwBhxCN4yhstRdWASV36enS-jDJX9ks5teeivgaJpZM4Spqz0.

KeckDRP commented 6 years ago

Ok thank you.

I will look at this first thing next week. Sorry I cannot get to it earlier

Luca

On Mar 15, 2018, at 1:04 AM, apetric2017 notifications@github.com wrote:

Many thanks Luca, I’m trying to reduce longslit data taken 2017sep10, K-band.

On Mar 14, 2018, at 6:06 PM, lucarizzi <notifications@github.com mailto:notifications@github.com> wrote:

Hi Thank you for this report

Can you tell us which night/mask you are trying to reduce ?

We can try to reproduce the issue and look into it

On Mar 13, 2018, at 8:43 PM, apetric2017 <notifications@github.com mailto:notifications@github.com> wrote:

I installed the most recent pipeline version a few weeks ago so am using the 2018 version on a mac running OS X 10.11.6 . I installed python 3.6 with anaconda as advised in the MOSFIRE DRP documentation.

My data are K longslit. I first got this error:

File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Flats.py", line 228, in make_pixel_flat flat[i,hpps[0]:hpps[1]] = v IndexError: index 2048 is out of bounds for axis 0 with size 2048

I changed # for i in np.arange(bottom-1, top): to for i in np.arange(0, top-bottom):

which did the trick.

I then restarted the driver and hit on a similar error this time in Wavelength.py

File "Red_Morg1a.py", line 47, in Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Wavelength.py", line 925, in apply_lambda_simple sigs[lp[j],:] = lm[j]

I was advised to only use the Ne lamps so I commented the Ar.text references and the wavenames2='Ar.txt' from the Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, wavenames2=‘Ar.txt') and tried to do the wavelength calibration interactively.

I did this but the error persisted and the code in Wavelength.py is not as obvious to me as the one in Flats.py.

Would you advise I try to modify the Wavelength.py code or am I doing something else wrong?

Many thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373254351 https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373254351>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AcXbwBhxCN4yhstRdWASV36enS-jDJX9ks5teeivgaJpZM4Spqz0 https://github.com/notifications/unsubscribe-auth/AcXbwBhxCN4yhstRdWASV36enS-jDJX9ks5teeivgaJpZM4Spqz0>.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373261866, or mute the thread https://github.com/notifications/unsubscribe-auth/AI6VGw9-WEtoxnRdtxcxXpZ9ptCNHLNwks5tefZwgaJpZM4Spqz0.

apetric2017 commented 6 years ago

I’m at CFHT, do you think there’s anyway I could just pop in at Keck whenever you are available next week?

On Mar 15, 2018, at 4:27 PM, MosfireDRP notifications@github.com wrote:

Ok thank you.

I will look at this first thing next week. Sorry I cannot get to it earlier

Luca

On Mar 15, 2018, at 1:04 AM, apetric2017 notifications@github.com wrote:

Many thanks Luca, I’m trying to reduce longslit data taken 2017sep10, K-band.

On Mar 14, 2018, at 6:06 PM, lucarizzi <notifications@github.com mailto:notifications@github.com> wrote:

Hi Thank you for this report

Can you tell us which night/mask you are trying to reduce ?

We can try to reproduce the issue and look into it

On Mar 13, 2018, at 8:43 PM, apetric2017 <notifications@github.com mailto:notifications@github.com> wrote:

I installed the most recent pipeline version a few weeks ago so am using the 2018 version on a mac running OS X 10.11.6 . I installed python 3.6 with anaconda as advised in the MOSFIRE DRP documentation.

My data are K longslit. I first got this error:

File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Flats.py", line 228, in make_pixel_flat flat[i,hpps[0]:hpps[1]] = v IndexError: index 2048 is out of bounds for axis 0 with size 2048

I changed # for i in np.arange(bottom-1, top): to for i in np.arange(0, top-bottom):

which did the trick.

I then restarted the driver and hit on a similar error this time in Wavelength.py

File "Red_Morg1a.py", line 47, in Wavelength.apply_lambda_simple(maskname, band, obsfiles, waveops,longslit=longslit) File "/anaconda2/envs/mospy_2018_macos/lib/python3.6/site-packages/MOSFIRE-1.0.dev0-py3.6.egg/MOSFIRE/Wavelength.py", line 925, in apply_lambda_simple sigs[lp[j],:] = lm[j]

I was advised to only use the Ne lamps so I commented the Ar.text references and the wavenames2='Ar.txt' from the Wavelength.fit_lambda(maskname, band, 'Ne.txt', 'Ne.txt', waveops, wavenames2=‘Ar.txt') and tried to do the wavelength calibration interactively.

I did this but the error persisted and the code in Wavelength.py is not as obvious to me as the one in Flats.py.

Would you advise I try to modify the Wavelength.py code or am I doing something else wrong?

Many thanks in advance.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373254351 https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373254351>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AcXbwBhxCN4yhstRdWASV36enS-jDJX9ks5teeivgaJpZM4Spqz0 https://github.com/notifications/unsubscribe-auth/AcXbwBhxCN4yhstRdWASV36enS-jDJX9ks5teeivgaJpZM4Spqz0>.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373261866, or mute the thread https://github.com/notifications/unsubscribe-auth/AI6VGw9-WEtoxnRdtxcxXpZ9ptCNHLNwks5tefZwgaJpZM4Spqz0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373584009, or mute the thread https://github.com/notifications/unsubscribe-auth/AcXbwCpf-EQz3zRbxY0XhCtpLdXJginLks5teyL-gaJpZM4Spqz0.

joshwalawender commented 6 years ago

It looks to me as if the polynomial fit to the top of the slit is not restricted anywhere to be on the detector, so under some conditions it leads to the top pixel (from the fit) being off the detector causing an indexing error. I've added PR #113 to try to address this.

@apetric2017 You can try to download the DRP from my branch or just edit the one line that has changes, which I think you can see in PR #113. In either case, you'll have to reinstall the DRP and re-run it. I'm running your data through it now and it appears to be progressing past that step though I haven't examined the results yet.

apetric2017 commented 6 years ago

On Mar 16, 2018, at 1:19 PM, Josh Walawender notifications@github.com wrote:

It looks to me as if the polynomial fit to the top of the slit is not restricted anywhere to be on the detector, so under some conditions it leads to the top pixel (from the fit) being off the detector causing an indexing error. I've added PR #113 https://github.com/Keck-DataReductionPipelines/MosfireDRP/pull/113 to try to address this.

@apetric2017 https://github.com/apetric2017 You can try to download the DRP from my branch https://github.com/joshwalawender/MosfireDRP/tree/longslit_fix or just edit the one line that has changes, which I think you can see in PR #113 https://github.com/Keck-DataReductionPipelines/MosfireDRP/pull/113. In either case, you'll have to reinstall the DRP and re-run it. I'm running your data through it now and it appears to be progressing past that step though I haven't examined the results yet.

Awesome. Will do. Many thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Keck-DataReductionPipelines/MosfireDRP/issues/111#issuecomment-373869977, or mute the thread https://github.com/notifications/unsubscribe-auth/AcXbwOhAU-4PYO7YlMnQIqk6DOm0iToeks5tfEhogaJpZM4Spqz0.

joshwalawender commented 6 years ago

This fix is now incorporated in the dev branch and is slated for the next major release.