GNU Astronomy Utilities


Next: , Previous: , Up: Gnuastro library   [Contents][Index]


10.3.29 Spectral lines library (speclines.h)

Gnuastro’s library has the following macros and functions for dealing with spectral lines. All these functions are declared in gnuastro/spectra.h.

Macro: GAL_SPECLINES_INVALID
Macro: GAL_SPECLINES_SIIRED
Macro: GAL_SPECLINES_SII
Macro: GAL_SPECLINES_SIIBLUE
Macro: GAL_SPECLINES_NIIRED
Macro: GAL_SPECLINES_NII
Macro: GAL_SPECLINES_HALPHA
Macro: GAL_SPECLINES_NIIBLUE
Macro: GAL_SPECLINES_OIIIRED
Macro: GAL_SPECLINES_OIII
Macro: GAL_SPECLINES_OIIIBLUE
Macro: GAL_SPECLINES_HBETA
Macro: GAL_SPECLINES_HEIIRED
Macro: GAL_SPECLINES_HGAMMA
Macro: GAL_SPECLINES_HDELTA
Macro: GAL_SPECLINES_HEPSILON
Macro: GAL_SPECLINES_NEIII
Macro: GAL_SPECLINES_OIIRED
Macro: GAL_SPECLINES_OII
Macro: GAL_SPECLINES_OIIBLUE
Macro: GAL_SPECLINES_BLIMIT
Macro: GAL_SPECLINES_MGIIRED
Macro: GAL_SPECLINES_MGII
Macro: GAL_SPECLINES_MGIIBLUE
Macro: GAL_SPECLINES_CIIIRED
Macro: GAL_SPECLINES_CIII
Macro: GAL_SPECLINES_CIIIBLUE
Macro: GAL_SPECLINES_HEIIBLUE
Macro: GAL_SPECLINES_LYALPHA
Macro: GAL_SPECLINES_LYLIMIT
Macro: GAL_SPECLINES_INVALID_MAX

Internal values/identifiers for specific spectral lines as is clear from their names. Note the first and last one, they can be used when parsing the lines automatically: both don’t correspond to any line, but their integer values correspond to the two integers just before and after the first and last line identifier.

GAL_SPECLINES_INVALID has a value of zero, and allows you to have a fixed integer which never corresponds to a line. GAL_SPECLINES_INVALID_MAX is the total number of pre-defined lines, plus one. So you can parse all the known lines with a for loop like this:

for(i=1;i<GAL_SPECLINES_INVALID_MAX;++i)
Macro: GAL_SPECLINES_ANGSTROM_SIIRED
Macro: GAL_SPECLINES_ANGSTROM_SII
Macro: GAL_SPECLINES_ANGSTROM_SIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_NIIRED
Macro: GAL_SPECLINES_ANGSTROM_NII
Macro: GAL_SPECLINES_ANGSTROM_HALPHA
Macro: GAL_SPECLINES_ANGSTROM_NIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_OIIIRED
Macro: GAL_SPECLINES_ANGSTROM_OIII
Macro: GAL_SPECLINES_ANGSTROM_OIIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_HBETA
Macro: GAL_SPECLINES_ANGSTROM_HEIIRED
Macro: GAL_SPECLINES_ANGSTROM_HGAMMA
Macro: GAL_SPECLINES_ANGSTROM_HDELTA
Macro: GAL_SPECLINES_ANGSTROM_HEPSILON
Macro: GAL_SPECLINES_ANGSTROM_NEIII
Macro: GAL_SPECLINES_ANGSTROM_OIIRED
Macro: GAL_SPECLINES_ANGSTROM_OII
Macro: GAL_SPECLINES_ANGSTROM_OIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_BLIMIT
Macro: GAL_SPECLINES_ANGSTROM_MGIIRED
Macro: GAL_SPECLINES_ANGSTROM_MGII
Macro: GAL_SPECLINES_ANGSTROM_MGIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_CIIIRED
Macro: GAL_SPECLINES_ANGSTROM_CIII
Macro: GAL_SPECLINES_ANGSTROM_CIIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_HEIIBLUE
Macro: GAL_SPECLINES_ANGSTROM_LYALPHA
Macro: GAL_SPECLINES_ANGSTROM_LYLIMIT

Wavelength (in Angstroms) of the named lines.

Macro: GAL_SPECLINES_NAME_SIIRED
Macro: GAL_SPECLINES_NAME_SII
Macro: GAL_SPECLINES_NAME_SIIBLUE
Macro: GAL_SPECLINES_NAME_NIIRED
Macro: GAL_SPECLINES_NAME_NII
Macro: GAL_SPECLINES_NAME_HALPHA
Macro: GAL_SPECLINES_NAME_NIIBLUE
Macro: GAL_SPECLINES_NAME_OIIIRED
Macro: GAL_SPECLINES_NAME_OIII
Macro: GAL_SPECLINES_NAME_OIIIBLUE
Macro: GAL_SPECLINES_NAME_HBETA
Macro: GAL_SPECLINES_NAME_HEIIRED
Macro: GAL_SPECLINES_NAME_HGAMMA
Macro: GAL_SPECLINES_NAME_HDELTA
Macro: GAL_SPECLINES_NAME_HEPSILON
Macro: GAL_SPECLINES_NAME_NEIII
Macro: GAL_SPECLINES_NAME_OIIRED
Macro: GAL_SPECLINES_NAME_OII
Macro: GAL_SPECLINES_NAME_OIIBLUE
Macro: GAL_SPECLINES_NAME_BLIMIT
Macro: GAL_SPECLINES_NAME_MGIIRED
Macro: GAL_SPECLINES_NAME_MGII
Macro: GAL_SPECLINES_NAME_MGIIBLUE
Macro: GAL_SPECLINES_NAME_CIIIRED
Macro: GAL_SPECLINES_NAME_CIII
Macro: GAL_SPECLINES_NAME_CIIIBLUE
Macro: GAL_SPECLINES_NAME_HEIIBLUE
Macro: GAL_SPECLINES_NAME_LYALPHA
Macro: GAL_SPECLINES_NAME_LYLIMIT

Names (as literal stings without any space, all in small-caps) that can be used to refer to the lines in your program and converted to and from line identifiers using the functions below.

Function:
char *
gal_speclines_line_name (int linecode)

Return the literal string of the given spectral line identifier Macro (for example GAL_SPECLINES_HALPHA or GAL_SPECLINES_LYLIMIT).

Function:
int
gal_speclines_line_code (char *name)

Return the spectral line identifier of the given standard name (for example GAL_SPECLINES_NAME_HALPHA or GAL_SPECLINES_NAME_LYLIMIT).

Function:
double
gal_speclines_line_angstrom (int linecode)

Return the wavelength (in Angstroms) of the given line.

Function:
double
gal_speclines_line_redshift (double obsline, double restline)

Return the redshift where the observed wavelength (obsline) was emitted from (if its restframe wavelength was restline).

Function:
double
gal_speclines_line_redshift_code (double obsline, int linecode)

Return the redshift where the observed wavelength (obsline) was emitted from (assuming its a specific spectra line, identified with linecode).


Next: , Previous: , Up: Gnuastro library   [Contents][Index]