Go to the documentation of this file.
125 const Numeric& cloudbox_margin,
136 os <<
"cloudboxSetAutomatically not yet available for 2D and 3D cases.";
137 throw runtime_error(os.str());
145 bool cb_preset = (
min(cloudbox_limits_old) > -1);
149 os <<
"The array *cloudbox_limits_old* has incorrect length.\n"
152 << cloudbox_limits_old.
nelem() <<
".";
153 throw runtime_error(os.str());
158 Index p1 = 0, p2 = 0;
159 if (cloudbox_margin != -1) {
161 p1 = cloudbox_limits_old[0] + 1;
166 p2 = cloudbox_limits_old[1] - 1;
183 bool any_not_empty =
false;
185 if (!particle_field.
empty()) {
186 bool one_not_empty =
false;
190 for (
Index l = 0; l < nss; l++) {
204 any_not_empty =
true;
214 if (any_not_empty || cb_preset) {
224 while ((
p_grid[p1] < p_margin1) && (p1 > 0)) p1--;
229 p2 =
min(p2 + 1, np - 1);
234 out2 <<
"The cloud reaches to TOA!\n"
235 <<
"Check your *particle_field* data, if realistic!\n";
278 out0 <<
"Cloudbox is switched off!\n";
304 if (i == last_lat - 1) {
306 os <<
"Can not define lower latitude edge of cloudbox:\n"
307 <<
"Extend of atmosphere too small. Distance to minimum latitude\n"
308 <<
"has to be at least " <<
LAT_LON_MIN <<
"deg, but only "
310 throw runtime_error(os.str());
316 Index j = last_lat - 1;
320 os <<
"Can not define upper latitude edge of cloudbox:\n"
321 <<
"Extend of atmosphere too small. Distance to maximum latitude\n"
322 <<
"has to be at least " <<
LAT_LON_MIN <<
"deg, but only "
324 throw runtime_error(os.str());
337 while ((i < last_lon - 1) &&
340 if (i == last_lon - 1) {
342 os <<
"Can not define lower longitude edge of cloudbox:\n"
343 <<
"Extend of atmosphere too small. Distance to minimum longitude\n"
344 <<
"has to be at least " <<
LAT_LON_MIN / lfac <<
"deg, but only "
346 throw runtime_error(os.str());
352 Index j = last_lon - 1;
357 os <<
"Can not define upper longitude edge of cloudbox:\n"
358 <<
"Extend of atmosphere too small. Distance to maximum longitude\n"
359 <<
"has to be at least " <<
LAT_LON_MIN / lfac <<
"deg, but only "
361 throw runtime_error(os.str());
391 "The pressure in *p1* must be bigger than the "
392 "pressure in *p2*.");
395 "The pressure in *p1* must be larger than the "
396 "last value in *p_grid*.");
399 "The pressure in *p2* must be smaller than the "
400 "first value in *p_grid*.");
404 "The latitude in *lat2* must be bigger than the "
405 "latitude in *lat1*.");
408 "The latitude in *lat1* must be >= the "
409 "second value in *lat_grid*.");
412 "The latitude in *lat2* must be <= the "
413 "next to last value in *lat_grid*.");
418 "The longitude in *lon2* must be bigger than the "
419 "longitude in *lon1*.");
422 "The longitude in *lon1* must be >= the "
423 "second value in *lon_grid*.");
426 "The longitude in *lon2* must be <= the "
427 "next to last value in *lon_grid*.");
499 "The altitude in *z1* must be smaller than the "
500 "altitude in *z2*.");
512 "The latitude in *lat2* must be bigger than the "
513 " latitude in *lat1*.");
516 "The latitude in *lat1* must be >= the "
517 "second value in *lat_grid*.");
520 "The latitude in *lat2* must be <= the "
521 "next to last value in *lat_grid*.");
524 "The longitude in *lon2* must be bigger than the "
525 "longitude in *lon1*.");
528 "The longitude in *lon1* must be >= the "
529 "second value in *lon_grid*.");
532 "The longitude in *lon2* must be <= the "
533 "next to last value in *lon_grid*.");
601 const Index& za_interp_order,
602 const Index& za_restrict,
603 const Index& cos_za_interp,
605 const Index& aa_interp_order,
609 throw runtime_error(
"The atmospheric dimensionality must be 1 or 3.");
612 "This method does not support jacobians (jacobian_do must be 0)");
615 "The cloud box is not activated and no outgoing "
616 "field can be returned.");
619 "*cloudbox_limits* is a vector which contains the upper and lower\n"
620 "limit of the cloud for all atmospheric dimensions.\n"
621 "So its length must be 2 x *atmosphere_dim*");
624 "The variable *za_grid* is empty. Are dummy "
625 "values from *cloudboxOff used?");
626 if (!(za_interp_order <
za_grid.nelem()))
628 "Zenith angle interpolation order *za_interp_order*"
630 "than number of angles in *za_grid*.");
633 "Azimuth angle interpolation order *aa_interp_order*"
635 "than number of angles in *aa_grid*.");
638 "Inconsistency in size between f_grid and cloudbox_field! "
639 "(This method does not yet handle dispersion type calculations.)");
651 z_with_surface(ip, ilat, ilon) =
z_surface(ilat, ilon);
730 "Given position has been found to be outside the cloudbox.");
759 "Radiation extraction for a position inside cloudbox\n"
760 "is not yet implemented for 3D cases.\n");
773 for (
Index iv = 0; iv < nf; iv++)
774 for (
Index i_za = 0; i_za < nza; i_za++)
775 i_field_local(iv, i_za, 0, is) =
interp(
819 for (
Index iv = 0; iv < nf; iv++)
820 for (
Index i_za = 0; i_za < nza; i_za++)
821 for (
Index i_aa = 0; i_aa < naa; i_aa++)
822 i_field_local(iv, i_za, i_aa, is) =
825 iv, border_index,
joker,
joker, i_za, i_aa, is),
831 else if (border <= 3) {
846 for (
Index iv = 0; iv < nf; iv++)
847 for (
Index i_za = 0; i_za < nza; i_za++)
848 for (
Index i_aa = 0; i_aa < naa; i_aa++)
849 i_field_local(iv, i_za, i_aa, is) =
852 iv,
joker, border_index,
joker, i_za, i_aa, is),
873 for (
Index iv = 0; iv < nf; iv++)
874 for (
Index i_za = 0; i_za < nza; i_za++)
875 for (
Index i_aa = 0; i_aa < naa; i_aa++)
876 i_field_local(iv, i_za, i_aa, is) =
879 iv,
joker,
joker, border_index, i_za, i_aa, is),
901 "Hemisphere-restricted zenith angle interpolation not allowed\n"
902 "for 90degree views.");
910 if (za_start ==
za_grid.nelem())
912 "No za_grid grid point found in 90-180deg hemisphere.\n"
913 "No hemispheric interpolation possible.");
914 za_extend -= za_start;
919 while (za_extend > 0 &&
za_grid[za_extend - 1] > 90.) {
924 "No za_grid grid point found in 0-90deg hemisphere.\n"
925 "No hemispheric interpolation possible.");
927 if (!(za_interp_order < za_extend)) {
929 os <<
"Zenith angle interpolation order *za_interp_order* ("
930 << za_interp_order <<
") must be smaller\n"
931 <<
"than number of angles in respective hemisphere (" << za_extend
933 throw runtime_error(os.str());
941 Vector cosza_grid(za_extend);
944 for (
Index i_za = 0; i_za < za_extend; i_za++)
949 cosza_grid[0] + za_extpolfac * (cosza_grid[0] - cosza_grid[1]);
950 if (cosza > cosza_min) {
952 os <<
"Zenith angle " <<
rte_los[0] <<
"deg is outside the range"
953 <<
" covered by za_grid.\n"
954 <<
"Lower limit of allowed range is " << acos(cosza_min) *
RAD2DEG
956 <<
"Increase za_extpolfac (now=" << za_extpolfac <<
") or"
957 <<
" use wider za_grid.\n";
958 throw runtime_error(os.str());
961 cosza_grid[za_extend - 1] -
962 za_extpolfac * (cosza_grid[za_extend - 2] - cosza_grid[za_extend - 1]);
963 if (cosza < cosza_max) {
965 os <<
"Zenith angle " <<
rte_los[0] <<
"deg is outside the range"
966 <<
" covered by za_grid.\n"
967 <<
"Upper limit of allowed range is " << acos(cosza_max) *
RAD2DEG
969 <<
"Increase za_extpolfac (now=" << za_extpolfac <<
") or"
970 <<
" use wider za_grid.\n";
971 throw runtime_error(os.str());
974 gridpos_poly(gp_za, cosza_grid, cosza, za_interp_order, za_extpolfac);
979 const Numeric za_min = za_g[0] - za_extpolfac * (za_g[1] - za_g[0]);
982 os <<
"Zenith angle " <<
rte_los[0] <<
"deg is outside the range"
983 <<
" covered by za_grid.\n"
984 <<
"Lower limit of allowed range is " << za_min <<
".\n"
985 <<
"Increase za_extpolfac (now=" << za_extpolfac <<
") or"
986 <<
" use wider za_grid.\n";
987 throw runtime_error(os.str());
990 za_g[za_g.
nelem() - 1] +
991 za_extpolfac * (za_g[za_extend - 1] - za_g[za_extend - 2]);
994 os <<
"Zenith angle " << za <<
"deg is outside the range"
995 <<
" covered by za_grid.\n"
996 <<
"Upper limit of allowed range is " << za_max <<
".\n"
997 <<
"Increase za_extpolfac (now=" << za_extpolfac <<
") or"
998 <<
" use wider za_grid.\n";
999 throw runtime_error(os.str());
1001 gridpos_poly(gp_za, za_g, za, za_interp_order, za_extpolfac);
1008 gp_aa.
idx.resize(1);
1019 for (
Index iv = 0; iv < nf; iv++) {
1022 i_field_local(iv,
Range(za_start, za_extend),
joker, is),
1034 const Index& new_limit0,
1035 const Index& new_limit1,
1036 const Index& new_limit2,
1037 const Index& new_limit3,
1038 const Index& new_limit4,
1039 const Index& new_limit5,
1042 throw runtime_error(
"No need to use this method with cloudbox=0.");
1044 throw runtime_error(
"new_limits0 < cloudbox_limits[0], not allowed!");
1046 throw runtime_error(
"new_limits1 > cloudbox_limits[1], not allowed!");
1063 throw runtime_error(
"new_limits2 < cloudbox_limits[2], not allowed!");
1065 throw runtime_error(
"new_limits3 > cloudbox_limits[3], not allowed!");
1082 throw runtime_error(
"new_limits4 < cloudbox_limits[4], not allowed!");
1084 throw runtime_error(
"new_limits5 > cloudbox_limits[5], not allowed!");
1107 const Tensor4& particle_field_in,
1110 if (&particle_field_out != &particle_field_in) {
1111 particle_field_out = particle_field_in;
1116 for (
Index i = 0; i < particle_field_out.
nbooks(); i++) {
1117 for (
Index j = 0; j < particle_field_out.
npages(); j++) {
1118 for (
Index k = 0; k < particle_field_out.
nrows(); k++) {
1119 for (
Index l = 0; l < particle_field_out.
ncols(); l++) {
1120 if (particle_field_out(i, j, k, l) < threshold) {
1121 particle_field_out(i, j, k, l) = 0.0;
1164 if (scat_data_files.
nelem() != pnd_field_files.
nelem()) {
1166 os <<
"Number of elements in scat_data and pnd_field filelists is"
1168 throw runtime_error(os.str());
1172 if (last_species == -1) {
1181 for (
Index i = 0; i < scat_data_files.
nelem(); i++) {
1186 out2 <<
" Read single scattering data file " << scat_data_files[i] <<
"\n";
1192 out2 <<
" Read particle number density field\n";
1193 if (pnd_field_files[i].
nelem() < 1) {
1195 out1 <<
"Warning: No pnd_field_file specified. Ignored here,\n"
1196 <<
"but user HAS TO add that later on!. \n";
1218 const String& pnd_fieldarray_file,
1230 arr_ssd.resize(scat_data_files.
nelem());
1232 for (
Index i = 0; i < scat_data_files.
nelem(); i++) {
1233 out2 <<
" Read single scattering data file " << scat_data_files[i] <<
"\n";
1244 out2 <<
" Read particle number density data \n";
1278 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
1283 if (scat_data_files.
nelem() != pnd_field_files.
nelem()) {
1285 os <<
"Number of elements in scat_data and pnd_field filelists is"
1287 throw runtime_error(os.str());
1291 if (last_species == -1) {
1300 species[0] =
"particles";
1302 for (
Index i = 0; i < scat_data_files.
nelem(); i++) {
1307 out2 <<
" Read single scattering data file " << scat_data_files[i] <<
"\n";
1313 out2 <<
" Check single scattering properties\n";
1315 "scat_data_single.f_grid to f_grid",
1320 out2 <<
" Read particle number density field\n";
1321 if (pnd_field_files[i].
nelem() < 1) {
1323 out1 <<
"Warning: No pnd_field_file specified. Ignored here,\n"
1324 <<
"but user HAS TO add that later on!\n";
1334 if (tmp.
nelem() == 1) {
1337 std::ostringstream os;
1338 os <<
"The file " << pnd_field_files[i] <<
"\n"
1339 <<
"is neither GriddedField3 nor a 1-long ArrayOfGriddedField3.\n";
1340 throw std::runtime_error(os.str());
1343 std::ostringstream os;
1344 os <<
"The file " << pnd_field_files[i] <<
" does not exist or\n"
1345 <<
"its type is neither GriddedField3 nor a 1-long ArrayOfGriddedField3.\n";
1346 throw std::runtime_error(os.str());
1356 out2 <<
" Append 'particle' field to abs_species\n";
1380 arr_ssd.resize(scat_data_files.
nelem());
1381 arr_smd.resize(scat_data_files.
nelem());
1383 Index meta_naming_conv = 0;
1385 for (
Index i = 0; i < 1 && i < scat_data_files.
nelem(); i++) {
1386 out3 <<
" Read single scattering data file " << scat_data_files[i] <<
"\n";
1394 scat_data_files[i].
split(strarr,
".xml");
1395 scat_meta_file = strarr[0] +
".meta.xml";
1399 }
catch (
const runtime_error&) {
1403 out3 <<
" Read scattering meta data\n";
1407 meta_naming_conv = 1;
1410 scat_data_files[i].split(strarr,
"scat_data");
1411 if (strarr.
nelem() < 2) {
1412 throw std::runtime_error(
1413 "Splitting scattering data filename up at 'scat_data' also failed.");
1415 scat_meta_file = strarr[0] +
"scat_meta" + strarr[1];
1417 out3 <<
" Read scattering meta data\n";
1420 meta_naming_conv = 2;
1421 }
catch (
const std::runtime_error& e) {
1423 os <<
"No meta data file following one of the allowed naming "
1424 <<
"conventions was found.\n"
1426 <<
"*.meta.xml from *.xml and "
1427 <<
"*scat_meta* from *scat_data*\n"
1428 <<
"Scattering meta data file not found: " << scat_meta_file
1431 throw runtime_error(os.str());
1439 #pragma omp parallel for if (!arts_omp_in_parallel() && \
1440 scat_data_files.nelem() > 1) \
1441 num_threads(arts_omp_get_max_threads() > 16 ? 16 \
1442 : arts_omp_get_max_threads()) \
1443 shared(out3, scat_data_files, arr_ssd, arr_smd)
1444 for (
Index i = 1; i < scat_data_files.
nelem(); i++) {
1452 out3 <<
" Read single scattering data file " << scat_data_files[i]
1456 scat_data_files[i].split(strarr,
".xml");
1457 scat_meta_file = strarr[0] +
".meta.xml";
1459 if (meta_naming_conv == 1) {
1460 scat_data_files[i].split(strarr,
".xml");
1461 scat_meta_file = strarr[0] +
".meta.xml";
1463 out3 <<
" Read scattering meta data\n";
1466 scat_data_files[i].split(strarr,
"scat_data");
1467 scat_meta_file = strarr[0] +
"scat_meta" + strarr[1];
1469 out3 <<
" Read scattering meta data\n";
1472 }
catch (
const std::exception& e) {
1474 os <<
"Run-time error reading scattering data : \n" << e.what();
1475 #pragma omp critical(ybatchCalc_push_fail_msg)
1476 fail_msg.push_back(os.str());
1482 #pragma omp critical(ScatSpeciesScatAndMetaRead_assign_ssd)
1483 arr_ssd[i] = std::move(ssd);
1484 #pragma omp critical(ScatSpeciesScatAndMetaRead_assign_smd)
1485 arr_smd[i] = std::move(smd);
1488 if (fail_msg.
nelem()) {
1490 for (
auto& msg : fail_msg) os << msg <<
'\n';
1492 throw runtime_error(os.str());
1500 scat_meta.push_back(std::move(arr_smd));
1520 os <<
"Number of scattering species specified by scat_species does\n"
1521 <<
"not agree with number of scattering species in\n"
1522 <<
"scat_data_raw or scat_meta:\n"
1523 <<
"scat_species has " << nspecies
1524 <<
" entries, while scat_data_raw has " <<
scat_data_raw.nelem()
1525 <<
" and scat_meta has " <<
scat_meta.nelem() <<
".";
1526 throw runtime_error(os.str());
1539 if (partfield_name == species) i_ss = i;
1543 os <<
"Scattering species " << species <<
" not found among scat_species.";
1544 throw runtime_error(os.str());
1548 if (sizeparam ==
"diameter_max")
1554 if (
scat_meta[i_ss][i_se].diameter_max > sizemin - sizemin * tolerance &&
1555 (sizemax + sizemax * tolerance >
scat_meta[i_ss][i_se].diameter_max ||
1559 scat_meta_tmp.push_back(
scat_meta[i_ss][i_se]);
1562 else if (sizeparam ==
"diameter_volume_equ")
1564 if (
scat_meta[i_ss][i_se].diameter_volume_equ >
1565 sizemin - sizemin * tolerance &&
1566 (sizemax + sizemax * tolerance >
1567 scat_meta[i_ss][i_se].diameter_volume_equ ||
1571 scat_meta_tmp.push_back(
scat_meta[i_ss][i_se]);
1574 else if (sizeparam ==
"diameter_area_equ_aerodynamical")
1576 if (
scat_meta[i_ss][i_se].diameter_area_equ_aerodynamical >
1577 sizemin - sizemin * tolerance &&
1578 (sizemax + sizemax * tolerance >
1579 scat_meta[i_ss][i_se].diameter_area_equ_aerodynamical ||
1583 scat_meta_tmp.push_back(
scat_meta[i_ss][i_se]);
1588 os <<
"Size parameter " << sizeparam <<
"is unknown.";
1589 throw runtime_error(os.str());
1595 if (scat_meta_tmp.
nelem() < 1) {
1597 os <<
"For scattering species " << species <<
" no scattering "
1598 <<
"element matching the requested size range found.\n"
1599 <<
"Check *scat_data_raw* and *scat_meta* input as well as your size limit "
1601 throw runtime_error(os.str());
1604 scat_meta[i_ss] = std::move(scat_meta_tmp);
1619 const String& scat_species_delim,
1623 const bool do_tl = (T_low >= 0.);
1624 const bool do_th = (T_high >= 0.);
1626 if (do_tl || do_th) {
1628 if (species ==
"") {
1632 os <<
"No *scat_data* available. Can not extend temperature range on "
1633 <<
"inexistent data.";
1634 throw runtime_error(os.str());
1641 os <<
"Number of scattering species specified by scat_species does\n"
1642 <<
"not agree with number of scattering species in *scat_data*:\n"
1643 <<
"scat_species has " << nspecies
1644 <<
" entries, while *scat_data* has " <<
scat_data_raw.nelem()
1646 throw runtime_error(os.str());
1654 if (partfield_name == species) i_ss = i;
1658 os <<
"Scattering species " << species
1659 <<
" not found among scat_species.";
1660 throw runtime_error(os.str());
1668 bool do_htl, do_hth;
1670 do_htl = (do_tl && (T_low < ssdo.
T_grid[0]));
1671 do_hth = (do_th && (T_high >
last(ssdo.
T_grid)));
1677 if (do_htl || do_hth) {
1683 if (do_htl) nTn += 1;
1684 if (do_hth) nTn += 1;
1687 T_grid_new[0] = T_low;
1692 for (
Index iT = 0; iT < nTo; iT++)
1693 T_grid_new[iT + iToff] =
scat_data_raw[i_ss][i_se].T_grid[iT];
1694 if (do_hth) T_grid_new[nTo + iToff] = T_high;
1695 ssdn.
T_grid = std::move(T_grid_new);
1699 ostringstream description;
1722 for (
Index iT = 0; iT < nTo; iT++) {
1741 <<
"Low temperature limit extended by"
1742 <<
" duplicating previous low temperature limit"
1743 <<
" single scattering properties.";
1754 <<
"High temperature limit extended by"
1755 <<
" duplicating previous high temperature limit"
1756 <<
" single scattering properties.";
1777 const Index& zeropadding,
1785 os <<
"No particle number density data given. Please use WSMs\n"
1786 <<
"*ParticleTypeInit* and *ParticleTypeAdd(All)* for reading\n"
1787 <<
"scattering element data.\n";
1788 throw runtime_error(os.str());
1820 throw runtime_error(
1821 "*cloudbox_limits* is a vector which contains the"
1822 "upper and lower limit of the cloud for all "
1823 "atmospheric dimensions. So its dimension must"
1824 "be 2 x *atmosphere_dim*");
1835 os <<
"Error in pnd_field_raw data. ";
1836 os <<
"Dimension " << d <<
" (name: \"";
1838 os <<
"\") has only ";
1841 os << ((
pnd_field_raw[i].get_grid_size(d) == 1) ?
"" :
"s");
1842 os <<
". Must be at least 2.";
1843 throw runtime_error(os.str());
1847 const Index Np_cloud = cloudbox_limits_tmp[1] - cloudbox_limits_tmp[0] + 1;
1858 cloudbox_limits_tmp);
1869 pnd_field_tmp[0].get_numeric_grid(1),
1870 pnd_field_tmp[0].get_numeric_grid(2),
1874 const Index Nlat_cloud =
1875 cloudbox_limits_tmp[3] - cloudbox_limits_tmp[2] + 1;
1883 out0 <<
"WARNING: zeropadding currently only supported for 1D.";
1905 Tensor3 itw(Np_cloud, Nlat_cloud, 4);
1916 const Index Nlat_cloud =
1917 cloudbox_limits_tmp[3] - cloudbox_limits_tmp[2] + 1;
1918 const Index Nlon_cloud =
1919 cloudbox_limits_tmp[5] - cloudbox_limits_tmp[4] + 1;
1924 out0 <<
"WARNING: zeropadding currently only supported for 1D.";
1955 Tensor4 itw(Np_cloud, Nlat_cloud, Nlon_cloud, 8);
1985 throw runtime_error(
"No use in calling this method for 1D.");
1988 throw runtime_error(
"No use in calling this method with cloudbox off.");
1992 throw runtime_error(
"The argument *nzero* must be > 0.");
2006 throw runtime_error(
2007 "The input *pnd_field* is either not 1D or does not "
2008 "match pressure size of cloudbox.");
2015 pnd_field.resize(npart, np, nlat, nlon);
2018 for (
Index ilon = nzero; ilon < nlon - nzero; ilon++) {
2019 for (
Index ilat = nzero; ilat < nlat - nzero; ilat++) {
2020 for (
Index ip = 0; ip < np; ip++) {
2021 for (
Index is = 0; is < npart; is++) {
2022 pnd_field(is, ip, ilat, ilon) = pnd_temp(is, ip, 0, 0);
2043 throw runtime_error(
2044 "*cloudbox_limits* is a vector which contains the"
2045 "upper and lower limit of the cloud for all "
2046 "atmospheric dimensions. So its dimension must"
2047 "be 2 x *atmosphere_dim*");
2051 Index nlat = 1, nlon = 1;
2089 scat_data[0][0].pha_mat_data.resize(nf, nT, nza, 1, 1, 1, 6);
2091 scat_data[0][0].ext_mat_data.resize(nf, nT, 1, 1, 1);
2093 scat_data[0][0].abs_vec_data.resize(nf, nT, 1, 1, 1);
Index atmosphere_dim(Workspace &ws) noexcept
SingleScatteringData scat_data_single(Workspace &ws) noexcept
Implementation of gridded fields.
bool is_same_within_epsilon(const Numeric &a, const Numeric &b, const Numeric &epsilon)
Check, if two numbers agree within a given epsilon.
Tensor3 z_field(Workspace &ws) noexcept
Index nshelves() const
Returns the number of shelves.
void particle_fieldCleanup(Tensor4 &particle_field_out, const Tensor4 &particle_field_in, const Numeric &threshold, const Verbosity &)
WORKSPACE METHOD: particle_fieldCleanup.
void ScatSpeciesScatAndMetaRead(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, const ArrayOfString &scat_data_files, const Verbosity &verbosity)
WORKSPACE METHOD: ScatSpeciesScatAndMetaRead.
ArrayOfArrayOfScatteringMetaData scat_meta(Workspace &ws) noexcept
Agenda iy_cloudbox_agenda(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
void abs_speciesAdd(ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesAdd.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
Index ncols() const
Returns the number of columns.
void cloudboxSetManually(Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Numeric &p1, const Numeric &p2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &)
WORKSPACE METHOD: cloudboxSetManually.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
Calculates grid positions for pressure values.
Index ncols() const
Returns the number of columns.
Vector lat_grid(Workspace &ws) noexcept
Header file for interpolation.cc.
const Index GFIELD3_LAT_GRID
ArrayOfGriddedField3 pnd_field_raw(Workspace &ws) noexcept
Tensor4 pnd_field(Workspace &ws) noexcept
Index ppath_inside_cloudbox_do(Workspace &ws) noexcept
Numeric last(ConstVectorView x)
last
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Verbosity verbosity(Workspace &ws) noexcept
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
Index jacobian_do(Workspace &ws) noexcept
void cloudbox_fieldCrop(Tensor7 &cloudbox_field, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &cloudbox_on, const Index &new_limit0, const Index &new_limit1, const Index &new_limit2, const Index &new_limit3, const Index &new_limit4, const Index &new_limit5, const Verbosity &)
WORKSPACE METHOD: cloudbox_fieldCrop.
void resize(Index n)
Resize function.
void ScatElementsPndAndScatAdd(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfString &scat_data_files, const ArrayOfString &pnd_field_files, const Verbosity &verbosity)
WORKSPACE METHOD: ScatElementsPndAndScatAdd.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Numeric fractional_gp(const GridPos &gp)
fractional_gp
Index stokes_dim(Workspace &ws) noexcept
void cloudboxOff(Index &cloudbox_on, Index &ppath_inside_cloudbox_do, ArrayOfIndex &cloudbox_limits, Agenda &iy_cloudbox_agenda, Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, ArrayOfString &scat_species, ArrayOfArrayOfSingleScatteringData &scat_data, ArrayOfArrayOfSingleScatteringData &scat_data_raw, Index &scat_data_checked, Matrix &particle_masses, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
WORKSPACE METHOD: cloudboxOff.
void chk_pnd_field_raw_only_in_cloudbox(const Index &dim, const ArrayOfGriddedField3 &pnd_field_raw, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, const ArrayOfIndex &cloudbox_limits)
chk_pnd_field_raw_only_in_cloudbox
Matrix iy(Workspace &ws) noexcept
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
This file contains the definition of Array.
bool is_size(ConstVectorView x, const Index &n)
Verifies that the size of x is l.
bool is_gridpos_at_index_i(const GridPos &gp, const Index &i, const bool &strict)
is_gridpos_at_index_i
const Index GFIELD3_LON_GRID
void chk_pnd_raw_data(const ArrayOfGriddedField3 &pnd_field_raw, const String &pnd_field_file, const Index &atmosphere_dim, const Verbosity &verbosity)
Check particle number density files (pnd_field_raw)
Internal functions for microphysics calculations (size distributions etc.)
This can be used to make arrays out of anything.
Index nelem(const Lines &l)
Number of lines.
void parse_partfield_name(String &partfield_name, const String &part_string, const String &delim)
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
void gridpos_poly_cyclic_longitudinal(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
Set up grid positions for higher order interpolation.
Declarations having to do with the four output streams.
Vector rte_pos(Workspace &ws) noexcept
void pnd_fieldExpand1D(Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &nzero, const Verbosity &)
WORKSPACE METHOD: pnd_fieldExpand1D.
Matrix particle_masses(Workspace &ws) noexcept
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Structure to store a grid position for higher order interpolation.
void ScatSpeciesExtendTemperature(ArrayOfArrayOfSingleScatteringData &scat_data_raw, const ArrayOfString &scat_species, const String &species, const String &scat_species_delim, const Numeric &T_low, const Numeric &T_high, const Verbosity &)
WORKSPACE METHOD: ScatSpeciesExtendTemperature.
bool empty() const
Check if variable is empty.
Index nelem() const
Returns the number of elements.
void ScatElementsToabs_speciesAdd(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &vmr_field_raw, ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfString &scat_data_files, const ArrayOfString &pnd_field_files, const Verbosity &verbosity)
WORKSPACE METHOD: ScatElementsToabs_speciesAdd.
Vector rte_los(Workspace &ws) noexcept
This file contains declerations of functions of physical character.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Vector p_grid(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
Scattering database structure and functions.
Index npages() const
Returns the number of pages.
void find_xml_file(String &filename, const Verbosity &verbosity)
Find an xml file.
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
void chk_scattering_meta_data(const ScatteringMetaData &scat_meta_single, const String &scat_meta_file, const Verbosity &verbosity)
Check scattering data meta.
void find_cloudlimits(Index &lower, Index &upper, const Tensor3 &scat_species_field, const Index &atmosphere_dim, const Numeric &cloudbox_margin)
Adjust uppermost and lowermost cloudy level for one scat_species_*_*_field.
Vector f_grid(Workspace &ws) noexcept
bool file_exists(const String &filename)
Checks if the given file exists.
ArrayOfArrayOfSingleScatteringData scat_data(Workspace &ws) noexcept
This file contains header information for the dealing with command line parameters.
void ScatSpeciesPndAndScatAdd(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfString &scat_data_files, const String &pnd_fieldarray_file, const Verbosity &verbosity)
WORKSPACE METHOD: ScatSpeciesPndAndScatAdd.
Vector za_grid(Workspace &ws) noexcept
Vector lon_grid(Workspace &ws) noexcept
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
ArrayOfTensor4 dpnd_field_dx(Workspace &ws) noexcept
Internal cloudbox functions.
void chk_pnd_data(const GriddedField3 &pnd_field_raw, const String &pnd_field_file, const Index &atmosphere_dim, const Verbosity &verbosity)
Check particle number density files.
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
Index nrows() const
Returns the number of rows.
void pnd_fieldCalcFrompnd_field_raw(Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const ArrayOfRetrievalQuantity &jacobian_quantities, const Index &zeropadding, const Verbosity &verbosity)
WORKSPACE METHOD: pnd_fieldCalcFrompnd_field_raw.
const Numeric DENSITY_OF_ICE
Index scat_data_checked(Workspace &ws) noexcept
Structure to store a grid position.
Index nbooks() const
Returns the number of books.
Index propmat_clearsky_agenda_checked(Workspace &ws) noexcept
Header file for logic.cc.
void iyInterpCloudboxField(Matrix &iy, const Tensor7 &cloudbox_field, const Vector &rte_pos, const Vector &rte_los, const Index &jacobian_do, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &z_surface, const Index &stokes_dim, const Vector &za_grid, const Vector &aa_grid, const Vector &f_grid, const Index &za_interp_order, const Index &za_restrict, const Index &cos_za_interp, const Numeric &za_extpolfac, const Index &aa_interp_order, const Verbosity &)
WORKSPACE METHOD: iyInterpCloudboxField.
void chk_scattering_data(const ArrayOfSingleScatteringData &scat_data, const ArrayOfScatteringMetaData &scat_meta, const Verbosity &)
Check scattering data general.
void ScatElementsSelect(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, const ArrayOfString &scat_species, const String &species, const String &sizeparam, const Numeric &sizemin, const Numeric &sizemax, const Numeric &tolerance, const String &delim, const Verbosity &)
WORKSPACE METHOD: ScatElementsSelect.
void cloudboxSetManuallyAltitude(Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Tensor3 &z_field, const Vector &lat_grid, const Vector &lon_grid, const Numeric &z1, const Numeric &z2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &)
WORKSPACE METHOD: cloudboxSetManuallyAltitude.
void pnd_fieldZero(Tensor4 &pnd_field, ArrayOfTensor4 &dpnd_field_dx, ArrayOfArrayOfSingleScatteringData &scat_data, const Index &atmosphere_dim, const Vector &f_grid, const ArrayOfIndex &cloudbox_limits, const ArrayOfRetrievalQuantity &jacobian_quantities, const Verbosity &)
WORKSPACE METHOD: pnd_fieldZero.
void GriddedFieldPRegrid(GriddedField3 &gfraw_out, const Vector &p_grid, const GriddedField3 &gfraw_in_orig, const Index &interp_order, const Index &zeropadding, const Verbosity &verbosity)
WORKSPACE METHOD: GriddedFieldPRegrid.
Declaration of functions in rte.cc.
const Index GFIELD3_P_GRID
Index abs_xsec_agenda_checked(Workspace &ws) noexcept
Header file for special_interp.cc.
void scat_dataCheck(const ArrayOfArrayOfSingleScatteringData &scat_data, const String &check_type, const Numeric &threshold, const Verbosity &verbosity)
WORKSPACE METHOD: scat_dataCheck.
const Numeric LAT_LON_MIN
Tensor7 cloudbox_field(Workspace &ws) noexcept
ArrayOfArrayOfSingleScatteringData scat_data_raw(Workspace &ws) noexcept
void cloudboxSetAutomatically(Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor4 &particle_field, const ArrayOfIndex &cloudbox_limits_old, const Numeric &cloudbox_margin, const Verbosity &verbosity)
WORKSPACE METHOD: cloudboxSetAutomatically.
void chk_scat_species_field(bool &empty_flag, const Tensor3 &scat_species_field, const String &fieldname, const Index &dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Check whether field of a specific scattering species zero everywhere.
This file contains basic functions to handle ASCII files.
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
Converts a geographical position (rte_pos) to grid positions for p, lat and lon.
void cloudboxSetFullAtm(Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Verbosity &)
WORKSPACE METHOD: cloudboxSetFullAtm.
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
ArrayOfGriddedField3 vmr_field_raw(Workspace &ws) noexcept
ArrayOfString scat_species(Workspace &ws) noexcept
void gridpos_poly(ArrayOfGridPosPoly &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Index order, const Numeric &extpolfac)
The maximum difference from 1 that we allow for a sum check.
Vector aa_grid(Workspace &ws) noexcept
A constant view of a Vector.
Contains sorting routines.
Index nelem() const
Number of elements.
Numeric barometric_heightformula(const Numeric &p, const Numeric &dh)
barometric_heightformula
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Matrix z_surface(Workspace &ws) noexcept
void ScatSpeciesInit(ArrayOfString &scat_species, ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, Index &scat_data_checked, ArrayOfGriddedField3 &pnd_field_raw, const Verbosity &)
WORKSPACE METHOD: ScatSpeciesInit.
The global header file for ARTS.
void FieldFromGriddedField(Matrix &field_out, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const GriddedField2 &gfraw_in, const Verbosity &)
WORKSPACE METHOD: FieldFromGriddedField.
Index cloudbox_on(Workspace &ws) noexcept
This file contains basic functions to handle XML data files.