Resampling¶
In Figueria et al. (2016) and scripts.phoenix_precision
the synthetic spectra are resampled to
3 pixels per resolution element.
This is done using the eniric.resample
module.
Functions for spectral resampling.
-
eniric.resample.
log_chunks
(wavelength: numpy.ndarray, percent: float) → numpy.ndarray[source]¶ Define the bounds at which $(Delta lambda)/lambda = X%$.
Allows spectrum to be split into chunks in which the size is X% of the given wavelength. This takes logarithmic steps with a base of (1+X/100).
Parameters: - wavelength (ndarry) – Wavelength array.
- percent (float) – Base step in percentage.
Returns: logspace – Array of points with a growth in wavelength spanned of a given percent.
Return type: ndarray
-
eniric.resample.
log_resample
(wavelength, sampling: Union[int, float], resolution: Union[int, float]) → numpy.ndarray[source]¶ Resample spectrum with a given sampling per resolution element.
Uses faster method using log and powers of a base. The base is (1.0 + 1.0/(sampling*resolution).
Parameters: Returns: logspace – Array of points with a set sampling per resolution element.
Return type: ndarray
Note
Almost equivalent to using ``np.logspace(np.log(wavelength)/np.log(base), np.log(wavelength)/np.log(base),
np.log(wavelength_end / wavelength_start) / np.log(base), base)``.
-
eniric.resample.
wl_logspace
(start, stop, base, end_point: bool = False)[source]¶ Like np.logspace but start and stop in wavelength units.
Parameters: Returns: logspace – Array of points with a spacing such that x[ii+1] = x[ii] * base between start and stop (or stop*base if end_point = True).
Return type: ndarray