71 const Agenda& opt_prop_part_agenda,
72 const Agenda& propmat_clearsky_agenda,
73 const Agenda& spt_calc_agenda,
86 const Index stokes_dim = 1;
88 assert( dtauc.
nelem() == Np_cloud-1);
89 assert( ssalb.
nelem() == Np_cloud-1);
92 Matrix abs_vec_spt_local(N_pt, stokes_dim, 0.);
93 Tensor3 ext_mat_spt_local(N_pt, stokes_dim, stokes_dim, 0.);
99 Vector ext_vector(Np_cloud);
100 Vector abs_vector(Np_cloud);
104 propmat_clearsky_local = 0.;
107 for(
Index scat_p_index_local = 0; scat_p_index_local < Np_cloud;
108 scat_p_index_local ++)
110 rtp_temperature_local =
111 t_field(scat_p_index_local, 0, 0);
117 scat_p_index_local, 0, 0,
118 rtp_temperature_local,
123 ext_mat_local, abs_vec_local,
126 scat_p_index_local, 0, 0,
127 opt_prop_part_agenda);
129 ext_vector[scat_p_index_local] = ext_mat_local(0,0,0);
130 abs_vector[scat_p_index_local] = abs_vec_local(0,0);
136 for (
Index i = 0; i < Np_cloud-1; i++)
141 ext=.5*(ext_vector[i]+ext_vector[i+1]);
142 abs=.5*(abs_vector[i]+abs_vector[i+1]);
145 ssalb[Np_cloud-2-i]=(ext-
abs)/ext;
147 rtp_pressure_local = 0.5 * (p_grid[i] + p_grid[i+1]);
148 rtp_temperature_local = 0.5 * (t_field(i,0,0) + t_field(i+1,0,0));
152 rtp_vmr_local[j] = 0.5 * (vmr_field(j, i, 0, 0) +
153 vmr_field(j, i+1, 0, 0));
155 const Vector rtp_mag_dummy(3,0);
156 const Vector ppath_los_dummy;
159 propmat_clearsky_local,
161 rtp_mag_dummy,ppath_los_dummy,
163 rtp_temperature_local,
165 propmat_clearsky_agenda);
167 Numeric abs_total = propmat_clearsky_local(
joker,0,0,0).sum();
169 dtauc[Np_cloud-2-i]=(ext+abs+abs_total)*
170 (z_field(i+1, 0, 0)-z_field(i, 0, 0));
196 scat_data_array_mono[0].za_grid.
nelem(), 0.);
199 for (
Index i_p = 0; i_p < pnd_field.
npages(); i_p++)
202 for (
Index i_t = 0; i_t < scat_data_array_mono[0].za_grid.
nelem(); i_t++)
207 for (
Index j = 0; j < scat_data_array_mono.
nelem(); j++)
208 sca_coeff += pnd_field(j, i_p, 0, 0) *
209 (scat_data_array_mono[j].ext_mat_data(0, 0, 0, 0, 0)-
210 scat_data_array_mono[j].abs_vec_data(0, 0, 0, 0, 0));
213 for (
Index j = 0; j < scat_data_array_mono.
nelem(); j++)
216 phase_function_level(i_p, i_t) +=
217 pnd_field(j, i_p, 0, 0) *
218 scat_data_array_mono[j].pha_mat_data(0, 0, i_t, 0, 0, 0, 0)
227 for (
Index i_l = 0; i_l < pnd_field.
npages()-1; i_l++)
229 for (
Index i_t=0; i_t < phase_function_level.
ncols(); i_t++)
231 if (phase_function_level(i_l, i_t) !=0 &&
232 phase_function_level(i_l+1, i_t) !=0)
233 phase_function(i_l, i_t) = .5*
234 (phase_function_level(i_l, i_t)+
235 phase_function_level(i_l+1, i_t));
260 const Index n_legendre,
264 Numeric p0_1, p0_2, p1_1, p1_2, p2_1, p2_2;
269 for (
Index i = 0; i< 181; i++)
270 za_grid[i] =
double(i);
273 gridpos(gp, scat_angle_grid, za_grid);
279 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
283 u[i] = cos(za_grid[i] *
PI/180.);
285 for (
Index i_l=0; i_l < phase_function.
nrows(); i_l++)
290 pint+=0.5*(phase_int(i_l, i)+phase_int(i_l, i+1))*
294 if (
abs(2.-pint) > 1e-4)
297 out1 <<
"Warning: The phase function is not normalized to 2\n" 298 <<
"The value is:" << pint <<
"\n";
301 pmom(i_l,
joker)= 0.;
308 pmom(phase_function.
nrows()-1-i_l,0)=1.;
317 pmom(phase_function.
nrows()-1-i_l,1)+=0.5*0.5*
318 (p1_1*phase_int(i_l, i)+
319 p1_2*phase_int(i_l, i+1))
322 for (
Index l=2; l<n_legendre; l++)
324 p2_1=(2*(double)l-1)/(double)l*u[i]*p1_1-((
double)l-1)/
326 p2_2=(2*(double)l-1)/(double)l*u[i+1]*p1_2-((
double)l-1)/
329 pmom(phase_function.
nrows()-1-i_l, l)+=0.5*0.5*
330 (p2_1*phase_int(i_l, i)+
331 p2_2*phase_int(i_l, i+1))
375 return a * f*f*f / ( exp( b*f/t ) - 1 );
INDEX Index
The type to use for all integer numbers and indices.
void opt_prop_part_agendaExecute(Workspace &ws, Tensor3 &ext_mat, Matrix &abs_vec, const Tensor3 &ext_mat_spt, const Matrix &abs_vec_spt, const Index scat_p_index, const Index scat_lat_index, const Index scat_lon_index, const Agenda &input_agenda)
Index nelem() const
Number of elements.
Declarations having to do with the four output streams.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Index npages() const
Returns the number of pages.
This file contains basic functions to handle XML data files.
Header file for interpolation.cc.
Index nelem() const
Returns the number of elements.
const Numeric BOLTZMAN_CONST
A constant view of a Tensor4.
This file contains the definition of Array.
Index ncols() const
Returns the number of columns.
void pmomCalc(MatrixView pmom, ConstMatrixView phase_function, ConstVectorView scat_angle_grid, const Index n_legendre, const Verbosity &verbosity)
pmomCalc
Declarations for agendas.
Numeric planck2(const Numeric &f, const Numeric &t)
planck
void phase_functionCalc(MatrixView phase_function, const ArrayOfSingleScatteringData &scat_data_array_mono, ConstTensor4View pnd_field)
phase_functionCalc
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void propmat_clearsky_agendaExecute(Workspace &ws, Tensor4 &propmat_clearsky, const Vector &f_grid, const Vector &rtp_mag, const Vector &rtp_los, const Numeric rtp_pressure, const Numeric rtp_temperature, const Vector &rtp_vmr, const Agenda &input_agenda)
const Numeric SPEED_OF_LIGHT
NUMERIC Numeric
The type to use for all floating point numbers.
Header file for logic.cc.
This can be used to make arrays out of anything.
A constant view of a Tensor3.
A constant view of a Vector.
A constant view of a Matrix.
Index nbooks() const
Returns the number of books.
void spt_calc_agendaExecute(Workspace &ws, Tensor3 &ext_mat_spt, Matrix &abs_vec_spt, const Index scat_p_index, const Index scat_lat_index, const Index scat_lon_index, const Numeric rtp_temperature, const Index scat_za_index, const Index scat_aa_index, const Agenda &input_agenda)
const Numeric PLANCK_CONST
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
void dtauc_ssalbCalc(Workspace &ws, VectorView dtauc, VectorView ssalb, const Agenda &opt_prop_part_agenda, const Agenda &propmat_clearsky_agenda, const Agenda &spt_calc_agenda, ConstTensor4View pnd_field, ConstTensor3View t_field, ConstTensor3View z_field, ConstVectorView p_grid, ConstTensor4View vmr_field, ConstVectorView f_mono)
dtauc_ssalbCalc
Index nrows() const
Returns the number of rows.