Skip to content

JWST spectrum reading question #1242

Open
@keflavich

Description

@keflavich

Loading a JWST spectrum, I get data with MJy/sr units:

>>> spec = specutils.Spectrum.read('jw05804-o039_t011_nirspec_prism-clear/jw05804-o039_t011_nirspec_prism-clear_x1d.fits')
>>> spec.unit
Unit("MJy / sr")

but the flux column has Jy units:

    WAVELENGTH              FLUX                FLUX_ERROR      FLUX_VAR_POISSON FLUX_VAR_RNOISE FLUX_VAR_FLAT     SURF_BRIGHT      ...   DQ        BACKGROUND          BKGD_ERROR     BKGD_VAR_POISSON BKGD_VAR_RNOISE BKGD_VAR_FLAT NPIXELS
        um                   Jy                     Jy                Jy2              Jy2            Jy2            MJy / sr       ...              MJy / sr            MJy / sr         (MJy/sr)^2       (MJy/sr)^2     (MJy/sr)^2
     float64              float64                float64            float64          float64        float64          float64        ... uint32       float64             float64           float64          float64        float64    float64
------------------ ---------------------- --------------------- ---------------- --------------- ------------- -------------------- ... ------ ------------------- ------------------- ---------------- --------------- ------------- -------
0.6025000237859786 4.6011916422906044e-05 5.013773555819315e-05              0.0             0.0           0.0 0.045096075097084465 ...      0 0.07041636376462115 0.04816933753815392              0.0             0.0           0.0  4341.0
0.6075000236742198  8.339269703115367e-05 2.940493824189401e-05              0.0             0.0           0.0  0.08173281228497456 ...      0 0.10750291443929709 0.02761201367018343              0.0             0.0           0.0  4341.0

Is this a bug? The tests seem to imply that the units should be Jy:

@pytest.mark.filterwarnings(r'ignore:.*did not parse as fits unit')
@pytest.mark.filterwarnings('ignore:SRCTYPE is missing or UNKNOWN')
@remote_access([
{'id': "5394931", 'filename':"jw00623-c1012_t002_miri_p750l_x1d.fits"}, # pipeline 1.2.3
{'id': "5394931", 'filename':"jw00787-o014_s00002_niriss_f150w-gr150c-gr150r_c1d.fits"}, # pipeline 1.2.3
{'id': "5394931", 'filename':"jw00623-o057_t008_miri_ch1-long_x1d.fits"}, # pipeline 1.3.1
{'id': "5394931", 'filename':"jw00626-o064_t007_nirspec_g235h-f170lp_x1d.fits"}, # pipeline 1.3.1
])
def test_jwst_x1d_c1d(remote_data_path):
data = Spectrum.read(remote_data_path)
assert isinstance(data, Spectrum)
assert data.shape in [(388,), (5,), (1091,), (3843,)]
assert data.unit == u.Jy
assert data.spectral_axis.unit == u.um

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