Skip to content

Spectrum1D WCS has wrong number of dimensions as an NDCube #1108

@gterreran

Description

@gterreran

As per title, it looks like that the dimensions of the WCS of Spectrum1D objects are not parsed correctly into the NDCube data class, as shown by the following snippet:

import numpy as np
import astropy.units as u
from specutils import Spectrum1D
from astropy.modeling import models

wl = np.linspace(4000,12000,128)*u.angstrom
flux_1 = models.BlackBody(temperature=5800*u.K)(wl)
flux_2 = models.BlackBody(temperature=4800*u.K)(wl)
flux_3 = models.BlackBody(temperature=6800*u.K)(wl)
flux = np.array([flux_1, flux_2, flux_3])*flux_1.unit

spec = Spectrum1D(spectral_axis=wl, flux=flux)
print(spec.wcs.pixel_n_dim)

which returns

1

while it should be 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions