ARTS  2.2.66
m_physics.cc
Go to the documentation of this file.
1 /* Copyright (C) 2002-2012
2  Patrick Eriksson <Patrick.Eriksson@chalmers.se>
3  Stefan Buehler <sbuehler@ltu.se>
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of the GNU General Public License as published by the
7  Free Software Foundation; either version 2, or (at your option) any
8  later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18  USA. */
19 
20 
21 
22 /*===========================================================================
23  === File description
24  ===========================================================================*/
25 
44 /*===========================================================================
45  === External declarations
46  ===========================================================================*/
47 
48 #include "arts.h"
49 #include "auto_md.h"
50 #include "check_input.h"
51 #include "logic.h"
52 #include "math_funcs.h"
53 #include "messages.h"
54 #include "physics_funcs.h"
55 
56 extern const Numeric COSMIC_BG_TEMP;
57 
58 
59 /*===========================================================================
60  === The functions (in alphabetical order)
61  ===========================================================================*/
62 
63 
64 /* Workspace method: Doxygen documentation will be auto-generated */
66  Vector& blackbody_radiation,
67  const Vector& f,
68  const Numeric& t,
69  const Verbosity&)
70 {
71  const Index n = f.nelem();
72 
73  blackbody_radiation.resize(n);
74 
75  for( Index i=0; i<n; i++ )
76  { blackbody_radiation[i] = planck( f[i], t ); }
77 }
78 
79 
80 
81 /* Workspace method: Doxygen documentation will be auto-generated */
82 void MatrixCBR(// WS Output:
83  Matrix& m,
84  // WS Input:
85  const Index& stokes_dim,
86  // WS Generic Input:
87  const Vector& f,
88  const Verbosity&)
89 {
90  const Index n = f.nelem();
91 
92  if( n == 0 )
93  throw runtime_error( "The given frequency vector is empty." );
94 
95  m.resize(n,stokes_dim);
96  m = 0;
97 
98  for( Index i=0; i<n; i++ )
99  { m(i,0) = planck( f[i], COSMIC_BG_TEMP ); }
100 }
101 
102 
103 
104 /* Workspace method: Doxygen documentation will be auto-generated */
105 void MatrixPlanck(// WS Output:
106  Matrix& m,
107  // WS Input:
108  const Index& stokes_dim,
109  // WS Generic Input:
110  const Vector& f,
111  const Numeric& t,
112  const Verbosity& verbosity)
113 {
114  CREATE_OUT2;
115 
116  const Index n = f.nelem();
117 
118  if( n == 0 )
119  throw runtime_error( "The given frequency vector is empty." );
120 
121  out2 << " Setting blackbody radiation for a temperature of " << t << " K.\n";
122 
123  m.resize(n,stokes_dim);
124  m = 0;
125 
126  for( Index i=0; i<n; i++ )
127  { m(i,0) = planck( f[i], t ); }
128 }
129 
130 
131 
132 /* Workspace method: Doxygen documentation will be auto-generated */
133 void MatrixUnitIntensity(// WS Output:
134  Matrix& m,
135  // WS Input:
136  const Index& stokes_dim,
137  // WS Generic Input:
138  const Vector& f,
139  const Verbosity& verbosity)
140 {
141  CREATE_OUT2;
142 
143  const Index n = f.nelem();
144 
145  if( n == 0 )
146  throw runtime_error( "The given frequency vector is empty." );
147 
148  out2 << " Setting unpolarised radiation with an intensity of 1.\n";
149 
150  m.resize(n,stokes_dim);
151  m = 0;
152 
153  for( Index i=0; i<n; i++ )
154  { m(i,0) = 1.0; }
155 }
Matrix
The Matrix class.
Definition: matpackI.h:788
auto_md.h
COSMIC_BG_TEMP
const Numeric COSMIC_BG_TEMP
Vector::resize
void resize(Index n)
Resize function.
Definition: matpackI.cc:798
blackbody_radiationPlanck
void blackbody_radiationPlanck(Vector &blackbody_radiation, const Vector &f, const Numeric &t, const Verbosity &)
WORKSPACE METHOD: blackbody_radiationPlanck.
Definition: m_physics.cc:65
CREATE_OUT2
#define CREATE_OUT2
Definition: messages.h:213
MatrixCBR
void MatrixCBR(Matrix &m, const Index &stokes_dim, const Vector &f, const Verbosity &)
WORKSPACE METHOD: MatrixCBR.
Definition: m_physics.cc:82
messages.h
Declarations having to do with the four output streams.
ConstVectorView::nelem
Index nelem() const
Returns the number of elements.
Definition: matpackI.cc:180
physics_funcs.h
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
Verbosity
Definition: messages.h:50
math_funcs.h
Matrix::resize
void resize(Index r, Index c)
Resize function.
Definition: matpackI.cc:1580
planck
Numeric planck(const Numeric &f, const Numeric &t)
planck
Definition: physics_funcs.cc:261
MatrixPlanck
void MatrixPlanck(Matrix &m, const Index &stokes_dim, const Vector &f, const Numeric &t, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixPlanck.
Definition: m_physics.cc:105
logic.h
Header file for logic.cc.
MatrixUnitIntensity
void MatrixUnitIntensity(Matrix &m, const Index &stokes_dim, const Vector &f, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixUnitIntensity.
Definition: m_physics.cc:133
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:35
check_input.h
Vector
The Vector class.
Definition: matpackI.h:556
arts.h
The global header file for ARTS.