mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Astronomical Spectra

Classes

struct  mx::astro::basicSpectrum< _units >
 A basic spectrum. More...
 
struct  mx::astro::astroFilter< _units, _rsr >
 A spectrum from the astroFilt filter library. More...
 
struct  mx::astro::sqWaveFilter< _units, _rsr >
 A square-wave filter spectrum. More...
 
struct  mx::astro::calspecSpectrum< _units >
 A spectrum from the HST calspec library. More...
 
struct  mx::astro::picklesSpectrum< _units >
 A spectrum from the Pickles library. More...
 
struct  mx::astro::earthAlbedo< _units >
 Earth Albedo Spectra. More...
 
struct  mx::astro::venusAlbedo< _units >
 Venus Spectra. More...
 
struct  mx::astro::cahoySpectrumRaw< _units >
 An albedo spectrum directly from the Cahoy et al (2010) [2] grid. More...
 
struct  mx::astro::phoenixSpectrum< _units >
 A spectrum from the Phoenix model, for use with ioutils::astro::astroSpectrum. More...
 

Functions

template<typename floatT >
void mx::astro::rewritePhoenixSpectrum (const std::string &filename, floatT lmin, floatT lmax, int sepWavelength=0, floatT DF=-8.0)
 Read in, crop, scale, and re-write a Phoenix spectrum data file. More...
 

Function Documentation

◆ rewritePhoenixSpectrum()

template<typename floatT >
void mx::astro::rewritePhoenixSpectrum ( const std::string &  filename,
floatT  lmin,
floatT  lmax,
int  sepWavelength = 0,
floatT  DF = -8.0 
)

Read in, crop, scale, and re-write a Phoenix spectrum data file.

For working with spectra obtained from: http://perso.ens-lyon.fr/france.allard/

The Phoenix spectra contain many columns of line data which are not often used, are not necessarily sorted by wavelength, and are sometimes formated so that points with leading minus signs are not in a separate column. We also have to change the fortan D to e.

We also want to apply the dilution factor and take the power of 10.

This function deals with these issues, producing a two-column space-delimited file in a specified wavelength range.

References:

NOTE: This overwrites the input file!

Template Parameters
floatTthe floating point type in which to work
Parameters
filename[in.out] complete name of the file to rewrite
[in]lminminimum wavelength to rewrite [microns]
[in]lmaxmaximum wavelemngth to rewrite [microns]
[in]sepWavelength[optional] controls how wavelength is handled. 0=> wavelength is included in file as first column. 1=> wavelength is written to a separate 'wavelength.dat' file. -1=> means don't write wavelength.
[in]DF[optional] the dilution factor. See references.

Definition at line 96 of file phoenixSpectrum.hpp.

References mx::ioutils::parentPath(), and mx::math::vectorSortOrder().