astropy / astropy/specutils

Bug in wcs1d-fits reader and flux_unit

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

Description

I'm pretty sure there's a bug in the wcs1d-fits reader. I have some spectra that have `BUNIT = erg/A/s/cm2`. This is not able to be parsed into `erg / (Angstrom s cm2)`, which I am "ok" with but the bigger issue is that if I give `flux_unit = u.Unit("erg / (angstrom s cm2)")` , I get an "unable to convert" error. The expected behavior is for flux_unit to IGNORE BUNIT, not try to convert to it. I'll upload an example file later.

Contributor guide

Open the contributing guide

Research direction

Start with the wcs1d-fits reader and reproduce the issue using BUNIT="erg/A/s/cm2" together with flux_unit=u.Unit("erg / (angstrom s cm2)"). Trace how flux_unit and BUNIT are handled; done means an explicit flux_unit bypasses BUNIT conversion without the unable-to-convert error, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.