Go to the documentation of this file.
74 filename = batchname+
"."+varname+
".ab";
102 filename_batch( fname, batchname, varname );
104 if ( x.
nrows() != length )
107 os <<
"The file " << fname <<
" contains data of length " << x.
nrows()
108 <<
", but a length of " << length <<
" is expected.\n";
109 throw runtime_error(os.str());
114 os <<
"The file " << fname <<
" contains data for only " << x.
ncols()
115 <<
" spectra when " << n <<
" spectra shall be calculated.\n";
116 throw runtime_error(os.str());
136 #endif // HDF_SUPPORT
167 const Index& refr_lfac,
171 const Index& emission,
198 if ( ndo != tag_files.
nelem() )
201 os <<
"There is " << ndo <<
" tga groups and only " << tag_files.
nelem()
202 <<
" tag_files, even if they are empty they should match.\n";
203 throw runtime_error(os.str());
210 out2 <<
" Reading data from files.\n";
220 read_batchdata( Ts, batchname, t_file,
"t_abs", np, ncalc );
229 read_batchdata( Zs, batchname, z_file,
"z_abs", np, ncalc );
238 read_batchdata( f_oss, batchname, f_file,
"f_mono", 1, ncalc );
247 read_batchdata( za_oss, batchname, za_file,
"za_pencil", 1, ncalc );
256 for ( itag=0; itag<ndo; itag++ )
260 read_batchdata( VMRs[itag], batchname, tag_files[itag], molname, np, ncalc );
272 out2 <<
" Calculating spectra.\n";
276 out2 <<
" -------- Batch spectrum " << i <<
" --------\n";
280 assert( t.nelem()==Ts.
nrows() );
286 assert( z.nelem()==Zs.
nrows() );
300 for ( itag=0; itag<ndo; itag++ )
302 assert( vs.ncols()==VMRs[itag].nrows() );
310 if ( (i==0) || do_t || ndo || do_f )
311 absCalc(
abs, abs_per_tag, tgs, f, p_abs, t, n2_abs, h2o_abs, vs,
312 lines_per_tag, lineshape,
313 cont_description_names,
314 cont_description_models,
315 cont_description_parameters);
317 if ( (i==0) || do_z || do_za )
318 losCalc( los, z_tan, z_plat, za, l_step, p_abs, z, refr, refr_lfac,
319 refr_index, z_ground, r_geoid );
320 if ( (i==0) || do_t || do_z || do_f || do_za )
321 sourceCalc( source, emission, los, p_abs, t, f );
323 yCalc ( y, emission, los, f, y_space, source, trans, e_ground, t_ground );
331 out2 <<
" ------------------------------------\n";
377 throw runtime_error(
"This method is only available when arts is compiled with HDF support.");
379 #endif // HDF_SUPPORT
395 const Index& refr_lfac,
397 const Index& emission,
405 const Index& fine_abs_grid,
406 const Index& interpolation_in_rh,
407 const Index& za_batch,
408 const Index& e_ground_batch,
409 const Index& calc_abs,
410 const Index& calc_jac)
414 check_if_bool(interpolation_in_rh,
"Interpolation in RH keyword" );
426 absbatch.resize( radiosonde_data.
nelem() );
430 absbatch.resize( 1 );
431 absbatch[0].resize( 1, 1 );
437 jacbatch.resize( radiosonde_data.
nelem() );
441 jacbatch.resize( 1 );
442 jacbatch[0].resize( 1, 1 );
452 za_pencil_profile = za_pencil;
459 if ( radiosonde_data.
nelem() != za_pencil.
nelem() )
462 os <<
"The number of Radiosonde profiles is " << radiosonde_data.
nelem() <<
"\n"
463 <<
"The number of zenith angles given is " << za_pencil.
nelem() <<
"\n"
464 <<
"But these two are expected to be the same.\n";
465 throw runtime_error(os.str());
471 za_pencil_profile.
resize(1);
477 if ( radiosonde_data.
nelem() != e_ground.
nelem() )
480 os <<
"The number of Radiosonde profiles is " << radiosonde_data.
nelem() <<
"\n"
481 <<
"The number of emissivities given is " << e_ground.
nelem() <<
"\n"
482 <<
"But these two are expected to be the same, when e_ground_per_profile = 1 .\n";
483 throw runtime_error(os.str());
489 e_ground_profile = e_ground;
493 for (
Index i=0; i<radiosonde_data.
nelem(); ++i )
495 const Matrix& rd = radiosonde_data[i];
501 za_pencil_profile[0] = za_pencil[i];
509 e_ground_profile = e_ground[i];
516 if (min_p <= 10000.0)
519 Vector p_abs, t_abs, z_abs, h2o_abs, n2_abs;
538 absbatch[i].resize( f_mono.
nelem(), p_abs.
nelem() );
595 interpp (t_abs, p_raw, t_raw, p_abs);
596 interpp (z_abs, p_raw, z_raw, p_abs);
599 Vector vmr_raw(n_rows + 1);
601 vmr_raw[0] = rd(0,3);
608 if (interpolation_in_rh)
614 Vector sat_pres_raw(n_rows + 1);
616 Vector rh_raw(n_rows + 1);
619 assert( sat_pres_raw.
nelem() == t_raw.
nelem() );
620 assert( sat_pres_abs.
nelem() == t_abs.
nelem() );
628 rh_raw[j] = vmr_raw[j] / sat_pres_raw[j];
632 interpp (rh_abs, p_raw, rh_raw, p_abs);
637 vmrs(0, j) = rh_abs[j] * sat_pres_abs[j];
681 cont_description_names,
682 cont_description_models,
683 cont_description_parameters);
811 yTB(y, f_mono, za_pencil_profile);
839 const Index& refr_lfac,
841 const Index& emission,
855 for (
Index i=0; i<radiosonde_data.
nelem(); ++i )
857 const Matrix& rd = radiosonde_data[i];
869 interpp ( t_abs, p_raw, t_raw, p_abs );
870 interpp ( z_abs, p_raw, z_raw, p_abs );
903 cont_description_names,
904 cont_description_models,
905 cont_description_parameters);
void ybatchFromRadiosonde(Matrix &ybatch, ArrayOfMatrix &absbatch, ArrayOfMatrix &jacbatch, const ArrayOfMatrix &radiosonde_data, const Vector &f_mono, const ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape, const Numeric &z_plat, const Vector &za_pencil, const Numeric &l_step, const Index &refr, const String &refr_model, const Index &refr_lfac, const Numeric &r_geoid, const Index &emission, const Vector &y_space, const Vector &e_ground, const TagGroups &tgs, const ArrayOfString &cont_description_names, const ArrayOfString &cont_description_models, const ArrayOfVector &cont_description_parameters, const Index &fine_abs_grid, const Index &interpolation_in_rh, const Index &za_batch, const Index &e_ground_batch, const Index &calc_abs, const Index &calc_jac)
Out2 out2
Level 2 output stream.
void yCalc(Vector &, const Index &, const Los &, const Vector &, const Vector &, const ArrayOfMatrix &, const ArrayOfMatrix &, const Vector &, const Numeric &)
See the the online help (arts -d FUNCTION_NAME)
Declarations required for the calculation of absorption coefficients.
void refrCalc(Vector &, const Vector &, const Vector &, const Vector &, const Index &, const String &)
See the the online help (arts -d FUNCTION_NAME)
void absloswfsCalc(ArrayOfMatrix &, const Index &, const Los &, const ArrayOfMatrix &, const ArrayOfMatrix &, const Vector &, const Vector &, const Vector &, const Vector &, const Numeric &)
See the the online help (arts -d FUNCTION_NAME)
This file contains declerations of functions releated to atmospheric physics or geometry.
void resize(Index n)
Resize function.
void transCalc(ArrayOfMatrix &, const Los &, const Vector &, const Matrix &)
See the the online help (arts -d FUNCTION_NAME)
Index nrows() const
Returns the number of rows.
Joker joker
Define the global joker objekt.
void sourceCalc(ArrayOfMatrix &, const Index &, const Los &, const Vector &, const Vector &, const Vector &)
See the the online help (arts -d FUNCTION_NAME)
void yTB(Vector &, const Vector &, const Vector &)
See the the online help (arts -d FUNCTION_NAME)
void check_if_bool(const Index &x, const String &x_name)
Checks if an integer is 0 or 1.
void abs_per_tgReduce(ArrayOfMatrix &, const TagGroups &, const TagGroups &)
Reduces the size of abs_per_tg.
Array< SpeciesRecord > species_data
Declarations having to do with the four output streams.
void invrayjean(VectorView y, ConstVectorView f, ConstVectorView za)
Converts a vector with radiances to Rayleigh-Jean brightness temperatures.
Index ncols() const
Returns the number of columns.
void absCalc(Matrix &, ArrayOfMatrix &, const TagGroups &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Matrix &, const ArrayOfArrayOfLineRecord &, const ArrayOfLineshapeSpec &, const ArrayOfString &, const ArrayOfString &, const ArrayOfVector &)
Calculates the absorption coefficients by first calculating the cross sections per tag group and then...
NUMERIC Numeric
The type to use for all floating point numbers.
Index nelem() const
Returns the number of elements.
void e_eq_water(VectorView e_eq, ConstVectorView t)
Calculates the equilibrium water vapor pressure over liquid water.
void VectorNLogSpace(Vector &, const String &, const Numeric &start, const Numeric &stop, const Index &n)
See the the online help (arts -d FUNCTION_NAME)
Contains declerations of basic mathematical and vector/matrix functions.
void resize(Index r, Index c)
Resize function.
void losCalc(Los &, Vector &, const Numeric &, const Vector &, const Numeric &, const Vector &, const Vector &, const Index &, const Index &, const Vector &, const Numeric &, const Numeric &)
See the the online help (arts -d FUNCTION_NAME)
INDEX Index
The type to use for all integer numbers and indices.
void interpp(VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
Interpolates a vertical profile at a new set of pressures.
void get_tagindex_for_Strings(ArrayOfIndex &tags1_index, const TagGroups &tags1, const ArrayOfString &tags2_Strings)
Returns the index among some tag groups for an array of tag Strings.
This file contains basic functions to handle ASCII and binary (HDF) data files.
void ybatchFromRadiosondeGlobal(Matrix &ybatch, const ArrayOfMatrix &radiosonde_data, const Vector &f_mono, const ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape, const Numeric &z_plat, const Vector &za_pencil, const Numeric &l_step, const Index &refr, const String &refr_model, const Index &refr_lfac, const Numeric &r_geoid, const Index &emission, const Vector &y_space, const Vector &e_ground, const TagGroups &tgs, const ArrayOfString &cont_description_names, const ArrayOfString &cont_description_models, const ArrayOfVector &cont_description_parameters)
void MatrixReadBinary(Matrix &, const String &, const String &filename)
See the the online help (arts -d FUNCTION_NAME)
A constant view of a Vector.
Index nelem() const
Number of elements.
void kSpecies(Matrix &, ArrayOfString &, Matrix &, const Los &, const ArrayOfMatrix &, const Vector &, const Vector &, const TagGroups &, const ArrayOfMatrix &, const Matrix &, const Vector &, const String &unit)
See the the online help (arts -d FUNCTION_NAME)
void ybatchCalc(Matrix &, const Vector &, const Vector &, const Vector &, const Vector &, const Vector &, const Matrix &, const ArrayOfArrayOfLineRecord &, const ArrayOfLineshapeSpec &, const Vector &, const Numeric &, const Vector &, const Numeric &, const Index &, const Index &, const Vector &, const Numeric &, const Numeric &, const Index &, const Vector &, const Vector &, const Numeric &, const String &, const TagGroups &, const ArrayOfString &, const ArrayOfVector &, const ArrayOfString &, const Index &, const Index &, const String &, const Index &, const String &, const ArrayOfString &, const ArrayOfString &, const Index &, const String &, const Index &, const String &)
See the the online help (arts -d FUNCTION_NAME)
The global header file for ARTS.