GNU Astronomy Utilities



12.3.34 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_Ne_VIII_770
Macro: GAL_SPECLINES_Ne_VIII_780
Macro: GAL_SPECLINES_Ly_epsilon
Macro: GAL_SPECLINES_Ly_delta
Macro: GAL_SPECLINES_Ly_gamma
Macro: GAL_SPECLINES_C_III_977
Macro: GAL_SPECLINES_N_III_989
Macro: GAL_SPECLINES_N_III_991_51
Macro: GAL_SPECLINES_N_III_991_57
Macro: GAL_SPECLINES_Ly_beta
Macro: GAL_SPECLINES_O_VI_1031
Macro: GAL_SPECLINES_O_VI_1037
Macro: GAL_SPECLINES_Ar_I_1066
Macro: GAL_SPECLINES_Ly_alpha
Macro: GAL_SPECLINES_N_V_1238
Macro: GAL_SPECLINES_N_V_1242
Macro: GAL_SPECLINES_Si_II_1260
Macro: GAL_SPECLINES_Si_II_1264
Macro: GAL_SPECLINES_O_I_1302
Macro: GAL_SPECLINES_C_II_1334
Macro: GAL_SPECLINES_C_II_1335
Macro: GAL_SPECLINES_Si_IV_1393
Macro: GAL_SPECLINES_O_IV_1397
Macro: GAL_SPECLINES_O_IV_1399
Macro: GAL_SPECLINES_Si_IV_1402
Macro: GAL_SPECLINES_N_IV_1486
Macro: GAL_SPECLINES_C_IV_1548
Macro: GAL_SPECLINES_C_IV_1550
Macro: GAL_SPECLINES_He_II_1640
Macro: GAL_SPECLINES_O_III_1660
Macro: GAL_SPECLINES_O_III_1666
Macro: GAL_SPECLINES_N_III_1746
Macro: GAL_SPECLINES_N_III_1748
Macro: GAL_SPECLINES_Al_III_1854
Macro: GAL_SPECLINES_Al_III_1862
Macro: GAL_SPECLINES_Si_III
Macro: GAL_SPECLINES_C_III_1908
Macro: GAL_SPECLINES_N_II_2142
Macro: GAL_SPECLINES_O_III_2320
Macro: GAL_SPECLINES_C_II_2323
Macro: GAL_SPECLINES_C_II_2324
Macro: GAL_SPECLINES_Fe_XI_2648
Macro: GAL_SPECLINES_He_II_2733
Macro: GAL_SPECLINES_Mg_V_2782
Macro: GAL_SPECLINES_Mg_II_2795
Macro: GAL_SPECLINES_Mg_II_2802
Macro: GAL_SPECLINES_Fe_IV_2829
Macro: GAL_SPECLINES_Fe_IV_2835
Macro: GAL_SPECLINES_Ar_IV_2853
Macro: GAL_SPECLINES_Ar_IV_2868
Macro: GAL_SPECLINES_Mg_V_2928
Macro: GAL_SPECLINES_He_I_2945
Macro: GAL_SPECLINES_O_III_3132
Macro: GAL_SPECLINES_He_I_3187
Macro: GAL_SPECLINES_He_II_3203
Macro: GAL_SPECLINES_O_III_3312
Macro: GAL_SPECLINES_Ne_V_3345
Macro: GAL_SPECLINES_Ne_V_3425
Macro: GAL_SPECLINES_O_III_3444
Macro: GAL_SPECLINES_N_I_3466_4
Macro: GAL_SPECLINES_N_I_3466_5
Macro: GAL_SPECLINES_He_I_3487
Macro: GAL_SPECLINES_Fe_VII_3586
Macro: GAL_SPECLINES_Fe_VI_3662
Macro: GAL_SPECLINES_H_19
Macro: GAL_SPECLINES_H_18
Macro: GAL_SPECLINES_H_17
Macro: GAL_SPECLINES_H_16
Macro: GAL_SPECLINES_H_15
Macro: GAL_SPECLINES_H_14
Macro: GAL_SPECLINES_O_II_3726
Macro: GAL_SPECLINES_O_II_3728
Macro: GAL_SPECLINES_H_13
Macro: GAL_SPECLINES_H_12
Macro: GAL_SPECLINES_Fe_VII_3758
Macro: GAL_SPECLINES_H_11
Macro: GAL_SPECLINES_H_10
Macro: GAL_SPECLINES_H_9
Macro: GAL_SPECLINES_Fe_V_3839
Macro: GAL_SPECLINES_Ne_III_3868
Macro: GAL_SPECLINES_He_I_3888
Macro: GAL_SPECLINES_H_8
Macro: GAL_SPECLINES_Fe_V_3891
Macro: GAL_SPECLINES_Fe_V_3911
Macro: GAL_SPECLINES_Ne_III_3967
Macro: GAL_SPECLINES_H_epsilon
Macro: GAL_SPECLINES_He_I_4026
Macro: GAL_SPECLINES_S_II_4068
Macro: GAL_SPECLINES_Fe_V_4071
Macro: GAL_SPECLINES_S_II_4076
Macro: GAL_SPECLINES_H_delta
Macro: GAL_SPECLINES_He_I_4143
Macro: GAL_SPECLINES_Fe_II_4178
Macro: GAL_SPECLINES_Fe_V_4180
Macro: GAL_SPECLINES_Fe_II_4233
Macro: GAL_SPECLINES_Fe_V_4227
Macro: GAL_SPECLINES_Fe_II_4287
Macro: GAL_SPECLINES_Fe_II_4304
Macro: GAL_SPECLINES_O_II_4317
Macro: GAL_SPECLINES_H_gamma
Macro: GAL_SPECLINES_O_III_4363
Macro: GAL_SPECLINES_Ar_XIV
Macro: GAL_SPECLINES_O_II_4414
Macro: GAL_SPECLINES_Fe_II_4416
Macro: GAL_SPECLINES_Fe_II_4452
Macro: GAL_SPECLINES_He_I_4471
Macro: GAL_SPECLINES_Fe_II_4489
Macro: GAL_SPECLINES_Fe_II_4491
Macro: GAL_SPECLINES_N_III_4510
Macro: GAL_SPECLINES_Fe_II_4522
Macro: GAL_SPECLINES_Fe_II_4555
Macro: GAL_SPECLINES_Fe_II_4582
Macro: GAL_SPECLINES_Fe_II_4583
Macro: GAL_SPECLINES_Fe_II_4629
Macro: GAL_SPECLINES_N_III_4634
Macro: GAL_SPECLINES_N_III_4640
Macro: GAL_SPECLINES_N_III_4641
Macro: GAL_SPECLINES_C_III_4647
Macro: GAL_SPECLINES_C_III_4650
Macro: GAL_SPECLINES_C_III_5651
Macro: GAL_SPECLINES_Fe_III_4658
Macro: GAL_SPECLINES_He_II_4685
Macro: GAL_SPECLINES_Ar_IV_4711
Macro: GAL_SPECLINES_Ar_IV_4740
Macro: GAL_SPECLINES_H_beta
Macro: GAL_SPECLINES_Fe_VII_4893
Macro: GAL_SPECLINES_Fe_IV_4903
Macro: GAL_SPECLINES_Fe_II_4923
Macro: GAL_SPECLINES_O_III_4958
Macro: GAL_SPECLINES_O_III_5006
Macro: GAL_SPECLINES_Fe_II_5018
Macro: GAL_SPECLINES_Fe_III_5084
Macro: GAL_SPECLINES_Fe_VI_5145
Macro: GAL_SPECLINES_Fe_VII_5158
Macro: GAL_SPECLINES_Fe_II_5169
Macro: GAL_SPECLINES_Fe_VI_5176
Macro: GAL_SPECLINES_Fe_II_5197
Macro: GAL_SPECLINES_N_I_5200
Macro: GAL_SPECLINES_Fe_II_5234
Macro: GAL_SPECLINES_Fe_IV_5236
Macro: GAL_SPECLINES_Fe_III_5270
Macro: GAL_SPECLINES_Fe_II_5276
Macro: GAL_SPECLINES_Fe_VII_5276
Macro: GAL_SPECLINES_Fe_XIV
Macro: GAL_SPECLINES_Ca_V
Macro: GAL_SPECLINES_Fe_II_5316_6
Macro: GAL_SPECLINES_Fe_II_5316_7
Macro: GAL_SPECLINES_Fe_VI_5335
Macro: GAL_SPECLINES_Fe_VI_5424
Macro: GAL_SPECLINES_Cl_III_5517
Macro: GAL_SPECLINES_Cl_III_5537
Macro: GAL_SPECLINES_Fe_VI_5637
Macro: GAL_SPECLINES_Fe_VI_5677
Macro: GAL_SPECLINES_C_III_5697
Macro: GAL_SPECLINES_Fe_VII_5720
Macro: GAL_SPECLINES_N_II_5754
Macro: GAL_SPECLINES_C_IV_5801
Macro: GAL_SPECLINES_C_IV_5811
Macro: GAL_SPECLINES_He_I_5875
Macro: GAL_SPECLINES_O_I_6046
Macro: GAL_SPECLINES_Fe_VII_6087
Macro: GAL_SPECLINES_O_I_6300
Macro: GAL_SPECLINES_S_III_6312
Macro: GAL_SPECLINES_Si_II_6347
Macro: GAL_SPECLINES_O_I_6363
Macro: GAL_SPECLINES_Fe_II_6369
Macro: GAL_SPECLINES_Fe_X
Macro: GAL_SPECLINES_Fe_II_6516
Macro: GAL_SPECLINES_N_II_6548
Macro: GAL_SPECLINES_H_alpha
Macro: GAL_SPECLINES_N_II_6583
Macro: GAL_SPECLINES_S_II_6716
Macro: GAL_SPECLINES_S_II_6730
Macro: GAL_SPECLINES_O_I_7002
Macro: GAL_SPECLINES_Ar_V
Macro: GAL_SPECLINES_He_I_7065
Macro: GAL_SPECLINES_Ar_III_7135
Macro: GAL_SPECLINES_Fe_II_7155
Macro: GAL_SPECLINES_Ar_IV_7170
Macro: GAL_SPECLINES_Fe_II_7172
Macro: GAL_SPECLINES_C_II_7236
Macro: GAL_SPECLINES_Ar_IV_7237
Macro: GAL_SPECLINES_O_I_7254
Macro: GAL_SPECLINES_Ar_IV_7262
Macro: GAL_SPECLINES_He_I_7281
Macro: GAL_SPECLINES_O_II_7319
Macro: GAL_SPECLINES_O_II_7330
Macro: GAL_SPECLINES_Ni_II_7377
Macro: GAL_SPECLINES_Ni_II_7411
Macro: GAL_SPECLINES_Fe_II_7452
Macro: GAL_SPECLINES_N_I_7468
Macro: GAL_SPECLINES_S_XII
Macro: GAL_SPECLINES_Ar_III_7751
Macro: GAL_SPECLINES_He_I_7816
Macro: GAL_SPECLINES_Ar_I_7868
Macro: GAL_SPECLINES_Ni_III
Macro: GAL_SPECLINES_Fe_XI_7891
Macro: GAL_SPECLINES_He_II_8236
Macro: GAL_SPECLINES_Pa_20
Macro: GAL_SPECLINES_Pa_19
Macro: GAL_SPECLINES_Pa_18
Macro: GAL_SPECLINES_O_I_8446
Macro: GAL_SPECLINES_Pa_17
Macro: GAL_SPECLINES_Ca_II_8498
Macro: GAL_SPECLINES_Pa_16
Macro: GAL_SPECLINES_Ca_II_8542
Macro: GAL_SPECLINES_Pa_15
Macro: GAL_SPECLINES_Cl_II
Macro: GAL_SPECLINES_Pa_14
Macro: GAL_SPECLINES_Fe_II_8616
Macro: GAL_SPECLINES_Ca_II_8662
Macro: GAL_SPECLINES_Pa_13
Macro: GAL_SPECLINES_N_I_8680
Macro: GAL_SPECLINES_N_I_8703
Macro: GAL_SPECLINES_N_I_8711
Macro: GAL_SPECLINES_Pa_12
Macro: GAL_SPECLINES_Pa_11
Macro: GAL_SPECLINES_Fe_II_8891
Macro: GAL_SPECLINES_Pa_10
Macro: GAL_SPECLINES_S_III_9068
Macro: GAL_SPECLINES_Pa_9
Macro: GAL_SPECLINES_S_III_9531
Macro: GAL_SPECLINES_Pa_epsilon
Macro: GAL_SPECLINES_C_I_9824
Macro: GAL_SPECLINES_C_I_9850
Macro: GAL_SPECLINES_S_VIII
Macro: GAL_SPECLINES_He_I_10027
Macro: GAL_SPECLINES_He_I_10031
Macro: GAL_SPECLINES_Pa_delta
Macro: GAL_SPECLINES_S_II_10286
Macro: GAL_SPECLINES_S_II_10320
Macro: GAL_SPECLINES_S_II_10336
Macro: GAL_SPECLINES_Fe_XIII
Macro: GAL_SPECLINES_He_I_10830
Macro: GAL_SPECLINES_Pa_gamma
Macro: GAL_SPECLINES_NUMBER

Internal values/identifiers for recognized spectral lines as is clear from their names. They are based on the UV an optical table of galaxy emission lines of Drew Chojnowski277.

Note the first and last macros, they can be used when parsing the lines automatically: both do not 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_*

Wavelength (in Angstroms) of the named lines. The * can take any of the line names of the GAL_SPECLINES_* Macros above.

Macro: GAL_SPECLINES_NAME_*

Names (as literal stings without any space) that can be used to refer to the lines in your program and converted to and from line identifiers using the functions below. The * can take any of the line names of the GAL_SPECLINES_* Macros above.

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 a pre-defined spectral line in the macros above. For example, you want the redshift where the H-alpha line falls at a wavelength of 8000 Angstroms, you can call this function like this:

gal_speclines_line_redshift_code(8000, GAL_SPECLINES_H_alpha);

Footnotes

(277)

http://astronomy.nmsu.edu/drewski/tableofemissionlines.html