API
popurri.peakutils Module
Functions
|
Check if there is any value in b inside the range of the values in a. |
|
Find the minimum peaks in the spectrum w, f closest to the wavelength positions in the list wlines. |
|
|
|
Find minima and maxima of spectrum f. |
|
|
|
Fit a single Gaussian to a spectrum line. |
|
Fit len(imin) peaks in the spectrum w, f. |
|
Gaussian function: G(x) = shift + amp * e**(-(x-cen)**2 / (2*wid**2)) |
|
|
|
|
|
|
|
|
Find all minima in spectrum. |
|
|
Find "ends of the minima" in spectrum f, i.e. maxima at each side of the minimum. |
|
Find the absolute maxima at each side of the minimum in y. |
|
Find the maxima closest the minimum in y, one at each side. |
popurri.plotutils Module
General plotting utilities
Colormaps: - https://matplotlib.org/stable/gallery/color/colormap_reference.html - https://colorcet.holoviz.org/user_guide/index.html - https://matplotlib.org/cmocean/
Functions
|
Save or display a figure. |
Customize basic appearance: - ticks in all axis - tick direction in, size major 6 minor 3, width 1.2 all - axes line width 1.2 - marker size 7 and line width 2 - custom colorcycle: black, orange, blue... |
|
|
|
|
Plot lines with different colorings |
|
Plot flux map. imshow() assumes data is regularly spaced! extent : floats (left, right, bottom, top) Define the coordinates of the image area. |
|
Classes
|
|
|
Represents a sequence of .Line2Ds that should be drawn together. |
popurri.spectrum Module
spectrum module
Methods to read and plot spectra from different instruments.
Functions
|
x : float |
|
Keywords are the order number (starting at 0 for the bluest order). |
|
Get general common parameters from header. |
|
Convert pixel to wavelength using the coefficients from the e2ds header, for a single echelle order. |
|
|
|
Read FITS header. |
|
Read table that contains general parameters keywords used in this code and their corresponding FITS header keyword for different instruments. |
|
NIR discontinuity at the center of the order: between pixel 2039 and pixel 2040. |
|
Read CARACAL ouput. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Read e2ds reduced spectrum flux and wavelength, and optionally the blaze. |
|
Read HARPS-N e2ds reduced spectrum flux and wavelength, and optionally the blaze. |
|
|
|
|
|
returnclass : bool |
|
Read spectrum from file filin. |
|
Transform air wavelength to vacuum wavelength. |
|
|
|
From e2ds header FITS file get the polynomial coefficients necessary to transform from pixels to wavelength. |
|
Transform vacuum wavelength to air wavelength. |
Classes
|
Place evenly spaced ticks, with a cap on the total number of ticks. |
|
PurePath subclass that can make system calls. |
|
Collection of (time series) spectra of the same instrument. |
|
Spectrum class |
popurri.spectrograph Module
Spectrograph-related functions
TODO CRIRES+ plotting different detectors
TODO ESPRESSO, MAROON-X plotting different slices
Functions
|
|
|
Read orders of specific instrument. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Read spectrograph properties from file |
|
Classes
|
Place evenly spaced ticks, with a cap on the total number of ticks. |
|
Spectrograph class |
|
General properties of spectrographs. |
popurri.telluricutils Module
Functions
|
Broaden mask by a velocity dv [m/s]. |
|
Same as broaden_mask, but takes as input the wavelength limits of each mask line, instead of the wavelength and flux (0110). |
|
Interpolation function of the telluric mask inverted (so that lines are zeros, i.e. False) to be used to mask telluric regions in the data. |
|
Check if there is overlap between 2 consecutive telluric regions. |
|
Join consecutive telluric regions if there is overlap. |
|
Join consecutive telluric regions if there is overlap. |
|
Get wavelength limits of the telluric lines masked. |
|
Read transmision telluric model spectrum generated with ESO SkyCalc. |
OLD FUNCTION! |
|
|
Read telluric mask from file. |
|
|
|
Convert telluric regions indicated by wavelengths w1 and w2 to a mask with format: flux = 0110 per region. |
Classes
|
Telluric mask class. |
|
w : array |
|
Interpolate a 1-D function. |
popurri.utils Module
General utils
Functions
|
Decorator to print the time a function takes to run. |