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_990
Macro: GAL_SPECLINES_N_III_991_51
Macro: GAL_SPECLINES_N_III_991_58
Macro: GAL_SPECLINES_Ly_beta
Macro: GAL_SPECLINES_O_VI_1032
Macro: GAL_SPECLINES_O_VI_1038
Macro: GAL_SPECLINES_Ar_I_1067
Macro: GAL_SPECLINES_Ly_alpha
Macro: GAL_SPECLINES_N_V_1238
Macro: GAL_SPECLINES_N_V_1243
Macro: GAL_SPECLINES_Si_II_1260
Macro: GAL_SPECLINES_Si_II_1265
Macro: GAL_SPECLINES_O_I_1302
Macro: GAL_SPECLINES_C_II_1335
Macro: GAL_SPECLINES_C_II_1336
Macro: GAL_SPECLINES_Si_IV_1394
Macro: GAL_SPECLINES_O_IV_1397
Macro: GAL_SPECLINES_O_IV_1400
Macro: GAL_SPECLINES_Si_IV_1403
Macro: GAL_SPECLINES_N_IV_1486
Macro: GAL_SPECLINES_C_IV_1548
Macro: GAL_SPECLINES_C_IV_1551
Macro: GAL_SPECLINES_He_II_1640
Macro: GAL_SPECLINES_O_III_1661
Macro: GAL_SPECLINES_O_III_1666
Macro: GAL_SPECLINES_N_III_1747
Macro: GAL_SPECLINES_N_III_1749
Macro: GAL_SPECLINES_Al_III_1855
Macro: GAL_SPECLINES_Al_III_1863
Macro: GAL_SPECLINES_Si_III
Macro: GAL_SPECLINES_C_III_1909
Macro: GAL_SPECLINES_N_II_2143
Macro: GAL_SPECLINES_O_III_2321
Macro: GAL_SPECLINES_C_II_2324
Macro: GAL_SPECLINES_C_II_2325
Macro: GAL_SPECLINES_Fe_XI_2649
Macro: GAL_SPECLINES_He_II_2733
Macro: GAL_SPECLINES_Mg_V_2783
Macro: GAL_SPECLINES_Mg_II_2796
Macro: GAL_SPECLINES_Mg_II_2803
Macro: GAL_SPECLINES_Fe_IV_2829
Macro: GAL_SPECLINES_Fe_IV_2836
Macro: GAL_SPECLINES_Ar_IV_2854
Macro: GAL_SPECLINES_Ar_IV_2868
Macro: GAL_SPECLINES_Mg_V_2928
Macro: GAL_SPECLINES_He_I_2945
Macro: GAL_SPECLINES_O_III_3133
Macro: GAL_SPECLINES_He_I_3188
Macro: GAL_SPECLINES_He_II_3203
Macro: GAL_SPECLINES_O_III_3312
Macro: GAL_SPECLINES_Ne_V_3346
Macro: GAL_SPECLINES_Ne_V_3426
Macro: GAL_SPECLINES_O_III_3444
Macro: GAL_SPECLINES_N_I_3466_50
Macro: GAL_SPECLINES_N_I_3466_54
Macro: GAL_SPECLINES_He_I_3488
Macro: GAL_SPECLINES_Fe_VII_3586
Macro: GAL_SPECLINES_Fe_VI_3663
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_3729
Macro: GAL_SPECLINES_H_13
Macro: GAL_SPECLINES_H_12
Macro: GAL_SPECLINES_Fe_VII_3759
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_3869
Macro: GAL_SPECLINES_He_I_3889
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_4069
Macro: GAL_SPECLINES_Fe_V_4071
Macro: GAL_SPECLINES_S_II_4076
Macro: GAL_SPECLINES_H_delta
Macro: GAL_SPECLINES_He_I_4144
Macro: GAL_SPECLINES_Fe_II_4179
Macro: GAL_SPECLINES_Fe_V_4181
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_4415
Macro: GAL_SPECLINES_Fe_II_4417
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_4523
Macro: GAL_SPECLINES_Fe_II_4556
Macro: GAL_SPECLINES_Fe_II_4583
Macro: GAL_SPECLINES_Fe_II_4584
Macro: GAL_SPECLINES_Fe_II_4630
Macro: GAL_SPECLINES_N_III_4634
Macro: GAL_SPECLINES_N_III_4641
Macro: GAL_SPECLINES_N_III_4642
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_4686
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_4924
Macro: GAL_SPECLINES_O_III_4959
Macro: GAL_SPECLINES_O_III_5007
Macro: GAL_SPECLINES_Fe_II_5018
Macro: GAL_SPECLINES_Fe_III_5085
Macro: GAL_SPECLINES_Fe_VI_5146
Macro: GAL_SPECLINES_Fe_VII_5159
Macro: GAL_SPECLINES_Fe_II_5169
Macro: GAL_SPECLINES_Fe_VI_5176
Macro: GAL_SPECLINES_Fe_II_5198
Macro: GAL_SPECLINES_N_I_5200
Macro: GAL_SPECLINES_Fe_II_5235
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_62
Macro: GAL_SPECLINES_Fe_II_5316_78
Macro: GAL_SPECLINES_Fe_VI_5335
Macro: GAL_SPECLINES_Fe_VI_5424
Macro: GAL_SPECLINES_Cl_III_5518
Macro: GAL_SPECLINES_Cl_III_5538
Macro: GAL_SPECLINES_Fe_VI_5638
Macro: GAL_SPECLINES_Fe_VI_5677
Macro: GAL_SPECLINES_C_III_5698
Macro: GAL_SPECLINES_Fe_VII_5721
Macro: GAL_SPECLINES_N_II_5755
Macro: GAL_SPECLINES_C_IV_5801
Macro: GAL_SPECLINES_C_IV_5812
Macro: GAL_SPECLINES_He_I_5876
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_6364
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_6731
Macro: GAL_SPECLINES_O_I_7002
Macro: GAL_SPECLINES_Ar_V
Macro: GAL_SPECLINES_He_I_7065
Macro: GAL_SPECLINES_Ar_III_7136
Macro: GAL_SPECLINES_Fe_II_7155
Macro: GAL_SPECLINES_Ar_IV_7171
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_7263
Macro: GAL_SPECLINES_He_I_7281
Macro: GAL_SPECLINES_O_II_7320
Macro: GAL_SPECLINES_O_II_7331
Macro: GAL_SPECLINES_Ni_II_7378
Macro: GAL_SPECLINES_Ni_II_7411
Macro: GAL_SPECLINES_Fe_II_7453
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_7892
Macro: GAL_SPECLINES_He_II_8237
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_8617
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_8712
Macro: GAL_SPECLINES_Pa_12
Macro: GAL_SPECLINES_Pa_11
Macro: GAL_SPECLINES_Fe_II_8892
Macro: GAL_SPECLINES_Pa_10
Macro: GAL_SPECLINES_S_III_9069
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_10028
Macro: GAL_SPECLINES_He_I_10031
Macro: GAL_SPECLINES_Pa_delta
Macro: GAL_SPECLINES_S_II_10287
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 Chojnowski280.

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

(280)

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