1 /*********************************************************************
2 Spectral lines.
3 This is part of GNU Astronomy Utilities (Gnuastro) package.
4 
5 Original author:
6      Mohammad Akhlaghi <mohammad@akhlaghi.org>
7 Contributing author(s):
8 Copyright (C) 2019-2021, Free Software Foundation, Inc.
9 
10 Gnuastro is free software: you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by the
12 Free Software Foundation, either version 3 of the License, or (at your
13 option) any later version.
14 
15 Gnuastro is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
22 **********************************************************************/
23 #ifndef __GAL_SPECLINES_H__
24 #define __GAL_SPECLINES_H__
25 
26 /* Include other headers if necessary here. Note that other header files
27    must be included before the C++ preparations below */
28 
29 
30 
31 /* C++ Preparations */
32 #undef __BEGIN_C_DECLS
33 #undef __END_C_DECLS
34 #ifdef __cplusplus
35 # define __BEGIN_C_DECLS extern "C" {
36 # define __END_C_DECLS }
37 #else
38 # define __BEGIN_C_DECLS                /* empty */
39 # define __END_C_DECLS                  /* empty */
40 #endif
41 /* End of C++ preparations */
42 
43 
44 
45 /* Actual header contants (the above were for the Pre-processor). */
46 __BEGIN_C_DECLS  /* From C++ preparations */
47 
48 
49 /* Spectral line internal codes (SORT BY WAVELENGTH). */
50 enum gal_speclines_line_codes
51 {
52   /* Allowing '0' to be identied as a known-non-line. */
53   GAL_SPECLINES_INVALID=0,
54 
55   /* Main list of recognized lines. */
56   GAL_SPECLINES_SIIRED,
57   GAL_SPECLINES_SII,
58   GAL_SPECLINES_SIIBLUE,
59   GAL_SPECLINES_NIIRED,
60   GAL_SPECLINES_NII,
61   GAL_SPECLINES_HALPHA,
62   GAL_SPECLINES_NIIBLUE,
63   GAL_SPECLINES_OIIIRED_VIS,
64   GAL_SPECLINES_OIII_VIS,
65   GAL_SPECLINES_OIIIBLUE_VIS,
66   GAL_SPECLINES_HBETA,
67   GAL_SPECLINES_HEII_VIS,
68   GAL_SPECLINES_HGAMMA,
69   GAL_SPECLINES_HDELTA,
70   GAL_SPECLINES_HEPSILON,
71   GAL_SPECLINES_NEIII,
72   GAL_SPECLINES_OIIRED,
73   GAL_SPECLINES_OII,
74   GAL_SPECLINES_OIIBLUE,
75   GAL_SPECLINES_BLIMIT,
76   GAL_SPECLINES_MGIIRED,
77   GAL_SPECLINES_MGII,
78   GAL_SPECLINES_MGIIBLUE,
79   GAL_SPECLINES_CIIIRED,
80   GAL_SPECLINES_CIII,
81   GAL_SPECLINES_CIIIBLUE,
82   GAL_SPECLINES_SiIIIRED,
83   GAL_SPECLINES_SiIII,
84   GAL_SPECLINES_SiIIIBLUE,
85   GAL_SPECLINES_OIIIRED_UV,
86   GAL_SPECLINES_OIII_UV,
87   GAL_SPECLINES_OIIIBLUE_UV,
88   GAL_SPECLINES_HEII_UV,
89   GAL_SPECLINES_CIVRED,
90   GAL_SPECLINES_CIV,
91   GAL_SPECLINES_CIVBLUE,
92   GAL_SPECLINES_NV,
93   GAL_SPECLINES_LYALPHA,
94   GAL_SPECLINES_LYBETA,
95   GAL_SPECLINES_LYGAMMA,
96   GAL_SPECLINES_LYDELTA,
97   GAL_SPECLINES_LYEPSILON,
98   GAL_SPECLINES_LYLIMIT,
99 
100   /* This should be the last element (to keep the total number of
101      lines). */
102   GAL_SPECLINES_INVALID_MAX,
103 };
104 
105 
106 /* Spectral lines wavelengths in Angstroms (SORT BY WAVELENGTH). */
107 #define GAL_SPECLINES_ANGSTROM_SIIRED    6731
108 #define GAL_SPECLINES_ANGSTROM_SII       6724
109 #define GAL_SPECLINES_ANGSTROM_SIIBLUE   6717
110 #define GAL_SPECLINES_ANGSTROM_NIIRED    6584
111 #define GAL_SPECLINES_ANGSTROM_NII       6566
112 #define GAL_SPECLINES_ANGSTROM_HALPHA    6562.8
113 #define GAL_SPECLINES_ANGSTROM_NIIBLUE   6548
114 #define GAL_SPECLINES_ANGSTROM_OIIIRED_VIS 5007
115 #define GAL_SPECLINES_ANGSTROM_OIII_VIS  4983
116 #define GAL_SPECLINES_ANGSTROM_OIIIBLUE_VIS 4959
117 #define GAL_SPECLINES_ANGSTROM_HBETA     4861.36
118 #define GAL_SPECLINES_ANGSTROM_HEII_VIS  4686
119 #define GAL_SPECLINES_ANGSTROM_HGAMMA    4340.46
120 #define GAL_SPECLINES_ANGSTROM_HDELTA    4101.74
121 #define GAL_SPECLINES_ANGSTROM_HEPSILON  3970.07
122 #define GAL_SPECLINES_ANGSTROM_NEIII     3869
123 #define GAL_SPECLINES_ANGSTROM_OIIRED    3729
124 #define GAL_SPECLINES_ANGSTROM_OII       3727.5
125 #define GAL_SPECLINES_ANGSTROM_OIIBLUE   3726
126 #define GAL_SPECLINES_ANGSTROM_BLIMIT    3646
127 #define GAL_SPECLINES_ANGSTROM_MGIIRED   2803
128 #define GAL_SPECLINES_ANGSTROM_MGII      2799.5
129 #define GAL_SPECLINES_ANGSTROM_MGIIBLUE  2796
130 #define GAL_SPECLINES_ANGSTROM_CIIIRED   1909
131 #define GAL_SPECLINES_ANGSTROM_CIII      1908
132 #define GAL_SPECLINES_ANGSTROM_CIIIBLUE  1907
133 #define GAL_SPECLINES_ANGSTROM_SiIIIRED  1892
134 #define GAL_SPECLINES_ANGSTROM_SiIII     1887.5
135 #define GAL_SPECLINES_ANGSTROM_SiIIIBLUE 1883
136 #define GAL_SPECLINES_ANGSTROM_OIIIRED_UV 1666
137 #define GAL_SPECLINES_ANGSTROM_OIII_UV   1663.5
138 #define GAL_SPECLINES_ANGSTROM_OIIIBLUE_UV 1661
139 #define GAL_SPECLINES_ANGSTROM_HEII_UV   1640
140 #define GAL_SPECLINES_ANGSTROM_CIVRED    1551
141 #define GAL_SPECLINES_ANGSTROM_CIV       1549.5
142 #define GAL_SPECLINES_ANGSTROM_CIVBLUE   1548
143 #define GAL_SPECLINES_ANGSTROM_NV        1240
144 #define GAL_SPECLINES_ANGSTROM_LYALPHA   1215.67
145 #define GAL_SPECLINES_ANGSTROM_LYBETA    1025.7
146 #define GAL_SPECLINES_ANGSTROM_LYGAMMA   972.54
147 #define GAL_SPECLINES_ANGSTROM_LYDELTA   949.74
148 #define GAL_SPECLINES_ANGSTROM_LYEPSILON 937.80
149 #define GAL_SPECLINES_ANGSTROM_LYLIMIT   912
150 
151 
152 /* Spectral line name strings (SORT BY WAVELENGTH). */
153 #define GAL_SPECLINES_NAME_SIIRED    "siired"
154 #define GAL_SPECLINES_NAME_SII       "sii"
155 #define GAL_SPECLINES_NAME_SIIBLUE   "siiblue"
156 #define GAL_SPECLINES_NAME_NIIRED    "niired"
157 #define GAL_SPECLINES_NAME_NII       "nii"
158 #define GAL_SPECLINES_NAME_HALPHA    "halpha"
159 #define GAL_SPECLINES_NAME_NIIBLUE   "niiblue"
160 #define GAL_SPECLINES_NAME_OIIIRED_VIS "oiiired-vis"
161 #define GAL_SPECLINES_NAME_OIII_VIS  "oiii-vis"
162 #define GAL_SPECLINES_NAME_OIIIBLUE_VIS "oiiiblue-vis"
163 #define GAL_SPECLINES_NAME_HBETA     "hbeta"
164 #define GAL_SPECLINES_NAME_HEII_VIS  "heii-vis"
165 #define GAL_SPECLINES_NAME_HGAMMA    "hgamma"
166 #define GAL_SPECLINES_NAME_HDELTA    "hdelta"
167 #define GAL_SPECLINES_NAME_HEPSILON  "hepsilon"
168 #define GAL_SPECLINES_NAME_NEIII     "neiii"
169 #define GAL_SPECLINES_NAME_OIIRED    "oiired"
170 #define GAL_SPECLINES_NAME_OII       "oii"
171 #define GAL_SPECLINES_NAME_OIIBLUE   "oiiblue"
172 #define GAL_SPECLINES_NAME_BLIMIT    "blimit"
173 #define GAL_SPECLINES_NAME_MGIIRED   "mgiired"
174 #define GAL_SPECLINES_NAME_MGII      "mgii"
175 #define GAL_SPECLINES_NAME_MGIIBLUE  "mgiiblue"
176 #define GAL_SPECLINES_NAME_CIIIRED   "ciiired"
177 #define GAL_SPECLINES_NAME_CIII      "ciii"
178 #define GAL_SPECLINES_NAME_CIIIBLUE  "ciiiblue"
179 #define GAL_SPECLINES_NAME_SiIIIRED  "si_iiired"
180 #define GAL_SPECLINES_NAME_SiIII     "si_iii"
181 #define GAL_SPECLINES_NAME_SiIIIBLUE "si_iiiblue"
182 #define GAL_SPECLINES_NAME_OIIIRED_UV "oiiired-uv"
183 #define GAL_SPECLINES_NAME_OIII_UV   "oiii-uv"
184 #define GAL_SPECLINES_NAME_OIIIBLUE_UV "oiiiblue-uv"
185 #define GAL_SPECLINES_NAME_HEII_UV   "heii-uv"
186 #define GAL_SPECLINES_NAME_CIVRED    "civred"
187 #define GAL_SPECLINES_NAME_CIV       "civ"
188 #define GAL_SPECLINES_NAME_CIVBLUE   "civblue"
189 #define GAL_SPECLINES_NAME_NV        "nv"
190 #define GAL_SPECLINES_NAME_LYALPHA   "lyalpha"
191 #define GAL_SPECLINES_NAME_LYBETA    "lybeta"
192 #define GAL_SPECLINES_NAME_LYGAMMA   "lygamma"
193 #define GAL_SPECLINES_NAME_LYDELTA   "lydelta"
194 #define GAL_SPECLINES_NAME_LYEPSILON "lyepsilon"
195 #define GAL_SPECLINES_NAME_LYLIMIT   "lylimit"
196 
197 
198 
199 
200 
201 /*********************************************************************/
202 /*************        Internal names and codes         ***************/
203 /*********************************************************************/
204 char *
205 gal_speclines_line_name(int linecode);
206 
207 int
208 gal_speclines_line_code(char *name);
209 
210 double
211 gal_speclines_line_angstrom(int linecode);
212 
213 
214 
215 
216 
217 /*********************************************************************/
218 /*************             Redshifted lines            ***************/
219 /*********************************************************************/
220 double
221 gal_speclines_line_redshift(double obsline, double restline);
222 
223 double
224 gal_speclines_line_redshift_code(double obsline, int linecode);
225 
226 
227 __END_C_DECLS    /* From C++ preparations */
228 
229 #endif           /* __GAL_COSMOLOGY_H__ */
230