82 Index& ppath_inside_cloudbox_do,
84 Agenda& iy_cloudbox_agenda,
90 Index& scat_data_checked,
95 ppath_inside_cloudbox_do = 0;
96 cloudbox_limits.resize(0);
97 iy_cloudbox_agenda =
Agenda();
98 iy_cloudbox_agenda.
set_name(
"iy_cloudbox_agenda");
99 pnd_field.
resize(0, 0, 0, 0);
101 dpnd_field_dx.resize(jacobian_quantities.
nelem());
103 scat_species.resize(0);
106 scat_data_raw.resize(0);
107 scat_data_checked = 0;
108 particle_masses.
resize(0, 0);
118 const Index& atmosphere_dim,
125 const Numeric& cloudbox_margin,
134 if (atmosphere_dim > 1) {
136 os <<
"cloudboxSetAutomatically not yet available for 2D and 3D cases.";
137 throw runtime_error(os.
str());
143 cloudbox_limits.resize(atmosphere_dim * 2);
145 bool cb_preset = (
min(cloudbox_limits_old) > -1);
147 if (cloudbox_limits_old.
nelem() != atmosphere_dim * 2) {
149 os <<
"The array *cloudbox_limits_old* has incorrect length.\n" 150 <<
"For atmospheric dim. = " << atmosphere_dim
151 <<
" the length shall be " << atmosphere_dim * 2 <<
" but it is " 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--;
225 cloudbox_limits[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";
237 cloudbox_limits[1] = p2;
242 assert(p_grid[p1] > p_grid[p2]);
244 assert(p_grid[p1] > p_grid[p_grid.
nelem() - 1]);
246 assert(p_grid[p2] < p_grid[0]);
278 out0 <<
"Cloudbox is switched off!\n";
287 const Index& atmosphere_dim,
293 cloudbox_limits.resize(2 * atmosphere_dim);
295 cloudbox_limits[0] = 0;
296 cloudbox_limits[1] = p_grid.
nelem() - 1;
298 if (atmosphere_dim > 1) {
303 while ((i < last_lat - 1) && (lat_grid[i] - lat_grid[0] <
LAT_LON_MIN)) i++;
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 " 309 << lat_grid[i - 1] - lat_grid[0] <<
" available here.";
310 throw runtime_error(os.
str());
312 cloudbox_limits[2] = i;
316 Index j = last_lat - 1;
317 while ((j > i) && (lat_grid[last_lat] - lat_grid[j] <
LAT_LON_MIN)) j--;
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 " 323 << lat_grid[last_lat] - lat_grid[j + 1] <<
" available here.";
324 throw runtime_error(os.
str());
326 cloudbox_limits[3] = j;
329 if (atmosphere_dim > 2) {
330 const Numeric latmax =
max(
abs(lat_grid[cloudbox_limits[2]]),
331 abs(lat_grid[cloudbox_limits[3]]));
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 " 345 << lon_grid[i - 1] - lon_grid[0] <<
" available here.";
346 throw runtime_error(os.
str());
348 cloudbox_limits[4] = i;
352 Index j = last_lon - 1;
353 while ((j > i) && (lon_grid[last_lon] - lon_grid[j] <
LAT_LON_MIN / lfac))
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 " 360 << lon_grid[last_lon] - lon_grid[j + 1] <<
" available here.";
361 throw runtime_error(os.
str());
363 cloudbox_limits[5] = j;
372 const Index& atmosphere_dim,
391 "The pressure in *p1* must be bigger than the " 392 "pressure in *p2*.");
393 if (p1 <= p_grid[p_grid.
nelem() - 1])
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*.");
401 if (atmosphere_dim >= 2) {
404 "The latitude in *lat2* must be bigger than the " 405 "latitude in *lat1*.");
406 if (lat1 < lat_grid[1])
408 "The latitude in *lat1* must be >= the " 409 "second value in *lat_grid*.");
410 if (lat2 > lat_grid[lat_grid.
nelem() - 2])
412 "The latitude in *lat2* must be <= the " 413 "next to last value in *lat_grid*.");
415 if (atmosphere_dim == 3) {
418 "The longitude in *lon2* must be bigger than the " 419 "longitude in *lon1*.");
420 if (lon1 < lon_grid[1])
422 "The longitude in *lon1* must be >= the " 423 "second value in *lon_grid*.");
424 if (lon2 > lon_grid[lon_grid.
nelem() - 2])
426 "The longitude in *lon2* must be <= the " 427 "next to last value in *lon_grid*.");
434 cloudbox_limits.resize(atmosphere_dim * 2);
437 if (p1 > p_grid[1]) {
438 cloudbox_limits[0] = 0;
440 for (cloudbox_limits[0] = 1; p_grid[cloudbox_limits[0] + 1] >= p1;
441 cloudbox_limits[0]++) {
444 if (p2 < p_grid[p_grid.
nelem() - 2]) {
445 cloudbox_limits[1] = p_grid.
nelem() - 1;
447 for (cloudbox_limits[1] = p_grid.
nelem() - 2;
448 p_grid[cloudbox_limits[1] - 1] <= p2;
449 cloudbox_limits[1]--) {
454 if (atmosphere_dim >= 2) {
455 for (cloudbox_limits[2] = 1; lat_grid[cloudbox_limits[2] + 1] <= lat1;
456 cloudbox_limits[2]++) {
458 for (cloudbox_limits[3] = lat_grid.
nelem() - 2;
459 lat_grid[cloudbox_limits[3] - 1] >= lat2;
460 cloudbox_limits[3]--) {
465 if (atmosphere_dim == 3) {
466 for (cloudbox_limits[4] = 1; lon_grid[cloudbox_limits[4] + 1] <= lon1;
467 cloudbox_limits[4]++) {
469 for (cloudbox_limits[5] = lon_grid.
nelem() - 2;
470 lon_grid[cloudbox_limits[5] - 1] >= lon2;
471 cloudbox_limits[5]--) {
481 const Index& atmosphere_dim,
499 "The altitude in *z1* must be smaller than the " 500 "altitude in *z2*.");
509 if (atmosphere_dim == 3) {
512 "The latitude in *lat2* must be bigger than the " 513 " latitude in *lat1*.");
514 if (lat1 < lat_grid[1])
516 "The latitude in *lat1* must be >= the " 517 "second value in *lat_grid*.");
518 if (lat2 > lat_grid[lat_grid.
nelem() - 2])
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*.");
526 if (lon1 < lon_grid[1])
528 "The longitude in *lon1* must be >= the " 529 "second value in *lon_grid*.");
530 if (lon2 > lon_grid[lon_grid.
nelem() - 2])
532 "The longitude in *lon2* must be <= the " 533 "next to last value in *lon_grid*.");
540 cloudbox_limits.resize(atmosphere_dim * 2);
543 if (z1 < z_field(1, 0, 0)) {
544 cloudbox_limits[0] = 0;
546 for (cloudbox_limits[0] = 1; z_field(cloudbox_limits[0] + 1, 0, 0) <= z1;
547 cloudbox_limits[0]++) {
550 if (z2 > z_field(z_field.
npages() - 2, 0, 0)) {
551 cloudbox_limits[1] = z_field.
npages() - 1;
553 for (cloudbox_limits[1] = z_field.
npages() - 2;
554 z_field(cloudbox_limits[1] - 1, 0, 0) >= z2;
555 cloudbox_limits[1]--) {
560 if (atmosphere_dim >= 2) {
561 for (cloudbox_limits[2] = 1; lat_grid[cloudbox_limits[2] + 1] <= lat1;
562 cloudbox_limits[2]++) {
564 for (cloudbox_limits[3] = lat_grid.
nelem() - 2;
565 lat_grid[cloudbox_limits[3] - 1] >= lat2;
566 cloudbox_limits[3]--) {
571 if (atmosphere_dim == 3) {
572 for (cloudbox_limits[4] = 1; lon_grid[cloudbox_limits[4] + 1] <= lon1;
573 cloudbox_limits[4]++) {
575 for (cloudbox_limits[5] = lon_grid.
nelem() - 2;
576 lon_grid[cloudbox_limits[5] - 1] >= lon2;
577 cloudbox_limits[5]--) {
587 const Index& jacobian_do,
588 const Index& cloudbox_on,
590 const Index& atmosphere_dim,
596 const Index& stokes_dim,
601 const Index& za_interp_order,
602 const Index& za_restrict,
603 const Index& cos_za_interp,
605 const Index& aa_interp_order,
608 if (!(atmosphere_dim == 1 || atmosphere_dim == 3))
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.");
617 if (cloudbox_limits.
nelem() != 2 * atmosphere_dim)
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*");
622 if (za_grid.
nelem() == 0)
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*.");
631 if (atmosphere_dim > 1 && !(aa_interp_order < aa_grid.
nelem()))
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.)");
644 Tensor3 z_with_surface = z_field;
645 for (
Index ilat = 0; ilat < z_surface.
nrows(); ilat++) {
646 for (
Index ilon = 0; ilon < z_surface.
ncols(); ilon++) {
648 while (z_surface(ilat, ilon) >= z_field(ip + 1, ilat, ilon)) {
651 z_with_surface(ip, ilat, ilon) = z_surface(ilat, ilon);
679 }
else if (atmosphere_dim > 1) {
684 }
else if (atmosphere_dim > 2) {
703 if (fgp <
Numeric(cloudbox_limits[0]) ||
704 fgp >
Numeric(cloudbox_limits[1])) {
709 if (atmosphere_dim == 3 && inside) {
711 if (fgp <
Numeric(cloudbox_limits[2]) ||
712 fgp >
Numeric(cloudbox_limits[3])) {
716 if (fgp <
Numeric(cloudbox_limits[4]) ||
717 fgp >
Numeric(cloudbox_limits[5])) {
730 "Given position has been found to be outside the cloudbox.");
735 DEBUG_ONLY(
const Index np = cloudbox_limits[1] - cloudbox_limits[0] + 1);
740 iy.
resize(nf, stokes_dim);
743 Tensor4 i_field_local(nf, nza, naa, stokes_dim);
750 border_index = cloudbox_limits[border] - cloudbox_limits[border - 1];
757 if (atmosphere_dim == 3) {
759 "Radiation extraction for a position inside cloudbox\n" 760 "is not yet implemented for 3D cases.\n");
762 assert(atmosphere_dim == 1);
764 assert(
is_size(cloudbox_field, nf, np, 1, 1, nza, 1, stokes_dim));
767 gp_p.
idx = gp_p.
idx - cloudbox_limits[0];
772 for (
Index is = 0; is < stokes_dim; is++)
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(
776 itw_p, cloudbox_field(iv,
joker, 0, 0, i_za, 0, is), gp_p);
783 else if (atmosphere_dim == 1) {
808 cb_gp_lat.
idx -= cloudbox_limits[2];
809 cb_gp_lon.
idx -= cloudbox_limits[4];
812 cloudbox_limits[3] - cloudbox_limits[2]);
814 cloudbox_limits[5] - cloudbox_limits[4]);
818 for (
Index is = 0; is < stokes_dim; is++)
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) {
836 cb_gp_p.
idx -= cloudbox_limits[0];
837 cb_gp_lon.
idx -= cloudbox_limits[4];
841 cloudbox_limits[5] - cloudbox_limits[4]);
845 for (
Index is = 0; is < stokes_dim; is++)
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),
863 cb_gp_p.
idx -= cloudbox_limits[0];
864 cb_gp_lat.
idx -= cloudbox_limits[2];
868 cloudbox_limits[3] - cloudbox_limits[2]);
872 for (
Index is = 0; is < stokes_dim; 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.");
903 }
else if (rte_los[0] > 90) {
907 while (za_start < za_grid.
nelem() && za_grid[za_start] < 90.) {
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++)
945 cosza_grid[i_za] = cos(za_grid[i_za + za_start] * DEG2RAD);
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);
1004 if (atmosphere_dim > 1) {
1006 gp_aa, aa_grid, rte_los[1], aa_interp_order);
1008 gp_aa.idx.resize(1);
1015 Vector itw_angs(gp_za.idx.nelem() * gp_aa.idx.nelem());
1018 for (
Index is = 0; is < stokes_dim; is++) {
1019 for (
Index iv = 0; iv < nf; iv++) {
1022 i_field_local(iv,
Range(za_start, za_extend),
joker, is),
1032 const Index& atmosphere_dim,
1033 const Index& cloudbox_on,
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.");
1043 if (new_limit0 < cloudbox_limits[0])
1044 throw runtime_error(
"new_limits0 < cloudbox_limits[0], not allowed!");
1045 if (new_limit1 > cloudbox_limits[1])
1046 throw runtime_error(
"new_limits1 > cloudbox_limits[1], not allowed!");
1048 Tensor7 fcopy = cloudbox_field;
1050 if (atmosphere_dim == 1) {
1051 cloudbox_field = fcopy(
1053 Range(new_limit0 - cloudbox_limits[0], new_limit1 - new_limit0 + 1),
1059 cloudbox_limits[0] = new_limit0;
1060 cloudbox_limits[1] = new_limit1;
1062 if (new_limit2 < cloudbox_limits[2])
1063 throw runtime_error(
"new_limits2 < cloudbox_limits[2], not allowed!");
1064 if (new_limit3 > cloudbox_limits[3])
1065 throw runtime_error(
"new_limits3 > cloudbox_limits[3], not allowed!");
1067 if (atmosphere_dim == 2) {
1068 cloudbox_field = fcopy(
1070 Range(new_limit0 - cloudbox_limits[0], new_limit1 - new_limit0 + 1),
1071 Range(new_limit2 - cloudbox_limits[2], new_limit3 - new_limit2 - 1),
1076 cloudbox_limits[0] = new_limit0;
1077 cloudbox_limits[1] = new_limit1;
1078 cloudbox_limits[2] = new_limit2;
1079 cloudbox_limits[3] = new_limit3;
1081 if (new_limit4 < cloudbox_limits[4])
1082 throw runtime_error(
"new_limits4 < cloudbox_limits[4], not allowed!");
1083 if (new_limit5 > cloudbox_limits[5])
1084 throw runtime_error(
"new_limits5 > cloudbox_limits[5], not allowed!");
1085 cloudbox_field = fcopy(
1087 Range(new_limit0 - cloudbox_limits[0], new_limit1 - new_limit0 + 1),
1088 Range(new_limit2 - cloudbox_limits[2], new_limit3 - new_limit2 + 1),
1089 Range(new_limit4 - cloudbox_limits[4], new_limit5 - new_limit4 + 1),
1093 cloudbox_limits[0] = new_limit0;
1094 cloudbox_limits[1] = new_limit1;
1095 cloudbox_limits[2] = new_limit2;
1096 cloudbox_limits[3] = new_limit3;
1097 cloudbox_limits[4] = new_limit4;
1098 cloudbox_limits[5] = new_limit5;
1107 const Tensor4& particle_field_in,
1110 if (&particle_field_out != &particle_field_in) {
1111 particle_field_out = particle_field_in;
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;
1134 Index& scat_data_checked,
1137 scat_species.resize(0);
1138 scat_data_raw.resize(0);
1139 scat_meta.resize(0);
1140 pnd_field_raw.resize(0);
1141 scat_data_checked = 0;
1149 const Index& atmosphere_dim,
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());
1171 Index last_species = scat_data_raw.
nelem() - 1;
1172 if (last_species == -1) {
1173 scat_data_raw.resize(1);
1183 scat_data_raw[last_species].push_back(scat_data_single);
1184 pnd_field_raw.push_back(pnd_field_data);
1186 out2 <<
" Read single scattering data file " << scat_data_files[
i] <<
"\n";
1189 scat_data_raw[last_species][scat_data_raw[last_species].
nelem() - 1],
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";
1199 pnd_field_raw[pnd_field_raw.
nelem() - 1],
1215 const Index& atmosphere_dim,
1218 const String& pnd_fieldarray_file,
1230 arr_ssd.resize(scat_data_files.
nelem());
1233 out2 <<
" Read single scattering data file " << scat_data_files[
i] <<
"\n";
1238 if (scat_data_raw.
nelem() == 0) {
1239 scat_data_raw.resize(1);
1240 scat_data_raw[0] = arr_ssd;
1242 scat_data_raw.push_back(arr_ssd);
1244 out2 <<
" Read particle number density data \n";
1252 pnd_field_raw.push_back(pnd_tmp[
i]);
1260 Index& propmat_clearsky_agenda_checked,
1261 Index& abs_xsec_agenda_checked,
1263 const Index& atmosphere_dim,
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());
1290 Index last_species = scat_data_raw.
nelem() - 1;
1291 if (last_species == -1) {
1292 scat_data_raw.resize(1);
1300 species[0] =
"particles";
1304 scat_data_raw[last_species].push_back(scat_data_single);
1305 vmr_field_raw.push_back(pnd_field_data);
1307 out2 <<
" Read single scattering data file " << scat_data_files[
i] <<
"\n";
1310 scat_data_raw[last_species][scat_data_raw[last_species].
nelem() - 1],
1313 out2 <<
" Check single scattering properties\n";
1315 "scat_data_single.f_grid to f_grid",
1316 scat_data_raw[last_species][scat_data_raw[last_species].
nelem() - 1]
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";
1328 vmr_field_raw[vmr_field_raw.
nelem() - 1],
1334 if (tmp.
nelem() == 1) {
1335 vmr_field_raw[vmr_field_raw.
nelem() - 1] = tmp[0];
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());
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";
1358 propmat_clearsky_agenda_checked,
1359 abs_xsec_agenda_checked,
1380 arr_ssd.resize(scat_data_files.
nelem());
1381 arr_smd.resize(scat_data_files.
nelem());
1383 Index meta_naming_conv = 0;
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) 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());
1499 scat_data_raw.push_back(std::move(arr_ssd));
1500 scat_meta.push_back(std::move(arr_smd));
1518 if (nspecies != scat_data_raw.
nelem() || nspecies != scat_meta.
nelem()) {
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")
1549 for (
Index i_se = 0; i_se < scat_meta[i_ss].
nelem(); i_se++) {
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 ||
1558 scat_data_raw_tmp.push_back(scat_data_raw[i_ss][i_se]);
1559 scat_meta_tmp.push_back(scat_meta[i_ss][i_se]);
1562 else if (sizeparam ==
"diameter_volume_equ")
1563 for (
Index i_se = 0; i_se < scat_meta[i_ss].
nelem(); i_se++) {
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 ||
1570 scat_data_raw_tmp.push_back(scat_data_raw[i_ss][i_se]);
1571 scat_meta_tmp.push_back(scat_meta[i_ss][i_se]);
1574 else if (sizeparam ==
"diameter_area_equ_aerodynamical")
1575 for (
Index i_se = 0; i_se < scat_meta[i_ss].
nelem(); i_se++) {
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 ||
1582 scat_data_raw_tmp.push_back(scat_data_raw[i_ss][i_se]);
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);
1605 scat_data_raw[i_ss] = std::move(scat_data_raw_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 ==
"") {
1629 i_ss = scat_data_raw.
nelem() - 1;
1632 os <<
"No *scat_data* available. Can not extend temperature range on " 1633 <<
"inexistent data.";
1634 throw runtime_error(os.
str());
1639 if (nspecies != scat_data_raw.
nelem()) {
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());
1653 partfield_name, scat_species[
i], scat_species_delim);
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());
1664 for (
Index i_se = 0; i_se < scat_data_raw[i_ss].
nelem(); i_se++) {
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);
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.";
1759 scat_data_raw[i_ss][i_se] = std::move(ssdn);
1774 const Index& atmosphere_dim,
1777 const Index& zeropadding,
1783 if (pnd_field_raw.empty()) {
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());
1819 if (cloudbox_limits.
nelem() != 2 * atmosphere_dim)
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*");
1826 cloudbox_limits_tmp = cloudbox_limits;
1831 for (
Index d = 0; d < atmosphere_dim; d++) {
1833 if (pnd_field_raw[
i].get_grid_size(d) < 2) {
1835 os <<
"Error in pnd_field_raw data. ";
1836 os <<
"Dimension " << d <<
" (name: \"";
1837 os << pnd_field_raw[
i].get_grid_name(d);
1838 os <<
"\") has only ";
1839 os << pnd_field_raw[
i].get_grid_size(d);
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;
1850 p_grid[
Range(cloudbox_limits_tmp[0], Np_cloud)];
1858 cloudbox_limits_tmp);
1861 if (atmosphere_dim == 1) {
1865 pnd_field_tmp, p_grid_cloud, pnd_field_raw, 1, zeropadding, verbosity);
1869 pnd_field_tmp[0].get_numeric_grid(1),
1870 pnd_field_tmp[0].get_numeric_grid(2),
1873 }
else if (atmosphere_dim == 2) {
1874 const Index Nlat_cloud =
1875 cloudbox_limits_tmp[3] - cloudbox_limits_tmp[2] + 1;
1878 lat_grid[
Range(cloudbox_limits_tmp[2], Nlat_cloud)];
1883 out0 <<
"WARNING: zeropadding currently only supported for 1D.";
1887 pnd_field.
resize(pnd_field_raw.
nelem(), Np_cloud, Nlat_cloud, 1);
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.";
1928 lat_grid[
Range(cloudbox_limits_tmp[2], Nlat_cloud)];
1930 lon_grid[
Range(cloudbox_limits_tmp[4], Nlon_cloud)];
1933 pnd_field.
resize(pnd_field_raw.
nelem(), Np_cloud, Nlat_cloud, Nlon_cloud);
1955 Tensor4 itw(Np_cloud, Nlat_cloud, Nlon_cloud, 8);
1961 pnd_field_raw[
i].
data,
1970 dpnd_field_dx.resize(jacobian_quantities.
nelem());
1975 const Index& atmosphere_dim,
1976 const Index& cloudbox_on,
1984 if (atmosphere_dim == 1) {
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.");
1997 const Index np = cloudbox_limits[1] - cloudbox_limits[0] + 1;
1998 const Index nlat = cloudbox_limits[3] - cloudbox_limits[2] + 1;
2000 if (atmosphere_dim == 3) {
2001 nlon = cloudbox_limits[5] - cloudbox_limits[4] + 1;
2004 if (pnd_field.
npages() != np || pnd_field.
nrows() != 1 ||
2005 pnd_field.
ncols() != 1) {
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);
2035 const Index& atmosphere_dim,
2042 if (cloudbox_limits.
nelem() != 2 * atmosphere_dim)
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*");
2050 Index np = cloudbox_limits[1] - cloudbox_limits[0] + 1;
2051 Index nlat = 1, nlon = 1;
2052 if (atmosphere_dim > 1) {
2053 nlat = cloudbox_limits[3] - cloudbox_limits[2] + 1;
2054 if (atmosphere_dim > 2) {
2055 nlon = cloudbox_limits[5] - cloudbox_limits[4] + 1;
2061 dpnd_field_dx.resize(jacobian_quantities.
nelem());
2069 pnd_field.
resize(N_se, np, nlat, nlon);
2071 pnd_field.
resize(1, np, nlat, nlon);
2075 scat_data.resize(1);
2076 scat_data[0].resize(1);
2078 scat_data[0][0].description =
" ";
2081 scat_data[0][0].f_grid.resize(nf);
2082 scat_data[0][0].f_grid = f_grid;
2084 scat_data[0][0].T_grid.resize(nT);
2085 scat_data[0][0].T_grid = 270.;
2087 nlinspace(scat_data[0][0].za_grid, 0, 180, nza);
2089 scat_data[0][0].pha_mat_data.resize(nf, nT, nza, 1, 1, 1, 6);
2090 scat_data[0][0].pha_mat_data = 0.;
2091 scat_data[0][0].ext_mat_data.resize(nf, nT, 1, 1, 1);
2092 scat_data[0][0].ext_mat_data = 0.;
2093 scat_data[0][0].abs_vec_data.resize(nf, nT, 1, 1, 1);
2094 scat_data[0][0].abs_vec_data = 0.;
INDEX Index
The type to use for all integer numbers and indices.
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 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.
const Numeric DENSITY_OF_ICE
const Numeric LAT_LON_MIN
void chk_scattering_data(const ArrayOfSingleScatteringData &scat_data, const ArrayOfScatteringMetaData &scat_meta, const Verbosity &)
Check scattering data general.
Index nelem() const
Number of elements.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
void scat_dataCheck(const ArrayOfArrayOfSingleScatteringData &scat_data, const String &check_type, const Numeric &threshold, const Verbosity &verbosity)
WORKSPACE METHOD: scat_dataCheck.
Declarations having to do with the four output streams.
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
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 ScatSpeciesScatAndMetaRead(ArrayOfArrayOfSingleScatteringData &scat_data_raw, ArrayOfArrayOfScatteringMetaData &scat_meta, const ArrayOfString &scat_data_files, const Verbosity &verbosity)
WORKSPACE METHOD: ScatSpeciesScatAndMetaRead.
Numeric last(ConstVectorView x)
last
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
Index nrows() const
Returns the number of rows.
Linear algebra functions.
Index npages() const
Returns the number of pages.
Internal functions for microphysics calculations (size distributions etc.)
bool empty() const
Returns true if variable size is zero.
Numeric fractional_gp(const GridPos &gp)
fractional_gp
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.
This file contains basic functions to handle XML data files.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
Calculates grid positions for pressure values.
This file contains basic functions to handle ASCII files.
void find_xml_file(String &filename, const Verbosity &verbosity)
Find an xml file.
Header file for interpolation.cc.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Index nrows() const
Returns the number of rows.
bool is_gridpos_at_index_i(const GridPos &gp, const Index &i, const bool &strict)
is_gridpos_at_index_i
Index nelem() const
Returns the number of elements.
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.
Contains sorting routines.
Structure to store a grid position.
Numeric barometric_heightformula(const Numeric &p, const Numeric &dh)
barometric_heightformula
This file contains the definition of Array.
const Index GFIELD3_LON_GRID
Index ncols() const
Returns the number of columns.
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 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.
Index TotalNumberOfElements(const Array< Array< base > > &aa)
Determine total number of elements in an ArrayOfArray.
The global header file for ARTS.
const Index GFIELD3_LAT_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)
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 is_same_within_epsilon(const Numeric &a, const Numeric &b, const Numeric &epsilon)
Check, if two numbers agree within a given epsilon.
_CS_string_type str() const
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.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
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.
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.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
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.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
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.
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.
NUMERIC Numeric
The type to use for all floating point numbers.
Index nlibraries() const
Returns the number of libraries.
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.
bool file_exists(const String &filename)
Checks if the given file exists.
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 chk_scattering_meta_data(const ScatteringMetaData &scat_meta_single, const String &scat_meta_file, const Verbosity &verbosity)
Check scattering data meta.
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.
Header file for special_interp.cc.
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.
Header file for logic.cc.
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.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
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 set_name(const String &nname)
Set agenda name.
void parse_partfield_name(String &partfield_name, const String &part_string, const String &delim)
bool empty() const
Check if variable is empty.
const Index GFIELD3_P_GRID
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.
A constant view of a Vector.
void particle_fieldCleanup(Tensor4 &particle_field_out, const Tensor4 &particle_field_in, const Numeric &threshold, const Verbosity &)
WORKSPACE METHOD: particle_fieldCleanup.
Index nshelves() const
Returns the number of shelves.
Index nelem(const Lines &l)
Number of lines.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
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.
Implementation of gridded fields.
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.
Structure to store a grid position for higher order interpolation.
Index ncols() const
Returns the number of columns.
bool is_size(ConstVectorView x, const Index &n)
Verifies that the size of x is l.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
Internal cloudbox functions.
This file contains header information for the dealing with command line parameters.
Index ncols() const
Returns the number of columns.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
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.
Scattering database structure and functions.
This file contains declerations of functions of physical character.
Index nrows() const
Returns the number of rows.
Index nbooks() const
Returns the number of books.
void resize(Index b, Index p, Index r, Index c)
Resize function.
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.
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.