Calibration and manipulation with grating spectra in Python. Focused mainly on spectra obtained using StarAnalyser SA-100 and SA-200.
Requirements:
- python
- numpy
- scipy
- matplotlib
- astropy
Recommended workflow:
- Take images of spectrum.
- Apply dark-frame and flat-field corrections, register and stack images etc. (optional).
- Extract L channel (optional).
- Extract line profile of image with 0th order a 1st order spectrum - use e.g. SAO DS9 or MaximDL.
- Start spectroPy:
python spectroPy.py your_profile
. Code reads CSV, text and FITS files. - Run calibration of spectrum:
- Use 1-point calibration if you know a spectral resolution of used equipment.
- Use 2-points calibration otherwise.
- If your image was color and there is three channels in your profile, you can run calibration for only one channel or for all channels separately (slower but more precise).
- Select region of profile with 0th order spectrum - use left mouse button to mark left border of this region and right button for right border.
- Check the fitted gauss profile. If it looks bad, try to select slightly different region of spectra (bigger or smaller).
- If you choosed 1-point calibration, add a spectral resolution in Angstrom per pixel.
- If you choosed 2-points calibration, select area with known spectral line (similarly to steps 7 and 8). And write the wavelength of this spectral line (in Angstrom).
- Now, you can crop your spectrum, plot it and save it to a CSV file, text file or FITS file.