specutils | Astropy coordinated package for astronomical spectroscopy | Dataset library
kandi X-RAY | specutils Summary
kandi X-RAY | specutils Summary
An Astropy coordinated package for astronomical spectroscopy. Maintainers: @nmearl @rosteen @keflavich @eteq
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load an AAomega file
- Compute a WCS from a dictionary
- Add labels to a list of specifiers
- Guess the label from the header
- Load a single split file
- Add a single spectra to the map
- Get the flux units from the given header
- Add units to the model
- Combine postfix postfix
- Return the centroid of a spectrum
- Load a tabular spectrum
- Load the twosla qlg fits
- Load a spPlate file
- Compute the equivalent width of a spectrum
- Load spectrum from a file object
- Read a SpectrumCollection from a file - like object
- Compute the template spectrum for a given set of observed_templates
- Resample a spectrum to a new spectrum
- R Compute the correlation between the observed and observed spectra
- Read a nonlinear spectrum from a file
- Load miri spectra
- Create a fits object from a fits object
- Write a wcs1d object to a wcs file
- Load a multiline single file
- Load a wcs file
- Load a PSF file
specutils Key Features
specutils Examples and Code Snippets
Community Discussions
Trending Discussions on specutils
QUESTION
it's my first time processing spectra from a black body radiation experiment, I'm using Python and having some troubles... I have this spectra with 2 peaks and uneven background noise which I want to normalize, I tried using specutils 1.1 "continuum-fitting" (documentation here: https://specutils.readthedocs.io/en/stable/fitting.html#continuum-fitting )
My implementation is this:
...ANSWER
Answered 2020-Nov-22 at 11:17At the end I settled on using a median filter from scipy (medfilt) and with a high enough kernel it removed the spikes completely.
The problem on my specutils implementation was that I needed to exclude the peaks in the spectrum window by doing this, althought I found this too hard to implement on 100-120 data measurement I had:
QUESTION
Hi I am looking to plot a spectra on python of a fits file. ESO has a guide on how to display 1D spectra and a code that should work which is the following:
...ANSWER
Answered 2020-Nov-01 at 20:46I had a look at a random spectrum downloaded from this page. Indeed it contains only one HDU so you will get an IndexError
if you try to access data from an HDU that does not exist.
The code you linked to might be old (it is on an "archive" page after all) and is also merely an example, not necessarily appropriate for plotting data from any FITS file.
The specutils package has many utilities for analyzing and plotting 1D spectra. It can also read spectra from many common FITS formats without having to do too much manually.
Here's what I did. First I opened the file, this one in particular:
QUESTION
I'm trying to fit a generic continuum to my spectrum to normalize it (I realize this isn't a very good method for complicated spectra, but can't seem to find a good continuum normalization routine for spectra in Python, so if you know of one please let me know!!).
Here's my code. w is the wavelength array and f is the flux array (which are just imported data):
...ANSWER
Answered 2020-May-22 at 16:52I don't have a solution to your code issue, but since you asked for recommendations for normalization routines I can help you with that. I use the Python based linetools package. There is a routine within it "lt_continuumfit" which does a beautiful job normalizing continuum. It's all I use for normalizing now. It's very easy to install and use and has many other functions as well (rebin, velocity plots, splicing, etc). https://linetools.readthedocs.io/en/latest/
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install specutils
You can use specutils like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page