sunpy / sunraster

A SunPy-affiliated package which provides tools to analyze data from spectral data from any solar mission.
BSD 2-Clause "Simplified" License
20 stars 26 forks source link

read_spice_l2_fits #236

Closed takucera closed 1 year ago

takucera commented 1 year ago

Provide a general description of the issue or problem.

Hi, I am having trouble with read_spice_l2_fits. I am getting the error below. I am thinking it might be a package dependency problem, because other people are not getting the error, but I don't know the problem. I am using ndcube 2.1.1, sunraster 0.4.2, astropy 5.2.2, sunny 4.1.4. Any idea what I am doing wrong?

Sorry this is really a help request, but it seems like a very sunraster specific problem.

File ~/mambaforge/envs/so_proc/lib/python3.10/site-packages/sunraster/instr/spice.py:210, in _read_single_spice_l2_fits(filename, windows, memmap, read_dumbbells, output, spice_id) 208 wcs = WCS(new_header) 209 # Define exposure times from metadata. --> 210 exp_times = u.Quantity(np.zeros(hdu.data.shape[-1]) + meta.get("XPOSURE"), unit=u.s) 211 # Define data cube. 212 data = hdu.data

TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'

nabobalis commented 1 year ago

Hello,

Can you provide the file that is failing?

My impression is that meta.get("XPOSURE") is returning None but without the file to check, I can't say for sure.

takucera commented 1 year ago

Hi Nabil, I am using solo_L2_spice-n-ras_20220402T231536_V06_100664014-000.fits It is available in the solar orbiter archive, but I can put it on a google drive and share it with you if you give me a goggle-friendly email address. Terry

From: Nabil Freij @.> Reply-To: sunpy/sunraster @.> Date: Monday, April 10, 2023 at 5:01 PM To: sunpy/sunraster @.> Cc: Therese Kucera @.>, Author @.***> Subject: [EXTERNAL] [BULK] Re: [sunpy/sunraster] read_spice_l2_fits (Issue #236)

Hello,

Can you provide the file that is failing?

My impression is that meta.get("XPOSURE") is returning None but without the file to check, I can't say for sure.

— Reply to this email directly, view it on GitHubhttps://github.com/sunpy/sunraster/issues/236#issuecomment-1502318186, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQIINZ75MBTG2ZSVQRRAMTXARYJXANCNFSM6AAAAAAWZNCV3Y. You are receiving this because you authored the thread.Message ID: @.***>

nabobalis commented 1 year ago

My email address is nabil.freij@gmail.com if you can upload it there. That would be great.

ebuchlin commented 1 year ago

This must be because you are using sunraster 0.4.2, your issue looks like #208 which has been fixed in 0.4.3 (see the change log). If the problem persists with 0.4.3, it could be a similar issue with identification of the HDUs corresponding to spectral windows.

nabobalis commented 1 year ago

Ah good catch, not sure how I missed that. If you can update sunraster and see if that fails after.

takucera commented 1 year ago

OK, I was thinking it was a version issue. When in try to install or update it with conda, though, I just get 0.4.2 conda install --channel conda-forge sunraster or conda update sunraster

Am I doing something wrong with my installation?

From: ebuchlin @.> Reply-To: sunpy/sunraster @.> Date: Monday, April 10, 2023 at 6:15 PM To: sunpy/sunraster @.> Cc: Therese Kucera @.>, Author @.***> Subject: [EXTERNAL] [BULK] Re: [sunpy/sunraster] read_spice_l2_fits (Issue #236)

This must be because you are using sunraster 0.4.2, your issue looks like #208https://github.com/sunpy/sunraster/issues/208 which has been fixed in 0.4.3 (see the change loghttps://docs.sunpy.org/projects/sunraster/en/latest/changelog.html#id2). If the problem persists with 0.4.3, it could be a similar issue with identification of the HDUs corresponding to spectral windows.

— Reply to this email directly, view it on GitHubhttps://github.com/sunpy/sunraster/issues/236#issuecomment-1502399057, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQIIN5MUAUXN5ECKYHMA3TXASA7ZANCNFSM6AAAAAAWZNCV3Y. You are receiving this because you authored the thread.Message ID: @.***>

nabobalis commented 1 year ago

Oh it might be that the recipe was never updated. We use a bot to do an update for conda-forge but if that is missed then conda-forge never gets the update.

Let me check that.

nabobalis commented 1 year ago

Looks like the pull request was never merged. I lack access, I have asked the maintainers to do so.

Since both are in Europe, it will be tomorrow now.

nabobalis commented 1 year ago

Hello @takucera, the conda-forge recipe was just merged.

If you do an update, that should show up now and it will read the file.

If it does not, please let me know.

takucera commented 1 year ago

Yes, I just did that think morning. Thanks!

From: Nabil Freij @.> Reply-To: sunpy/sunraster @.> Date: Friday, April 14, 2023 at 11:16 AM To: sunpy/sunraster @.> Cc: Therese Kucera @.>, Mention @.***> Subject: [EXTERNAL] [BULK] Re: [sunpy/sunraster] read_spice_l2_fits (Issue #236)

Hello @takucerahttps://github.com/takucera, the conda-forge recipe was just merged.

If you do an update, that should show up now and it will read the file.

If it does not, please let me know.

— Reply to this email directly, view it on GitHubhttps://github.com/sunpy/sunraster/issues/236#issuecomment-1508772981, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQIIN33AEEHBGIHZROPQS3XBFS57ANCNFSM6AAAAAAWZNCV3Y. You are receiving this because you were mentioned.Message ID: @.***>