astropy / astropy/specutils

Error Spectrum1D object creation (ufunc 'isnan' not supported for the input types)

Open
#1,007 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
204
Forks
134
Avg merge
12h 55m
Merged PRs (30d)
1

Description

Dear Community,
I'm trying to create a Spectrum1D object from a MUSE datacube (after suming over the two spatial dimensions) through
`lamb = lambdas`
`flux = sp1`
`spec = Spectrum1D(spectral_axis=lamb, flux=flux) `

However, I´me getting this error, when I've checked that sp1 `(sp1 = cube.sum(axis=(1,2)))` is a numpy array with no NaNs.

`TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''`

Kind Rgds
Jose

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `Spectrum1D(spectral_axis=lamb, flux=flux)` call using the MUSE-derived arrays and inspect the types of both inputs, especially `lambdas` and `sp1`. No repository file or test is named; done should identify the incompatible input and establish a reproducible test or clear supported-input behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.