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)
- 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
- Copy semantics change in numpy 2.0 caused incompatibility with astropy v6.1rc HOT 2
- Dividing fluxes of a redshifted spectrum HOT 1
- TST: SDSS remote data not found (404), failing 6 tests HOT 9
- TST: Coverage upload failed despite green CI HOT 2
- Improve test coverage for utils
- Issue with reading JWST MRS cubes HOT 12
- Add unit check for sum vs integral in line flux + moments
- not able to read correct unit to JWST spectrum HOT 1
- Add flux column keyword to Spectrum1D.read
- TST: a failing doctest on MacOS + numpy 2 HOT 16
- smoothing functions do not use **kwargs for the astropy smoothing work HOT 1
- Handle reading/writing of covariance matrices
- "stable" docs link to dev build
- Inconsistent treatment of uncertainties in FluxConservingResampler?
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.