Comments (7)
@shaileshahuja This is a simple 1D spectrum, but the FITS header has 3 degenerate axes. You can use wcs.sub
to drop all but the spectral axis:
header = fits.getheader('10074-190_HCOp.fits')
data = fits.getdata('10074-190_HCOp.fits')
w = wcs.WCS(header)
spectral_axis = w.naxis - 1 - w.wcs.spec # w.wcs.spec is FITS-order, 0-indexed
w_spec = w.sub([wcs.WCSSUB_SPECTRAL])
# this is the general case
slices = [slice(None)] + [0 for i in range(w.naxis-1)]
spectrum = data.swapaxes(0,spectral_axis)[slices]
# in this case, this would work fine:
spectrum = data.squeeze()
pyspeckit
's reader is non-general and simply assumes the first axis is the spectral one (with an override option).
from specutils.
Thanks @keflavich for your response. May I know where is this procedure to evaluate this kind of function defined? Any research paper?
from specutils.
The WCS features are recorded in the astropy docs. They derive from WCSlib. This isn't research-level stuff, it's definitions and standards.
from specutils.
Is there any place where this standard is defined? There are a lot of WCS keywords, and I am trying to find a place where these standard are detailed, including steps to follow to derive the world coordinates from logical coordinates
from specutils.
Yes!
The old IRAF standard is here:
http://iraf.noao.edu/projects/spectroscopy/formats/sptable.html
The FITS homepage is here:
http://fits.gsfc.nasa.gov/
especially Papers II and III; these actually define the standard officially:
http://fits.gsfc.nasa.gov/fits_wcs.html
I swear there was another link, but I can't find it right away...
from specutils.
So we figured out yesterday that most of the data contained in this file is described in http://www.aanda.org/index.php?option=com_article&access=bibcode&Itemid=129&bibcode=2006A%2526A...446..747GFUL - which I think settles this problem for now.
from specutils.
Yes, that's the "Paper III" I was referring to.
from specutils.
Related Issues (20)
- Better document/test user-made GWCS input
- Specutils in the muler and gollum ecosystem and prospect for upstreaming HOT 3
- TST: Ensure numpy dev is actually installed in devdeps
- TST: Python 3.12
- Spectrum1d.read suddenly won't read JWST x1d data automatically. HOT 1
- Serialization of Spectrum1D object (How to make Spectrum1D pickle-able?)
- Can spectrum object be lazy?
- TST: oldest deps job failed because something is forcing numpy upgrade to 1.24
- BUG: version number is off for `stable` on RTD HOT 1
- Why are SDSS spPlate readers "hidden" in the sdss.py loader? HOT 1
- Round tripping read/write does not preserve WCS HOT 5
- Improve/Update Developer docs HOT 5
- Add spPlate test HOT 1
- Improve documentation about headers
- Inconsistant expectation for location of header data (vs. other metadata) HOT 2
- Create a reader for DESI data files HOT 2
- Spectrum1D WCS has wrong number of dimensions as an NDCube HOT 1
- SpectralCoord can't handle pixel units
- Possible bug: correlation.template_correlate throws an error if given Spectrum1D objects with no flux uncertainties defined. HOT 2
- Fix broken `SpectralRegion` links in docstrings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specutils.