-
Notifications
You must be signed in to change notification settings - Fork 17
/
spectrum.h
97 lines (67 loc) · 3.14 KB
/
spectrum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* ------- file: -------------------------- spectrum.h --------------
Version: rh2.0
Author: Han Uitenbroek (huitenbroek@nso.edu)
Last modified: Tue Jul 7 14:50:51 2009 --
-------------------------- ----------RH-- */
#ifndef __SPECTRUM_H__
#define __SPECTRUM_H__
/* --- Defines structure containing the overall set of wavelengths,
and the transitions that are active at each of the wavelengths.
-- -------------- */
#define N_MAX_OVERLAP 100
#define VACUUM_TO_AIR_LIMIT 200.0000
#define AIR_TO_VACUUM_LIMIT 199.9352
/* --- File for storage of intensities in case of angle-dependent PRD */
#define IMU_FILENAME "Imu.dat"
/* --- Stores set of active transitions at each wavelength and pointers
to temporary storage for opacity and emissivity components -- */
typedef struct{
int *Nactiveatomrt, *Nactivemolrt,
*Nlower, *Nupper, **lower_levels, **upper_levels;
double *chi, *eta, *chip, *chi_c, *eta_c, *sca_c, *chip_c;
AtomicTransition **art;
MolTransition **mrt;
} ActiveSet;
/* --- Stores emergent intensities and array of active sets -- ------ */
typedef struct {
bool_t vacuum_to_air, updateJ;
int Nspect, *PRDindex, fd_J, fd_J20, fd_Imu;
double *lambda, **J, **I, **Stokes_Q, **Stokes_U, **Stokes_V, **J20,
**Jgas, **Ilast, **v_los;
ActiveSet *as;
int *nc, *iprdh;
double *cprdh;
} Spectrum;
/* --- Associated function prototypes -- -------------- */
double Formal(int nspect, bool_t eval_operator, bool_t redistribute);
double solveSpectrum(bool_t eval_operator, bool_t redistribute);
void addtoGamma(int nspect, double wmu, double *P, double *Psi);
void addtoRates(int nspect, int mu, bool_t to_obs, double wmu,
double *I, bool_t redistribute);
void initScatter(void);
void StokesK(int nspect, int k, double chi_I, double K[4][4]);
void addtoCoupling(int nspect);
/* --- What type of lines are present in active set as? -- ---------- */
bool_t containsPolarized(ActiveSet *as);
bool_t containsBoundBound(ActiveSet *as);
bool_t containsPRDline(ActiveSet *as);
bool_t containsActive(ActiveSet *as);
void init_as(ActiveSet *as);
void alloc_as(int nspect, bool_t crosscoupling);
void free_as(int nspect, bool_t crosscoupling);
void initSpectrum(void);
void Opacity(int nspect, int mu, bool_t top_to_bottom, bool_t activate);
void Planck(long Nspace, double *T, double lambda0, double *Bnu);
void readJlambda(int nspect, double *J);
void writeJlambda(int nspect, double *J);
void readJ20lambda(int nspect, double *J20);
void writeJ20lambda(int nspect, double *J20);
void readImu(int nspect, int mu, bool_t to_obs, double *I);
void writeImu(int nspect, int mu, bool_t to_obs, double *I);
void writeSpectrum(Spectrum *spectrum);
void writeOpacity();
/* --- Wavelength conversion -- ------------- */
void vacuum_to_air(int Nlambda, double *lambda_vac, double *lambda_air);
void air_to_vacuum(int Nlambda, double *lambda_air, double *lambda_vac);
#endif /* !__SPECTRUM_H__ */
/* ------- end ---------------------------- spectrum.h -------------- */