WCSLIB  7.3.1
spx.h
Go to the documentation of this file.
1 /*============================================================================
2  WCSLIB 7.3 - an implementation of the FITS WCS standard.
3  Copyright (C) 1995-2020, Mark Calabretta
4 
5  This file is part of WCSLIB.
6 
7  WCSLIB is free software: you can redistribute it and/or modify it under the
8  terms of the GNU Lesser General Public License as published by the Free
9  Software Foundation, either version 3 of the License, or (at your option)
10  any later version.
11 
12  WCSLIB is distributed in the hope that it will be useful, but WITHOUT ANY
13  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
15  more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with WCSLIB. If not, see http://www.gnu.org/licenses.
19 
20  Direct correspondence concerning WCSLIB to mark@calabretta.id.au
21 
22  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
23  http://www.atnf.csiro.au/people/Mark.Calabretta
24  $Id: spx.h,v 7.3.1.2 2020/08/17 11:19:09 mcalabre Exp mcalabre $
25 *=============================================================================
26 *
27 * WCSLIB 7.3 - C routines that implement the FITS World Coordinate System
28 * (WCS) standard. Refer to the README file provided with WCSLIB for an
29 * overview of the library.
30 *
31 *
32 * Summary of the spx routines
33 * ---------------------------
34 * Routines in this suite implement the spectral coordinate systems recognized
35 * by the FITS World Coordinate System (WCS) standard, as described in
36 *
37 = "Representations of world coordinates in FITS",
38 = Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)
39 =
40 = "Representations of spectral coordinates in FITS",
41 = Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.
42 = 2006, A&A, 446, 747 (WCS Paper III)
43 *
44 * specx() is a scalar routine that, given one spectral variable (e.g.
45 * frequency), computes all the others (e.g. wavelength, velocity, etc.) plus
46 * the required derivatives of each with respect to the others. The results
47 * are returned in the spxprm struct.
48 *
49 * spxperr() prints the error message(s) (if any) stored in a spxprm struct.
50 *
51 * The remaining routines are all vector conversions from one spectral
52 * variable to another. The API of these functions only differ in whether the
53 * rest frequency or wavelength need be supplied.
54 *
55 * Non-linear:
56 * - freqwave() frequency -> vacuum wavelength
57 * - wavefreq() vacuum wavelength -> frequency
58 *
59 * - freqawav() frequency -> air wavelength
60 * - awavfreq() air wavelength -> frequency
61 *
62 * - freqvelo() frequency -> relativistic velocity
63 * - velofreq() relativistic velocity -> frequency
64 *
65 * - waveawav() vacuum wavelength -> air wavelength
66 * - awavwave() air wavelength -> vacuum wavelength
67 *
68 * - wavevelo() vacuum wavelength -> relativistic velocity
69 * - velowave() relativistic velocity -> vacuum wavelength
70 *
71 * - awavvelo() air wavelength -> relativistic velocity
72 * - veloawav() relativistic velocity -> air wavelength
73 *
74 * Linear:
75 * - freqafrq() frequency -> angular frequency
76 * - afrqfreq() angular frequency -> frequency
77 *
78 * - freqener() frequency -> energy
79 * - enerfreq() energy -> frequency
80 *
81 * - freqwavn() frequency -> wave number
82 * - wavnfreq() wave number -> frequency
83 *
84 * - freqvrad() frequency -> radio velocity
85 * - vradfreq() radio velocity -> frequency
86 *
87 * - wavevopt() vacuum wavelength -> optical velocity
88 * - voptwave() optical velocity -> vacuum wavelength
89 *
90 * - wavezopt() vacuum wavelength -> redshift
91 * - zoptwave() redshift -> vacuum wavelength
92 *
93 * - velobeta() relativistic velocity -> beta (= v/c)
94 * - betavelo() beta (= v/c) -> relativistic velocity
95 *
96 * These are the workhorse routines, to be used for fast transformations.
97 * Conversions may be done "in place" by calling the routine with the output
98 * vector set to the input.
99 *
100 * Air-to-vacuum wavelength conversion:
101 * ------------------------------------
102 * The air-to-vacuum wavelength conversion in early drafts of WCS Paper III
103 * cites Cox (ed., 2000, Allen’s Astrophysical Quantities, AIP Press,
104 * Springer-Verlag, New York), which itself derives from Edlén (1953, Journal
105 * of the Optical Society of America, 43, 339). This is the IAU standard,
106 * adopted in 1957 and again in 1991. No more recent IAU resolution replaces
107 * this relation, and it is the one used by WCSLIB.
108 *
109 * However, the Cox relation was replaced in later drafts of Paper III, and as
110 * eventually published, by the IUGG relation (1999, International Union of
111 * Geodesy and Geophysics, comptes rendus of the 22nd General Assembly,
112 * Birmingham UK, p111). There is a nearly constant ratio between the two,
113 * with IUGG/Cox = 1.000015 over most of the range between 200nm and 10,000nm.
114 *
115 * The IUGG relation itself is derived from the work of Ciddor (1996, Applied
116 * Optics, 35, 1566), which is used directly by the Sloan Digital Sky Survey.
117 * It agrees closely with Cox; longwards of 2500nm, the ratio Ciddor/Cox is
118 * fixed at 1.000000021, decreasing only slightly, to 1.000000018, at 1000nm.
119 *
120 * The Cox, IUGG, and Ciddor relations all accurately provide the wavelength
121 * dependence of the air-to-vacuum wavelength conversion. However, for full
122 * accuracy, the atmospheric temperature, pressure, and partial pressure of
123 * water vapour must be taken into account. These will determine a small,
124 * wavelength-independent scale factor and offset, which is not considered by
125 * WCS Paper III.
126 *
127 * WCS Paper III is also silent on the question of the range of validity of the
128 * air-to-vacuum wavelength conversion. Cox's relation would appear to be
129 * valid in the range 200nm to 10,000nm. Both the Cox and the Ciddor relations
130 * have singularities below 200nm, with Cox's at 156nm and 83nm. WCSLIB checks
131 * neither the range of validity, nor for these singularities.
132 *
133 * Argument checking:
134 * ------------------
135 * The input spectral values are only checked for values that would result
136 * in floating point exceptions. In particular, negative frequencies and
137 * wavelengths are allowed, as are velocities greater than the speed of
138 * light. The same is true for the spectral parameters - rest frequency and
139 * wavelength.
140 *
141 * Accuracy:
142 * ---------
143 * No warranty is given for the accuracy of these routines (refer to the
144 * copyright notice); intending users must satisfy for themselves their
145 * adequacy for the intended purpose. However, closure effectively to within
146 * double precision rounding error was demonstrated by test routine tspec.c
147 * which accompanies this software.
148 *
149 *
150 * specx() - Spectral cross conversions (scalar)
151 * ---------------------------------------------
152 * Given one spectral variable specx() computes all the others, plus the
153 * required derivatives of each with respect to the others.
154 *
155 * Given:
156 * type const char*
157 * The type of spectral variable given by spec, FREQ,
158 * AFRQ, ENER, WAVN, VRAD, WAVE, VOPT, ZOPT, AWAV, VELO,
159 * or BETA (case sensitive).
160 *
161 * spec double The spectral variable given, in SI units.
162 *
163 * restfrq,
164 * restwav double Rest frequency [Hz] or rest wavelength in vacuo [m],
165 * only one of which need be given. The other should be
166 * set to zero. If both are zero, only a subset of the
167 * spectral variables can be computed, the remainder are
168 * set to zero. Specifically, given one of FREQ, AFRQ,
169 * ENER, WAVN, WAVE, or AWAV the others can be computed
170 * without knowledge of the rest frequency. Likewise,
171 * VRAD, VOPT, ZOPT, VELO, and BETA.
172 *
173 * Given and returned:
174 * specs struct spxprm*
175 * Data structure containing all spectral variables and
176 * their derivatives, in SI units.
177 *
178 * Function return value:
179 * int Status return value:
180 * 0: Success.
181 * 1: Null spxprm pointer passed.
182 * 2: Invalid spectral parameters.
183 * 3: Invalid spectral variable.
184 *
185 * For returns > 1, a detailed error message is set in
186 * spxprm::err if enabled, see wcserr_enable().
187 *
188 * freqafrq(), afrqfreq(), freqener(), enerfreq(), freqwavn(), wavnfreq(),
189 * freqwave(), wavefreq(), freqawav(), awavfreq(), waveawav(), awavwave(),
190 * velobeta(), and betavelo() implement vector conversions between wave-like
191 * or velocity-like spectral types (i.e. conversions that do not need the rest
192 * frequency or wavelength). They all have the same API.
193 *
194 *
195 * spxperr() - Print error messages from a spxprm struct
196 * -----------------------------------------------------
197 * spxperr() prints the error message(s) (if any) stored in a spxprm struct.
198 * If there are no errors then nothing is printed. It uses wcserr_prt(), q.v.
199 *
200 * Given:
201 * spx const struct spxprm*
202 * Spectral variables and their derivatives.
203 *
204 * prefix const char *
205 * If non-NULL, each output line will be prefixed with
206 * this string.
207 *
208 * Function return value:
209 * int Status return value:
210 * 0: Success.
211 * 1: Null spxprm pointer passed.
212 *
213 *
214 * freqafrq() - Convert frequency to angular frequency (vector)
215 * ------------------------------------------------------------
216 * freqafrq() converts frequency to angular frequency.
217 *
218 * Given:
219 * param double Ignored.
220 *
221 * nspec int Vector length.
222 *
223 * instep,
224 * outstep int Vector strides.
225 *
226 * inspec const double[]
227 * Input spectral variables, in SI units.
228 *
229 * Returned:
230 * outspec double[] Output spectral variables, in SI units.
231 *
232 * stat int[] Status return value for each vector element:
233 * 0: Success.
234 * 1: Invalid value of inspec.
235 *
236 * Function return value:
237 * int Status return value:
238 * 0: Success.
239 * 2: Invalid spectral parameters.
240 * 4: One or more of the inspec coordinates were
241 * invalid, as indicated by the stat vector.
242 *
243 *
244 * freqvelo(), velofreq(), freqvrad(), and vradfreq() implement vector
245 * conversions between frequency and velocity spectral types. They all have
246 * the same API.
247 *
248 *
249 * freqvelo() - Convert frequency to relativistic velocity (vector)
250 * ----------------------------------------------------------------
251 * freqvelo() converts frequency to relativistic velocity.
252 *
253 * Given:
254 * param double Rest frequency [Hz].
255 *
256 * nspec int Vector length.
257 *
258 * instep,
259 * outstep int Vector strides.
260 *
261 * inspec const double[]
262 * Input spectral variables, in SI units.
263 *
264 * Returned:
265 * outspec double[] Output spectral variables, in SI units.
266 *
267 * stat int[] Status return value for each vector element:
268 * 0: Success.
269 * 1: Invalid value of inspec.
270 *
271 * Function return value:
272 * int Status return value:
273 * 0: Success.
274 * 2: Invalid spectral parameters.
275 * 4: One or more of the inspec coordinates were
276 * invalid, as indicated by the stat vector.
277 *
278 *
279 * wavevelo(), velowave(), awavvelo(), veloawav(), wavevopt(), voptwave(),
280 * wavezopt(), and zoptwave() implement vector conversions between wavelength
281 * and velocity spectral types. They all have the same API.
282 *
283 *
284 * wavevelo() - Conversions between wavelength and velocity types (vector)
285 * -----------------------------------------------------------------------
286 * wavevelo() converts vacuum wavelength to relativistic velocity.
287 *
288 * Given:
289 * param double Rest wavelength in vacuo [m].
290 *
291 * nspec int Vector length.
292 *
293 * instep,
294 * outstep int Vector strides.
295 *
296 * inspec const double[]
297 * Input spectral variables, in SI units.
298 *
299 * Returned:
300 * outspec double[] Output spectral variables, in SI units.
301 *
302 * stat int[] Status return value for each vector element:
303 * 0: Success.
304 * 1: Invalid value of inspec.
305 *
306 * Function return value:
307 * int Status return value:
308 * 0: Success.
309 * 2: Invalid spectral parameters.
310 * 4: One or more of the inspec coordinates were
311 * invalid, as indicated by the stat vector.
312 *
313 *
314 * spxprm struct - Spectral variables and their derivatives
315 * --------------------------------------------------------
316 * The spxprm struct contains the value of all spectral variables and their
317 * derivatives. It is used solely by specx() which constructs it from
318 * information provided via its function arguments.
319 *
320 * This struct should be considered read-only, no members need ever be set nor
321 * should ever be modified by the user.
322 *
323 * double restfrq
324 * (Returned) Rest frequency [Hz].
325 *
326 * double restwav
327 * (Returned) Rest wavelength [m].
328 *
329 * int wavetype
330 * (Returned) True if wave types have been computed, and ...
331 *
332 * int velotype
333 * (Returned) ... true if velocity types have been computed; types are
334 * defined below.
335 *
336 * If one or other of spxprm::restfrq and spxprm::restwav is given
337 * (non-zero) then all spectral variables may be computed. If both are
338 * given, restfrq is used. If restfrq and restwav are both zero, only wave
339 * characteristic xor velocity type spectral variables may be computed
340 * depending on the variable given. These flags indicate what is
341 * available.
342 *
343 * double freq
344 * (Returned) Frequency [Hz] (wavetype).
345 *
346 * double afrq
347 * (Returned) Angular frequency [rad/s] (wavetype).
348 *
349 * double ener
350 * (Returned) Photon energy [J] (wavetype).
351 *
352 * double wavn
353 * (Returned) Wave number [/m] (wavetype).
354 *
355 * double vrad
356 * (Returned) Radio velocity [m/s] (velotype).
357 *
358 * double wave
359 * (Returned) Vacuum wavelength [m] (wavetype).
360 *
361 * double vopt
362 * (Returned) Optical velocity [m/s] (velotype).
363 *
364 * double zopt
365 * (Returned) Redshift [dimensionless] (velotype).
366 *
367 * double awav
368 * (Returned) Air wavelength [m] (wavetype).
369 *
370 * double velo
371 * (Returned) Relativistic velocity [m/s] (velotype).
372 *
373 * double beta
374 * (Returned) Relativistic beta [dimensionless] (velotype).
375 *
376 * double dfreqafrq
377 * (Returned) Derivative of frequency with respect to angular frequency
378 * [/rad] (constant, = 1 / 2*pi), and ...
379 * double dafrqfreq
380 * (Returned) ... vice versa [rad] (constant, = 2*pi, always available).
381 *
382 * double dfreqener
383 * (Returned) Derivative of frequency with respect to photon energy
384 * [/J/s] (constant, = 1/h), and ...
385 * double denerfreq
386 * (Returned) ... vice versa [Js] (constant, = h, Planck's constant,
387 * always available).
388 *
389 * double dfreqwavn
390 * (Returned) Derivative of frequency with respect to wave number [m/s]
391 * (constant, = c, the speed of light in vacuo), and ...
392 * double dwavnfreq
393 * (Returned) ... vice versa [s/m] (constant, = 1/c, always available).
394 *
395 * double dfreqvrad
396 * (Returned) Derivative of frequency with respect to radio velocity [/m],
397 * and ...
398 * double dvradfreq
399 * (Returned) ... vice versa [m] (wavetype && velotype).
400 *
401 * double dfreqwave
402 * (Returned) Derivative of frequency with respect to vacuum wavelength
403 * [/m/s], and ...
404 * double dwavefreq
405 * (Returned) ... vice versa [m s] (wavetype).
406 *
407 * double dfreqawav
408 * (Returned) Derivative of frequency with respect to air wavelength,
409 * [/m/s], and ...
410 * double dawavfreq
411 * (Returned) ... vice versa [m s] (wavetype).
412 *
413 * double dfreqvelo
414 * (Returned) Derivative of frequency with respect to relativistic
415 * velocity [/m], and ...
416 * double dvelofreq
417 * (Returned) ... vice versa [m] (wavetype && velotype).
418 *
419 * double dwavevopt
420 * (Returned) Derivative of vacuum wavelength with respect to optical
421 * velocity [s], and ...
422 * double dvoptwave
423 * (Returned) ... vice versa [/s] (wavetype && velotype).
424 *
425 * double dwavezopt
426 * (Returned) Derivative of vacuum wavelength with respect to redshift [m],
427 * and ...
428 * double dzoptwave
429 * (Returned) ... vice versa [/m] (wavetype && velotype).
430 *
431 * double dwaveawav
432 * (Returned) Derivative of vacuum wavelength with respect to air
433 * wavelength [dimensionless], and ...
434 * double dawavwave
435 * (Returned) ... vice versa [dimensionless] (wavetype).
436 *
437 * double dwavevelo
438 * (Returned) Derivative of vacuum wavelength with respect to relativistic
439 * velocity [s], and ...
440 * double dvelowave
441 * (Returned) ... vice versa [/s] (wavetype && velotype).
442 *
443 * double dawavvelo
444 * (Returned) Derivative of air wavelength with respect to relativistic
445 * velocity [s], and ...
446 * double dveloawav
447 * (Returned) ... vice versa [/s] (wavetype && velotype).
448 *
449 * double dvelobeta
450 * (Returned) Derivative of relativistic velocity with respect to
451 * relativistic beta [m/s] (constant, = c, the speed of light in vacuo),
452 * and ...
453 * double dbetavelo
454 * (Returned) ... vice versa [s/m] (constant, = 1/c, always available).
455 *
456 * struct wcserr *err
457 * (Returned) If enabled, when an error status is returned, this struct
458 * contains detailed information about the error, see wcserr_enable().
459 *
460 * void *padding
461 * (An unused variable inserted for alignment purposes only.)
462 *
463 * Global variable: const char *spx_errmsg[] - Status return messages
464 * ------------------------------------------------------------------
465 * Error messages to match the status value returned from each function.
466 *
467 *===========================================================================*/
468 
469 #ifndef WCSLIB_SPEC
470 #define WCSLIB_SPEC
471 
472 #ifdef __cplusplus
473 extern "C" {
474 #endif
475 
476 extern const char *spx_errmsg[];
477 
478 enum spx_errmsg {
479  SPXERR_SUCCESS = 0, // Success.
480  SPXERR_NULL_POINTER = 1, // Null spxprm pointer passed.
481  SPXERR_BAD_SPEC_PARAMS = 2, // Invalid spectral parameters.
482  SPXERR_BAD_SPEC_VAR = 3, // Invalid spectral variable.
483  SPXERR_BAD_INSPEC_COORD = 4 // One or more of the inspec coordinates were
484  // invalid.
485 };
486 
487 struct spxprm {
488  double restfrq, restwav; // Rest frequency [Hz] and wavelength [m].
489 
490  int wavetype, velotype; // True if wave/velocity types have been
491  // computed; types are defined below.
492 
493  // Spectral variables computed by specx().
494  //--------------------------------------------------------------------------
495  double freq, // wavetype: Frequency [Hz].
496  afrq, // wavetype: Angular frequency [rad/s].
497  ener, // wavetype: Photon energy [J].
498  wavn, // wavetype: Wave number [/m].
499  vrad, // velotype: Radio velocity [m/s].
500  wave, // wavetype: Vacuum wavelength [m].
501  vopt, // velotype: Optical velocity [m/s].
502  zopt, // velotype: Redshift.
503  awav, // wavetype: Air wavelength [m].
504  velo, // velotype: Relativistic velocity [m/s].
505  beta; // velotype: Relativistic beta.
506 
507  // Derivatives of spectral variables computed by specx().
508  //--------------------------------------------------------------------------
509  double dfreqafrq, dafrqfreq, // Constant, always available.
510  dfreqener, denerfreq, // Constant, always available.
511  dfreqwavn, dwavnfreq, // Constant, always available.
512  dfreqvrad, dvradfreq, // wavetype && velotype.
513  dfreqwave, dwavefreq, // wavetype.
514  dfreqawav, dawavfreq, // wavetype.
515  dfreqvelo, dvelofreq, // wavetype && velotype.
516  dwavevopt, dvoptwave, // wavetype && velotype.
517  dwavezopt, dzoptwave, // wavetype && velotype.
518  dwaveawav, dawavwave, // wavetype.
519  dwavevelo, dvelowave, // wavetype && velotype.
520  dawavvelo, dveloawav, // wavetype && velotype.
521  dvelobeta, dbetavelo; // Constant, always available.
522 
523  // Error handling
524  //--------------------------------------------------------------------------
525  struct wcserr *err;
526 
527  // Private
528  //--------------------------------------------------------------------------
529  void *padding; // (Dummy inserted for alignment purposes.)
530 };
531 
532 // Size of the spxprm struct in int units, used by the Fortran wrappers.
533 #define SPXLEN (sizeof(struct spxprm)/sizeof(int))
534 
535 
536 int specx(const char *type, double spec, double restfrq, double restwav,
537  struct spxprm *specs);
538 
539 int spxperr(const struct spxprm *spx, const char *prefix);
540 
541 // For use in declaring function prototypes, e.g. in spcprm.
542 #define SPX_ARGS double param, int nspec, int instep, int outstep, \
543  const double inspec[], double outspec[], int stat[]
544 
545 int freqafrq(SPX_ARGS);
546 int afrqfreq(SPX_ARGS);
547 
548 int freqener(SPX_ARGS);
549 int enerfreq(SPX_ARGS);
550 
551 int freqwavn(SPX_ARGS);
552 int wavnfreq(SPX_ARGS);
553 
554 int freqwave(SPX_ARGS);
555 int wavefreq(SPX_ARGS);
556 
557 int freqawav(SPX_ARGS);
558 int awavfreq(SPX_ARGS);
559 
560 int waveawav(SPX_ARGS);
561 int awavwave(SPX_ARGS);
562 
563 int velobeta(SPX_ARGS);
564 int betavelo(SPX_ARGS);
565 
566 
567 int freqvelo(SPX_ARGS);
568 int velofreq(SPX_ARGS);
569 
570 int freqvrad(SPX_ARGS);
571 int vradfreq(SPX_ARGS);
572 
573 
574 int wavevelo(SPX_ARGS);
575 int velowave(SPX_ARGS);
576 
577 int awavvelo(SPX_ARGS);
578 int veloawav(SPX_ARGS);
579 
580 int wavevopt(SPX_ARGS);
581 int voptwave(SPX_ARGS);
582 
583 int wavezopt(SPX_ARGS);
584 int zoptwave(SPX_ARGS);
585 
586 
587 #ifdef __cplusplus
588 }
589 #endif
590 
591 #endif // WCSLIB_SPEC
int wavnfreq(SPX_ARGS)
Convert wave number to frequency (vector).
double dawavwave
Definition: spx.h:509
double dwaveawav
Definition: spx.h:509
double dvelowave
Definition: spx.h:509
int waveawav(SPX_ARGS)
Convert vacuum wavelength to air wavelength (vector).
double dvelobeta
Definition: spx.h:509
double wave
Definition: spx.h:495
int freqawav(SPX_ARGS)
Convert frequency to air wavelength (vector).
Error message handling.
Definition: wcserr.h:222
double dzoptwave
Definition: spx.h:509
#define SPX_ARGS
For use in declaring spectral conversion function prototypes.
Definition: spx.h:542
double velo
Definition: spx.h:495
int wavevopt(SPX_ARGS)
Convert vacuum wavelength to optical velocity (vector).
double beta
Definition: spx.h:495
double dwavnfreq
Definition: spx.h:509
int enerfreq(SPX_ARGS)
Convert photon energy to frequency (vector).
double dfreqener
Definition: spx.h:509
int voptwave(SPX_ARGS)
Convert optical velocity to vacuum wavelength (vector).
double dfreqvelo
Definition: spx.h:509
Definition: spx.h:480
int awavvelo(SPX_ARGS)
Convert air wavelength to relativistic velocity (vector).
int afrqfreq(SPX_ARGS)
Convert angular frequency to frequency (vector).
double dvelofreq
Definition: spx.h:509
double dafrqfreq
Definition: spx.h:509
double dwavevopt
Definition: spx.h:509
double dvoptwave
Definition: spx.h:509
int freqener(SPX_ARGS)
Convert frequency to photon energy (vector).
double dbetavelo
Definition: spx.h:509
Definition: spx.h:479
int veloawav(SPX_ARGS)
Convert relativistic velocity to air wavelength (vector).
double dveloawav
Definition: spx.h:509
int wavefreq(SPX_ARGS)
Convert vacuum wavelength to frequency (vector).
int velobeta(SPX_ARGS)
Convert relativistic velocity to relativistic beta (vector).
double dfreqwave
Definition: spx.h:509
double dvradfreq
Definition: spx.h:509
int specx(const char *type, double spec, double restfrq, double restwav, struct spxprm *specs)
Spectral cross conversions (scalar).
int wavetype
Definition: spx.h:490
double dwavevelo
Definition: spx.h:509
struct wcserr * err
Definition: spx.h:525
int vradfreq(SPX_ARGS)
Convert radio velocity to frequency (vector).
double awav
Definition: spx.h:495
int spxperr(const struct spxprm *spx, const char *prefix)
Print error messages from a spxprm struct.
double dfreqvrad
Definition: spx.h:509
double ener
Definition: spx.h:495
double wavn
Definition: spx.h:495
double dawavfreq
Definition: spx.h:509
int betavelo(SPX_ARGS)
Convert relativistic beta to relativistic velocity (vector).
double dwavefreq
Definition: spx.h:509
double dawavvelo
Definition: spx.h:509
double vrad
Definition: spx.h:495
spx_errmsg
Definition: spx.h:478
double denerfreq
Definition: spx.h:509
Definition: spx.h:482
int zoptwave(SPX_ARGS)
Convert redshift to vacuum wavelength (vector).
double afrq
Definition: spx.h:495
Spectral variables and their derivatives.
Definition: spx.h:487
int awavwave(SPX_ARGS)
Convert air wavelength to vacuum wavelength (vector).
int velowave(SPX_ARGS)
Convert relativistic velocity to vacuum wavelength (vector).
int freqvrad(SPX_ARGS)
Convert frequency to radio velocity (vector).
double zopt
Definition: spx.h:495
void * padding
Definition: spx.h:529
int velotype
Definition: spx.h:490
int freqvelo(SPX_ARGS)
Convert frequency to relativistic velocity (vector).
double vopt
Definition: spx.h:495
int freqwavn(SPX_ARGS)
Convert frequency to wave number (vector).
double restwav
Definition: spx.h:488
int wavevelo(SPX_ARGS)
Conversions between wavelength and velocity types (vector).
double dfreqawav
Definition: spx.h:509
double restfrq
Definition: spx.h:488
int freqafrq(SPX_ARGS)
Convert frequency to angular frequency (vector).
double dwavezopt
Definition: spx.h:509
Definition: spx.h:481
int velofreq(SPX_ARGS)
Convert relativistic velocity to frequency (vector).
int awavfreq(SPX_ARGS)
Convert air wavelength to frequency (vector).
double dfreqwavn
Definition: spx.h:509
double dfreqafrq
Definition: spx.h:509
int freqwave(SPX_ARGS)
Convert frequency to vacuum wavelength (vector).
double freq
Definition: spx.h:495
int wavezopt(SPX_ARGS)
Convert vacuum wavelength to redshift (vector).
Definition: spx.h:483