Go to the documentation of this file.
60 lines_per_tg.resize( tgs.
nelem() );
64 lines_per_tg[i].resize(0);
89 out2 <<
" Reading file: " << filename <<
'\n';
104 if ( fmin <= lr.
F() )
106 if ( lr.
F() <= fmax )
113 out2 <<
" Read " << lines.
nelem() <<
" lines.\n";
138 out2 <<
" Reading file: " << filename <<
'\n';
153 if ( fmin <= lr.
F() )
155 if ( lr.
F() <= fmax )
162 out2 <<
" Read " << lines.
nelem() <<
" lines.\n";
178 out2 <<
" Reading file: " << filename <<
'\n';
194 if ( fmin <= lr.
F() )
195 if ( lr.
F() <= fmax )
199 out2 <<
" Read " << lines.
nelem() <<
" lines.\n";
222 out2 <<
" Reading file: " << filename <<
'\n';
238 if ( fmin <= lr.
F() )
240 if ( lr.
F() <= fmax )
247 out2 <<
" Read " << lines.
nelem() <<
" lines.\n";
268 out2 <<
" Reading file: " << filename <<
'\n';
280 if ( 9 <= v.nelem() )
282 if (
"ARTSCAT" == v.substr(0,7) )
284 os <<
"The ARTS line file you are trying contains a version tag "
285 <<
"different from the current version.\n"
286 <<
"Tag in file: " << v <<
"\n"
287 <<
"Current version: " << lr.
Version();
288 throw runtime_error(os.str());
292 os <<
"The ARTS line file you are trying to read does not contain a valid version tag.\n"
293 <<
"Probably it was created with an older version of ARTS that used different units.";
294 throw runtime_error(os.str());
310 if ( fmin <= lr.
F() && lr.
F() <= fmax )
316 out2 <<
" Read " << lines.
nelem() <<
" lines.\n";
387 if ( n_cat != formats.
nelem() ||
388 n_cat != fmin.
nelem() ||
389 n_cat != fmax.
nelem() )
392 os <<
"lines_per_tgReadFromCatalogues: All keyword\n"
393 <<
"parameters must get the same number of arguments.\n"
394 <<
"You specified:\n"
395 <<
"filenames: " << n_cat <<
"\n"
396 <<
"formats: " << formats.
nelem() <<
"\n"
397 <<
"fmin: " << fmin.
nelem() <<
"\n"
398 <<
"fmax: " << fmax.
nelem();
399 throw runtime_error(os.str());
408 os <<
"lines_per_tgReadFromCatalogues: You specified more\n"
409 <<
"catalugues than you have tag groups.\n"
410 <<
"You specified:\n"
411 <<
"Catalogues: " << n_cat <<
"\n"
413 throw runtime_error(os.str());
422 os <<
"lines_per_tgReadFromCatalogues: You must have at\n"
423 <<
"least one catalogue and at least one tag group.\n"
424 <<
"You specified:\n"
425 <<
"Catalogues: " << n_cat <<
"\n"
427 throw runtime_error(os.str());
441 real_tgs[0].resize(1);
448 for (
Index i=1; i<n_tg; ++i )
460 const Index that_cat =
461 (
Index)(find( real_filenames.begin(),
462 real_filenames.end(),
463 filenames[i] ) - real_filenames.begin());
464 if ( that_cat < real_filenames.
nelem() )
468 real_tgs[that_cat].push_back(i);
471 if ( formats[i] != real_formats[that_cat] ||
472 fmin[i] != real_fmin[that_cat] ||
473 fmax[i] != real_fmax[that_cat] )
476 os <<
"lines_per_tgReadFromCatalogues: If you specify the\n"
477 <<
"same catalogue repeatedly, format, fmin, and fmax must be\n"
478 <<
"consistent. There is an inconsistency between\n"
479 <<
"catalogue " << that_cat <<
" and " << i <<
".";
480 throw runtime_error(os.str());
489 real_filenames.push_back( filenames[i] );
490 real_formats.push_back ( formats[i] );
491 real_fmin.push_back ( fmin[i] );
492 real_fmax.push_back ( fmax[i] );
502 real_tgs[last_cat].push_back(i);
509 out3 <<
" Catalogues to read and tgs for which these will be used:\n";
510 for (
Index i=0; i<n_real_cat; ++i )
512 out3 <<
" " << real_filenames[i] <<
":";
514 out3 <<
" " << real_tgs[i][s];
519 lines_per_tg.resize( tgs.
nelem() );
522 for (
Index i=0; i<n_real_cat; ++i )
528 if (
"HITRAN96"==real_formats[i] )
532 else if (
"HITRAN04"==real_formats[i] )
536 else if (
"MYTRAN2"==real_formats[i] )
540 else if (
"JPL"==real_formats[i] )
544 else if (
"ARTS"==real_formats[i] )
551 os <<
"lines_per_tgReadFromCatalogues: You specified the\n"
552 <<
"format `" << real_formats[i] <<
"', which is unknown.\n"
553 <<
"Allowd formats are: HITRAN96, HITRAN04, MYTRAN2, JPL, ARTS.";
554 throw runtime_error(os.str());
559 TagGroups these_tgs(real_tgs[i].nelem());
562 these_tgs[s] = tgs[real_tgs[i][s]];
572 lines_per_tg[real_tgs[i][s]] = these_lines_per_tg[s];
596 std::vector<bool> species_used (
species_data.nelem(),
false);
604 for (
Index i=0; i<lines_per_tg.
nelem(); ++i )
625 for ( j=0; j<tgs.
nelem() && !found ; ++j )
628 for (
Index k=0; k<tgs[j].
nelem() && !found; ++k )
632 const OneTag& this_tag = tgs[j][k];
658 if ( this_tag.
Lf() >= 0 )
659 if ( this_tag.
Lf() > this_line.
F() )
663 if ( this_tag.
Uf() >= 0 )
664 if ( this_tag.
Uf() < this_line.
F() )
679 lines_per_tg[j-1].push_back(this_line);
682 if ( !species_used[this_line.
Species()] )
683 species_used[this_line.
Species()] =
true;
689 if ( species_used[this_line.
Species()] )
691 out2 <<
"Your tags include other lines of species "
694 <<
"why do you not include line "
706 out3 <<
" " << i <<
":";
709 out3 <<
" " << tgs[i][s].Name();
711 out3 <<
": " << lines_per_tg[i].
nelem() <<
" lines\n";
730 for (
Index i=0; i<lines_per_tg.
nelem(); ++i )
736 ll.reserve(2*
ll.nelem());
745 for (
Index j=0; j<n; ++j )
748 dummy.
setF( -dummy.
F() );
775 if ( lines_per_tg.
nelem() != lineshape.
nelem() )
778 os <<
"Dimension of lines_per_tg does\n"
779 <<
"not match that of lineshape.";
780 throw runtime_error(os.str());
786 if ( f_mono[s+1] <= f_mono[s] )
789 os <<
"The frequency grid f_mono is not properly sorted.\n"
790 <<
"f_mono[" << s <<
"] = " << f_mono[s] <<
"\n"
791 <<
"f_mono[" << s+1 <<
"] = " << f_mono[s+1];
792 throw runtime_error(os.str());
797 for (
Index i=0; i<lines_per_tg.
nelem(); ++i )
800 Numeric cutoff = lineshape[i].Cutoff();
810 Numeric low = f_mono[0] - cutoff;
814 for ( ArrayOfLineRecord::iterator j=
ll.begin(); j<
ll.end(); ++j )
819 if ( ( F0 >= low) && ( F0 <= upp) )
831 if (keep.
nelem () !=
ll.nelem ())
836 = keep.begin(); j != keep.end(); j++)
857 if (
"" == filename )
865 out2 <<
" Writing file: " << filename <<
'\n';
880 if (
"" == filename )
888 out2 <<
" Writing file: " << filename <<
'\n';
891 os << lines_per_tg.
nelem() <<
'\n';
893 for (
Index i=0; i<lines_per_tg.
nelem(); ++i )
906 tgs.resize(tags.
nelem());
919 String these_tags = tags[i];
923 if ( n == these_tags.
npos )
927 tag_def.push_back(these_tags);
932 tag_def.push_back(these_tags.substr(0,n));
933 these_tags.erase(0,n+1);
946 while (
' ' == tag_def[s][0] ||
947 '\t' == tag_def[s][0] ) tag_def[s].erase(0,1);
949 OneTag this_tag(tag_def[s]);
953 if ( tgs[i][0].Species() != this_tag.
Species() )
954 throw runtime_error(
"Tags in a tag group must belong to the same species.");
956 tgs[i].push_back(this_tag);
961 out3 <<
" Defined tag groups:";
964 out3 <<
"\n " << i <<
":";
967 out3 <<
" " << tgs[i][s].Name();
991 const String filename = basename +
"." + specname +
".aa";
1002 included.push_back(specname);
1005 OneTag this_tag(specname);
1009 this_group[0] = this_tag;
1012 tgs.push_back(this_group);
1014 catch (runtime_error x)
1017 excluded.push_back(specname);
1022 out2 <<
" Included Species (" << included.nelem() <<
"):\n";
1023 for (
Index i=0; i<included.nelem(); ++i )
1024 out2 <<
" " << included[i] <<
"\n";
1026 out2 <<
" Excluded Species (" << excluded.
nelem() <<
"):\n";
1028 out2 <<
" " << excluded[i] <<
"\n";
1036 const String& normalizationfactor,
1046 lineshape.resize(tag_sz);
1055 out2 <<
" Selected lineshape: " << str <<
"\n";
1065 if (str == normalizationfactor)
1067 out2 <<
" Selected normalization factor : " << normalizationfactor <<
"\n";
1069 if ( (cutoff != -1) && (cutoff < 0.0) )
1070 throw runtime_error(
" Cutoff must be -1 or positive.");
1071 out2 <<
" Selected cutoff frequency [Hz] : " << cutoff <<
"\n";
1079 throw runtime_error(
"Selected lineshape not available.");
1081 throw runtime_error(
"Selected normalization to lineshape not available.");
1085 for (
Index i=0; i<tag_sz; i++)
1087 lineshape[i].SetInd_ls( found0 );
1088 lineshape[i].SetInd_lsn( found1 );
1089 lineshape[i].SetCutoff( cutoff );
1107 if ( (tg_sz != shape.
nelem()) ||
1108 (tg_sz != normalizationfactor.
nelem()) ||
1109 (tg_sz != cutoff.
nelem()) )
1112 os <<
"lineshape_per_tgDefine: number of elements does\n"
1113 <<
"not match the number of tag groups defined.";
1114 throw runtime_error(os.str());
1119 lineshape.resize(tg_sz);
1122 for (
Index k=0; k<tg_sz; ++k)
1128 if (str == shape[k])
1130 out2 <<
" Tag Group: [";
1132 out2 << tgs[k][s].Name() <<
", ";
1133 out2 << tgs[k][tgs[k].
nelem()-1].Name() <<
"]\n";
1134 out2 <<
" Selected lineshape: " << str <<
"\n";
1144 if (str == normalizationfactor[k])
1146 out2 <<
" Selected normalization factor: " << normalizationfactor[k] <<
"\n";
1147 if ( (cutoff[k] != -1) && (cutoff[k] < 0.0) )
1148 throw runtime_error(
" Cutoff must be -1 or positive.");
1149 out2 <<
" Selected cutoff frequency : " << cutoff[k] <<
"\n";
1159 os <<
"Selected lineshape not available: "<< shape[k] <<
"\n";
1160 throw runtime_error(os.str());
1165 os <<
"Selected normalization to lineshape not available: "<<
1166 normalizationfactor[k] <<
"\n";
1167 throw runtime_error(os.str());
1171 lineshape[k].SetInd_ls( found0 );
1172 lineshape[k].SetInd_lsn( found1 );
1173 lineshape[k].SetCutoff( cutoff[k] );
1198 raw_vmrs.push_back(
Matrix());
1206 <<
" profile read from file: " << name <<
"\n";
1244 true_filenames = basename +
'.';
1250 true_filenames[i] +=
1260 true_filenames[i_seltags[i]] = filenames[i];
1267 raw_vmrs.push_back(
Matrix());
1275 <<
" profile read from file: " << true_filenames[i] <<
"\n";
1373 if (tag_name ==
"liquidcloud")
1377 if (tag_name ==
"icecloud")
1381 if (tag_name ==
"H2O")
1393 out2 <<
"WaterVaporSaturationInClouds: no H2O profile found to adjust for clouds.\n"
1394 <<
"Therefore no saturation calculation is performed\n";
1400 if ( (liquid_index >= 0) && (liquid_index < tgs.
nelem()) )
1403 for (
Index uu=0; uu<u; ++uu)
1407 if (vmrs(liquid_index,i) > 0.000)
1410 Numeric p_dry = p_abs[i] * ( 1.000e0 - vmrs(h2o_index[uu],i) );
1414 p_abs[i] = e_s + p_dry;
1416 vmrs(h2o_index[uu],i) = e_s / p_abs[i];
1418 if ( (vmrs(h2o_index[uu],i) < 0.000e0) || (vmrs(h2o_index[uu],i) > 1.000e0) )
1421 os <<
"WaterVaporSaturationInClouds: The water vapor VMR value "
1422 << vmrs(h2o_index[uu],i) <<
"\n"
1423 <<
" looks strange after setting it to the saturation pressure over liquid water.";
1424 throw runtime_error(os.str());
1435 if ( (ice_index >= 0) && (ice_index < tgs.
nelem()) )
1437 for (
Index uu=0; uu<u; ++uu)
1441 if (vmrs(ice_index,i) > 0.000)
1444 Numeric p_dry = p_abs[i] * ( 1.000e0 - vmrs(h2o_index[uu],i) );
1448 p_abs[i] = e_s + p_dry;
1450 vmrs(h2o_index[uu],i) = e_s / p_abs[i];
1452 if ( (vmrs(h2o_index[uu],i) < 0.000e0) || (vmrs(h2o_index[uu],i) > 1.000e0) )
1455 os <<
"WaterVaporSaturationInClouds: The water vapor VMR value "
1456 << vmrs(h2o_index[uu],i) <<
"\n"
1457 <<
" looks strange after setting it to the saturation pressure over ice.";
1458 throw runtime_error(os.str());
1497 if ( 3 != raw_ptz.
ncols() )
1500 os <<
"The variable raw_ptz does not have the right dimensions,\n"
1501 <<
"ncols() should be 3, but is actually "<< raw_ptz.
ncols();
1502 throw runtime_error(os.str());
1552 const Matrix& raw = raw_vmrs[j];
1558 if ( 2 != raw.
ncols() )
1561 os <<
"The variable raw_vmrs("
1563 <<
") does not have the right dimensions,\n"
1564 <<
"ncols() should be 2, but is actually "<< raw.
ncols();
1565 throw runtime_error(os.str());
1613 const Index& niter )
1635 const Index& niter )
1659 const Index& niter )
1668 hse[1] = p_abs[index];
1669 hse[2] = z_abs[index];
1686 const Index& niter )
1688 hseSet( hse, p_abs[0], z_abs[0], g0, niter );
1726 "the HSE flag (first element of hse)");
1730 if ( hse.
nelem() != 5 )
1731 throw runtime_error(
"The length of the *hse* vector must be 5.");
1750 throw runtime_error(
"The number of iterations must be > 0.");
1752 for (
Index iter=0; iter<niter; iter++ )
1758 for ( i=0; i<np-1; i++ )
1761 g = (
g_of_z(r_geoid,g0,z_abs[i]) +
1762 g_of_z(r_geoid,g0,z_abs[i+1]) ) / 2.0;
1766 r = 18/28.96 * (h2o_abs[i]+h2o_abs[i+1])/2;
1769 tv = (1+0.61*r) * (t_abs[i]+t_abs[i+1])/2;
1772 dz = 287.053*tv/g * log( p_abs[i]/p_abs[i+1] );
1773 ztmp[i+1] = ztmp[i] + dz;
1777 dz =
interpp( p_abs, ztmp, pref ) - zref;
1802 for(
Index i=0; i<n && found<0; i++ )
1804 s = tgs[i][0].Name();
1806 if ( s.substr(0,4) ==
"H2O-" )
1830 out2 <<
" WARNING in h2o_absSet: could not find any H2O tag. So H2O vmr is set to zero!\n";
1831 for(
Index i=0; i<h2o_abs.
nelem(); i++ ) h2o_abs[i] = 0.0000000000e0;
1858 throw runtime_error(
"vmrScale: Number of tgs and fac are different!");
1864 for ( itag=0; itag<n; itag++ )
1867 vmrs(tagindex[itag],
Range(
joker)) *= scalfac[itag];
1895 for(
Index i=0; i<n && found<0; i++ )
1897 s = tgs[i][0].Name();
1899 if ( s.substr(0,3) ==
"N2-" )
1923 out2 <<
" WARNING in n2_absSet: could not find any N2 tag. So N2 vmr is set to zero!\n";
1924 for(
Index i=0; i<n2_abs.
nelem(); i++ ) n2_abs[i] = 0.0000000000e0;
1998 cont_description_names,
1999 cont_description_parameters,
2000 cont_description_models);
2079 out2 <<
" Number of tag groups to do: " << tgs.
nelem() <<
"\n";
2084 out2 <<
" Doing tag group " << i <<
".\n";
2087 this_tg[0].resize(tgs[i].nelem());
2088 this_tg[0] = tgs[i];
2094 these_lines[0].resize(lines_per_tg[i].nelem());
2095 these_lines[0] = lines_per_tg[i];
2098 this_lineshape[0] = lineshape[i];
2120 cont_description_names,
2121 cont_description_parameters,
2122 cont_description_models);
2130 assert(
abs.nrows()==this_abs.
nrows());
2131 assert(
abs.ncols()==this_abs.
ncols());
2164 os <<
"Variable vmrs must have compatible dimension to xsec_per_tg.\n"
2165 <<
"vmrs.nrows() = " << vmrs.
nrows() <<
'\n'
2166 <<
"xsec_per_tg.nelem() = " << xsec_per_tg.
nelem();
2167 throw runtime_error(os.str());
2173 if ( vmrs.
ncols() != xsec_per_tg[0].ncols() )
2176 os <<
"Variable vmrs must have same numbers of altitudes as xsec_per_tg.\n"
2177 <<
"vmrs.ncols() = " << vmrs.
ncols() <<
'\n'
2178 <<
"xsec_per_tg[0].ncols() = " << xsec_per_tg[0].ncols();
2179 throw runtime_error(os.str());
2185 abs.resize( xsec_per_tg[0].nrows(), xsec_per_tg[0].ncols() );
2188 abs_per_tg.resize( xsec_per_tg.
nelem() );
2190 out2 <<
" Computing abs and abs_per_tg from xsec_per_tg.\n";
2193 for (
Index i=0; i<xsec_per_tg.
nelem(); ++i )
2195 out2 <<
" Tag group " << i <<
'\n';
2198 abs_per_tg[i].resize( xsec_per_tg[i].nrows(), xsec_per_tg[i].ncols() );
2202 for (
Index j=0; j<xsec_per_tg[i].ncols(); j++)
2205 for (
Index k=0; k<xsec_per_tg[i].nrows(); k++)
2207 abs_per_tg[i](k,j) = xsec_per_tg[i](k,j) * vmrs(i,j);
2212 abs += abs_per_tg[i];
2241 xsec_per_tg.resize( tgs.
nelem() );
2248 xsec_per_tg[i].resize( f_mono.
nelem(), p_abs.
nelem() );
2252 out2 <<
" Initialized xsec_per_tg.\n"
2253 <<
" Number of frequencies : " << f_mono.
nelem() <<
"\n"
2254 <<
" Number of pressure levels : " << p_abs.
nelem() <<
"\n";
2295 if ( n_tgs != n_xsec ||
2301 os <<
"The following variables must all have the same dimension:\n"
2302 <<
"tgs: " << tgs.
nelem() <<
'\n'
2303 <<
"xsec_per_tg: " << xsec_per_tg.
nelem() <<
'\n'
2304 <<
"vmrs: " << vmrs.
nrows() <<
'\n'
2305 <<
"lines_per_tg: " << lines_per_tg.
nelem() <<
'\n'
2306 <<
"lineshape: " << lineshape.
nelem();
2307 throw runtime_error(os.str());
2313 out2 <<
" Calculating line spectra.\n";
2350 out2 <<
" Tag group " << i
2362 if ( 0 <
ll.nelem() )
2391 if (
"O2" == species_name )
2395 if ( 0 !=
ll[0].Naux() )
2399 if (
"Rosenkranz_Voigt_Drayson" != lineshape_name &&
2400 "Rosenkranz_Voigt_Kuntz6" != lineshape_name )
2404 <<
"You are using a line catalogue that contains auxiliary parameters to\n"
2405 <<
"take care of overlap for oxygen lines. But you are not using a\n"
2406 <<
"lineshape that uses these parameters. Use Rosenkranz_Voigt_Drayson or\n"
2407 <<
"Rosenkranz_Voigt_Kuntz6.";
2408 throw runtime_error(os.str());
2415 if (
"Rosenkranz_Voigt_Drayson" == lineshape_name ||
2416 "Rosenkranz_Voigt_Kuntz6" == lineshape_name )
2419 if (
"O2" != species_name )
2423 <<
"You are trying to use one of the special Rosenkranz lineshapes with\n"
2424 <<
"overlap correction for a species other than oxygen. Your species is\n"
2425 << species_name <<
".\n"
2426 <<
"Select another lineshape for this species.";
2427 throw runtime_error(os.str());
2433 if ( 0 ==
ll[0].Naux() )
2437 <<
"You are trying to use one of the special Rosenkranz lineshapes with\n"
2438 <<
"overlap correction. But your line file does not contain aux\n"
2439 <<
"parameters. (I've checked only the first LineRecord). Use a line file\n"
2440 <<
"with overlap parameters.";
2441 throw runtime_error(os.str());
2446 out2 <<
ll.nelem() <<
" transitions\n";
2463 out2 <<
ll.nelem() <<
" transitions, skipping\n";
2512 if ( n_tgs != n_xsec || n_tgs != n_vmrs )
2515 os <<
"The following variables must all have the same dimension:\n"
2516 <<
"tgs: " << tgs.
nelem() <<
'\n'
2517 <<
"xsec_per_tg: " << xsec_per_tg.
nelem() <<
'\n'
2518 <<
"vmrs: " << vmrs.
nrows();
2519 throw runtime_error(os.str());
2525 if ( cont_description_names.
nelem() !=
2526 cont_description_parameters.
nelem() )
2528 for (
Index i=0; i < cont_description_names.
nelem(); ++i)
2530 cout <<
"xsec_per_tgAddConts: " << i <<
" name : " << cont_description_names[i] <<
"\n";
2532 for (
Index i=0; i < cont_description_parameters.
nelem(); ++i)
2534 cout <<
"xsec_per_tgAddConts: " << i <<
" param: " << cont_description_parameters[i] <<
"\n";
2536 for (
Index i=0; i < cont_description_models.
nelem(); ++i)
2538 cout <<
"xsec_per_tgAddConts: " << i <<
" option: " << cont_description_models[i] <<
"\n";
2541 os <<
"The following variables must have the same dimension:\n"
2542 <<
"cont_description_names: " << cont_description_names.
nelem() <<
'\n'
2543 <<
"cont_description_parameters: " << cont_description_parameters.
nelem();
2544 throw runtime_error(os.str());
2548 for (
Index i=0; i<cont_description_names.
nelem(); ++i )
2553 out2 <<
" Calculating continuum spectra.\n";
2569 if ( tgs[i][s].Isotope() <
2595 species_data[tgs[i][s].Species()].Isotope()[tgs[i][s].Isotope()].Abundance() )
2603 +
species_data[tgs[i][s].Species()].Isotope()[tgs[i][s].Isotope()].Name();
2613 (
Index)(find( cont_description_names.begin(),
2614 cont_description_names.end(),
2615 name ) - cont_description_names.begin());
2619 if ( n==cont_description_names.
nelem() )
2622 os <<
"Cannot find model " << name
2623 <<
" in cont_description_names.";
2624 throw runtime_error(os.str());
2630 out2 <<
" Adding " << name
2631 <<
" to tag group " << i <<
".\n";
2635 const String ContOption = cont_description_models[n];
2644 cont_description_parameters[n],
2645 cont_description_models[n],
2680 throw(runtime_error(
"The variables abs_per_tg and tgs must\n"
2681 "have the same dimension."));
2696 abs_per_tg_out[i].resize( abs_per_tg[n].nrows(), abs_per_tg[n].ncols() );
2697 abs_per_tg_out[i] = abs_per_tg[n];
2703 abs_per_tg.resize( wfs_tgs.
nelem() );
2704 abs_per_tg = abs_per_tg_out;
2731 throw runtime_error(
"The length factor cannot be smaller than 1.");
2751 refrSet( refr, refr_lfac, refr_model, 0,
"", 1 );
2769 const String& refr_model )
2778 if ( refr_model ==
"Unity" )
2785 else if ( refr_model ==
"Boudouris" )
2788 else if ( refr_model ==
"BoudourisDryAir" )
2794 os <<
"Unknown refraction parameterization: " << refr_model <<
"\n"
2795 <<
"Existing parameterizations are: \n"
2798 <<
"BoudourisDryAir";
2799 throw runtime_error(os.str());
2835 out2 <<
" Initialized cont_description_names \n"
2836 " cont_description_models\n"
2837 " cont_description_parameters.\n";
2858 const Vector& userparameters)
2868 cont_description_names.push_back(tagname);
2869 cont_description_models.push_back(model);
2870 cont_description_parameters.push_back(userparameters);
void tgsDefineAllInScenario(TagGroups &tgs, const String &basename)
Out2 out2
Level 2 output stream.
Numeric Uf() const
The upper line center frequency in Hz: If this is <0 it means no upper limit.
void refr_index_Boudouris(Vector &refr_index, ConstVectorView p_abs, ConstVectorView t_abs, ConstVectorView h2o_abs)
Calculates the refractive index at microwave frequncies following Boudouris 1963.
void refr_index_BoudourisDryAir(Vector &refr_index, ConstVectorView p_abs, ConstVectorView t_abs)
Calculates the refractive index for dry air at microwave frequncies following Boudouris 1963.
Declarations required for the calculation of absorption coefficients.
This file contains declerations of functions releated to atmospheric physics or geometry.
void cont_descriptionAppend(ArrayOfString &cont_description_names, ArrayOfString &cont_description_models, ArrayOfVector &cont_description_parameters, const String &tagname, const String &model, const Vector &userparameters)
Append a continuum description to ‘cont_description_names’ and ‘cont_description_parameters’.
Array< LineRecord > ArrayOfLineRecord
Holds a list of spectral line data.
ConstMatrixView transpose(ConstMatrixView m)
Const version of transpose.
const Index & Ind_ls() const
Return the index of this lineshape.
void h2o_absSet(Vector &h2o_abs, const TagGroups &tgs, const Matrix &vmrs)
See the the online help (arts -d FUNCTION_NAME)
void raw_vmrsReadFromFiles(ArrayOfMatrix &raw_vmrs, const TagGroups &tgs, const ArrayOfString &seltags, const ArrayOfString &filenames, const String &basename)
Reads in the profiles from the specified files in filenames for the tag list seltags and for all the ...
String get_tag_group_name(const Array< OneTag > &tg)
Print the name of a tag group.
void check_lengths(const Vector &x1, const String &x1_name, const Vector &x2, const String &x2_name)
Checks that two vectors have the same length.
String Version() const
Return the version String.
void tgsDefine(TagGroups &tgs, const ArrayOfString &tags)
void resize(Index n)
Resize function.
void linesReadFromMytran2(ArrayOfLineRecord &lines, const String &filename, const Numeric &fmin, const Numeric &fmax)
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
Index Species() const
Molecular species index.
Index nrows() const
Returns the number of rows.
void hseCalc(Vector &z_abs, const Vector &p_abs, const Vector &t_abs, const Vector &h2o_abs, const Numeric &r_geoid, const Vector &hse)
See the the online help (arts -d FUNCTION_NAME)
void n2_absSet(Vector &n2_abs, const TagGroups &tgs, const Matrix &vmrs)
See the the online help (arts -d FUNCTION_NAME) Just a copy of the function 'h2o_absSet' but now for ...
void lines_per_tgCreateFromLines(ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineRecord &lines, const TagGroups &tgs)
void get_tag_group_index_for_tag_group(Index &tgs1_index, const TagGroups &tgs1, const Array< OneTag > &tg2)
Returns the index of the tag group tg2 within the array of tag groups tgs1.
bool ReadFromHitran2004Stream(istream &is)
Read one line from a stream associated with a HITRAN 2004 file.
void xsec_species(MatrixView xsec, ConstVectorView f_mono, ConstVectorView p_abs, ConstVectorView t_abs, ConstVectorView h2o_abs, ConstVectorView vmr, const ArrayOfLineRecord &lines, const Index ind_ls, const Index ind_lsn, const Numeric cutoff)
Calculate line absorption cross sections for one tag group.
void linesReadFromHitran(ArrayOfLineRecord &lines, const String &filename, const Numeric &fmin, const Numeric &fmax)
Reads line data in the Hitran 1986-2001 format (100 characters/record).
This file contains the definition of Array.
Joker joker
Define the global joker objekt.
void refrCalc(Vector &refr_index, const Vector &p_abs, const Vector &t_abs, const Vector &h2o_abs, const Index &refr, const String &refr_model)
See the the online help (arts -d FUNCTION_NAME)
void refrOff(Index &refr, Index &refr_lfac, String &refr_model)
See the the online help (arts -d FUNCTION_NAME)
const Numeric & Cutoff() const
Return the cutoff frequency (in Hz).
void vmrsScale(Matrix &vmrs, const TagGroups &tgs, const ArrayOfString &scaltgs, const Vector &scalfac)
See the the online help (arts -d FUNCTION_NAME)
This header file contains all the declarations of the implemented continua and full absorption (lines...
bool ReadFromJplStream(istream &is)
Read one line from a stream associated with a JPL file.
const Index & Ind_lsn() const
Return the index of the normalization factor.
void xsec_per_tgAddConts(ArrayOfMatrix &xsec_per_tg, const TagGroups &tgs, const Vector &f_mono, const Vector &p_abs, const Vector &t_abs, const Vector &n2_abs, const Vector &h2o_abs, const Matrix &vmrs, const ArrayOfString &cont_description_names, const ArrayOfVector &cont_description_parameters, const ArrayOfString &cont_description_models)
Calculates the continuum for each tag group and adds it to xsec_per_tg.
void lineshape_per_tgDefine(ArrayOfLineshapeSpec &lineshape, const TagGroups &tgs, const ArrayOfString &shape, const ArrayOfString &normalizationfactor, const Vector &cutoff)
void check_continuum_model(const String &name)
An auxiliary functions that checks if a given continuum model is listed in species_data....
void linesReadFromArts(ArrayOfLineRecord &lines, const String &filename, const Numeric &fmin, const Numeric &fmax)
void check_if_bool(const Index &x, const String &x_name)
Checks if an integer is 0 or 1.
void hseSet(Vector &hse, const Numeric &pref, const Numeric &zref, const Numeric &g0, const Index &niter)
See the the online help (arts -d FUNCTION_NAME)
Array< SpeciesRecord > species_data
Declarations having to do with the four output streams.
bool ReadFromMytran2Stream(istream &is)
Read one line from a stream associated with a MYTRAN2 file.
void write_lines_to_stream(ostream &os, const ArrayOfLineRecord &lines)
A helper function that writes lines in a line list to a stream.
Index ncols() const
Returns the number of columns.
Numeric g_of_lat(Numeric latitude)
Calculates the gravitational accelaration for a geocentric latitude.
bool ReadFromHitranStream(istream &is)
Read one line from a stream associated with a HITRAN 1986-2001 file.
void hseOff(Vector &hse)
See the the online help (arts -d FUNCTION_NAME)
void lines_per_tgAddMirrorLines(ArrayOfArrayOfLineRecord &lines_per_tg)
Adds mirror lines at negative frequencies to the lines_per_tg.
void cont_descriptionInit(ArrayOfString &names, ArrayOfString &options, ArrayOfVector ¶meters)
Initializes the two continuum description WSVs, ‘cont_description_names’ and ‘cont_description_parame...
NUMERIC Numeric
The type to use for all floating point numbers.
void linesReadFromJpl(ArrayOfLineRecord &lines, const String &filename, const Numeric &fmin, const Numeric &fmax)
Index nelem() const
Returns the number of elements.
void lines_per_tgReadFromCatalogues(ArrayOfArrayOfLineRecord &lines_per_tg, const TagGroups &tgs, const ArrayOfString &filenames, const ArrayOfString &formats, const Vector &fmin, const Vector &fmax)
This method can read lines from different line catalogues.
Index Isotope() const
The index of the isotopic species that this line belongs to.
Array< Array< LineRecord > > ArrayOfArrayOfLineRecord
Holds a lists of spectral line data for each tag group.
void lineshapeDefine(ArrayOfLineshapeSpec &lineshape, const TagGroups &tgs, const String &shape, const String &normalizationfactor, const Numeric &cutoff)
const Array< IsotopeRecord > & Isotope() const
Numeric WVSatPressureLiquidWater(const Numeric t)
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization.
Contains declerations of basic mathematical and vector/matrix functions.
Spectral line catalog data.
The class MakeVector is a special kind of Vector that can be initialized explicitly from one or more ...
void linesWriteAscii(const ArrayOfLineRecord &lines, const String &f)
void xsec_per_tgAddLines(ArrayOfMatrix &xsec_per_tg, const TagGroups &tgs, const Vector &f_mono, const Vector &p_abs, const Vector &t_abs, const Vector &h2o_abs, const Matrix &vmrs, const ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape)
Calculates the line spectrum for each tag group and adds it to xsec_per_tg.
void xsec_per_tgInit(ArrayOfMatrix &xsec_per_tg, const TagGroups &tgs, const Vector &f_mono, const Vector &p_abs)
Initialize xsec_per_tg.
void setF(Numeric new_mf)
Set the line center frequency in Hz.
void resize(Index r, Index c)
Resize function.
Index Species() const
The index of the molecular species that this line belongs to.
String out_basename
The basename for the report file and for all other output files.
void open_output_file(ofstream &file, const String &name)
Open a file for writing.
Lineshape related specification like which lineshape to use, the normalizationfactor,...
A tag group can consist of the sum of several of these.
void hseSetFromLatitude(Vector &hse, const Numeric &pref, const Numeric &zref, const Numeric &latitude, const Index &niter)
See the the online help (arts -d FUNCTION_NAME)
Numeric g_of_z(Numeric r_geoid, Numeric g0, Numeric z)
Calculates the gravitational accelaration for a geometrical altitude.
void AtmFromRaw(Vector &t_abs, Vector &z_abs, Matrix &vmrs, const TagGroups &tgs, const Vector &p_abs, const Matrix &raw_ptz, const ArrayOfMatrix &raw_vmrs)
Interpolate atmospheric quantities from their individual grids to the common p_abs grid.
Out3 out3
Level 3 output stream.
Numeric wavenumber_to_joule(Numeric e)
A little helper function to convert energy from units of wavenumber (cm^-1) to Joule (J).
INDEX Index
The type to use for all integer numbers and indices.
void lines_per_tgSetEmpty(ArrayOfArrayOfLineRecord &lines_per_tg, const TagGroups &tgs)
See the the online help (arts -d FUNCTION_NAME)
bool ReadFromArtsStream(istream &is)
Read one line from a stream associated with an Arts file.
const String & Name() const
void raw_vmrsReadFromScenario(ArrayOfMatrix &raw_vmrs, const TagGroups &tgs, const String &basename)
Parameters parameters
Holds the command line parameters.
const SpeciesRecord & SpeciesData() const
The matching SpeciesRecord from species_data.
void hseSetFromLatitudeIndex(Vector &hse, const Vector &p_abs, const Vector &z_abs, const Numeric &latitude, const Index &index, const Index &niter)
See the the online help (arts -d FUNCTION_NAME)
Array< LineshapeRecord > lineshape_data
void absCalcFromXsec(Matrix &abs, ArrayOfMatrix &abs_per_tg, const ArrayOfMatrix &xsec_per_tg, const Matrix &vmrs)
Calculates the absorption from a given cross section.
void MatrixReadAscii(Matrix &, const String &, const String &filename)
void interpp(VectorView x, ConstVectorView p0, ConstVectorView x0, ConstVectorView p)
Interpolates a vertical profile at a new set of pressures.
Index Isotope() const
Isotopic species index.
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.
Numeric Lf() const
The lower line center frequency in Hz.
This file contains basic functions to handle ASCII and binary (HDF) data files.
Explicit construction of Arrays.
void linesReadFromHitran2004(ArrayOfLineRecord &lines, const String &filename, const Numeric &fmin, const Numeric &fmax)
Reads line data in the Hitran 2004 format (160 characters/record).
void hseFromBottom(Vector &hse, const Vector &p_abs, const Vector &z_abs, const Numeric &g0, const Index &niter)
See the the online help (arts -d FUNCTION_NAME)
Array< LineshapeNormRecord > lineshape_norm_data
void WaterVaporSaturationInClouds(Matrix &vmrs, Vector &p_abs, const Vector &t_abs, const TagGroups &tgs)
Calculates the water vapor saturation volume mixing ratio (VMR) in the vertical range where liquid or...
void linesElowToJoule(ArrayOfLineRecord &lines)
static const Index npos
Define npos:
void abs_per_tgReduce(ArrayOfMatrix &abs_per_tg, const TagGroups &tgs, const TagGroups &wfs_tgs)
Reduces the size of abs_per_tg.
Numeric F() const
The line center frequency in Hz.
void lines_per_tgWriteAscii(const ArrayOfArrayOfLineRecord &lines_per_tg, const String &f)
void lines_per_tgCompact(ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape, const Vector &f_mono)
Removes all lines outside the defined lineshape cutoff frequency from the lines_per_tg,...
void refrSet(Index &refr, Index &refr_lfac, String &refr_model, const Index &on, const String &model, const Index &lfac)
See the the online help (arts -d FUNCTION_NAME)
void absCalcSaveMemory(Matrix &abs, const TagGroups &tgs, const Vector &f_mono, const Vector &p_abs, const Vector &t_abs, const Vector &n2_abs, const Vector &h2o_abs, const Matrix &vmrs, const ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape, const ArrayOfString &cont_description_names, const ArrayOfString &cont_description_models, const ArrayOfVector &cont_description_parameters)
Calculates the absorption coefficients by first calculating the cross sections per tag group and then...
Index nelem() const
Number of elements.
void xsec_continuum_tag(MatrixView xsec, const String &name, ConstVectorView parameters, const String &model, ConstVectorView f_mono, ConstVectorView p_abs, ConstVectorView t_abs, ConstVectorView n2_abs, ConstVectorView h2o_abs, ConstVectorView vmr)
Calculates model absorption for one continuum or full model tag.
Numeric WVSatPressureIce(const Numeric t)
void check_if_in_range(const Numeric &x_low, const Numeric &x_high, const Numeric &x, const String &x_name)
Checks if a numeric variable is inside a specified range.
Declares the enum type that acts as a handle for workspace variables. Also declares the workspace its...
The global header file for ARTS.
void absCalc(Matrix &abs, ArrayOfMatrix &abs_per_tg, const TagGroups &tgs, const Vector &f_mono, const Vector &p_abs, const Vector &t_abs, const Vector &n2_abs, const Vector &h2o_abs, const Matrix &vmrs, const ArrayOfArrayOfLineRecord &lines_per_tg, const ArrayOfLineshapeSpec &lineshape, const ArrayOfString &cont_description_names, const ArrayOfString &cont_description_models, const ArrayOfVector &cont_description_parameters)
Calculates the absorption coefficients by first calculating the cross sections per tag group and then...