10#include "matpack_data.h"
35 "Given coordinates are not contained in "
36 " TELSEM atlas. To enable nearest neighbor"
37 "interpolation set *d_max* to a positive "
40 Numeric lat_nn, lon_nn;
42 Numeric
d =
sphdist(lat, lon, lat_nn, lon_nn);
44 "Distance of nearest neighbor exceeds provided limit (",
45 d,
" > ", d_max,
").")
53 emis.resize(f.nelem(), 2);
54 for (Index i = 0; i < f.nelem(); ++i) {
55 std::tie(emis(i, 0), emis(i, 1)) =
56 atlas.
emis_interp(theta, f[i] * 1e-9, class1, class2, emis_v, emis_h);
62 const Index &atmosphere_dim,
63 const Vector &lat_grid,
64 const Vector &lat_true,
65 const Vector &lon_true,
66 const Vector &rtp_pos,
74 lat, lon, atmosphere_dim, lat_grid, lat_true, lon_true, rtp_pos);
97 emis = atlas[cellnumber];
107 const String &filename_pattern,
110 const Index imonth = filename_pattern.find(
"@MM@");
112 "Substring '@MM@' not found in filename_pattern for\n",
113 "month number replacement: ",
118 ostringstream month_ss;
124 String this_filename = filename_pattern;
125 this_filename.replace(imonth, 4, month_ss.str());
126 this_filename = directory +
'/' + this_filename;
128 out2 <<
"Reading TELSEM atlas: " << this_filename <<
'\n';
133 String corr_filename = directory +
'/' +
"correlations";
134 out2 <<
"Reading correlations: " << corr_filename <<
'\n';
135 std::ifstream corr_is;
137 Tensor3 correlation(10, 7, 7);
139 for (Index i = 0; i < 10; i++) {
140 std::getline(corr_is, s);
141 for (Index j = 0; j < 7; j++) {
142 for (Index k = 0; k < 7; k++) {
145 "Error reading correlation.");
147 std::getline(corr_is, s);
156 const String &filename_pattern,
159 const Index imonth = filename_pattern.find(
"@MM@");
161 "Substring '@MM@' not found in filename_pattern for\n",
162 "month number replacement: ",
165 telsem_atlases.resize(12);
166 for (Index i = 1; i <= 12; i++) {
169 if (i < 10) month << 0;
171 String this_filename = filename_pattern;
172 this_filename.replace(imonth, 4, month.str());
173 this_filename = directory +
'/' + this_filename;
175 out2 <<
"Reading TELSEM atlas: " << this_filename <<
'\n';
177 telsem_atlases[i - 1].read(is);
178 telsem_atlases[i - 1].set_month(i);
182 String corr_filename = directory +
'/' +
"correlations";
183 out2 <<
"Reading correlations: " << corr_filename <<
'\n';
185 Tensor3 correlation(10, 7, 7);
187 for (Index i = 0; i < 10; i++) {
189 for (Index j = 0; j < 7; j++) {
190 for (Index k = 0; k < 7; k++) {
198 for (Index i = 0; i < 12; i++) {
199 telsem_atlases[i].set_correl(correlation);
This can be used to make arrays out of anything.
void read(std::istream &is)
Index calc_cellnum(Numeric lat, Numeric lon) const
bool contains(Index cellnumber) const
Index get_class2(Index cellnumber) const
Index calc_cellnum_nearest_neighbor(Numeric lat, Numeric lon) const
void set_correl(const Tensor3 &t)
Vector get_emis_h(Index cellnum) const
std::pair< Numeric, Numeric > get_coordinates(Index cellnum) const
Index get_class1(Index cellnumber) const
std::pair< Numeric, Numeric > emis_interp(Numeric theta, Numeric freq, Index class1, Index class2, const ConstVectorView &ev, const ConstVectorView &eh) const
Vector get_emis_v(Index i) const
Input manipulator class for doubles to enable nan and inf parsing.
static const Index npos
Define npos:
#define ARTS_USER_ERROR_IF(condition,...)
void open_input_file(ifstream &file, const std::string_view name)
Open a file for reading.
This file contains basic functions to handle ASCII files.
Numeric sphdist(const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
sphdist
void telsemStandalone(Matrix &emis, const Numeric &lat, const Numeric &lon, const Numeric &theta, const Vector &f, const TelsemAtlas &atlas, const Numeric &d_max, const Verbosity &)
WORKSPACE METHOD: telsemStandalone.
constexpr Numeric EARTH_RADIUS
constexpr Numeric DEG2RAD
void telsemSurfaceTypeLandSea(Index &surface_type, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lat_true, const Vector &lon_true, const Vector &rtp_pos, const TelsemAtlas &atlas, const Verbosity &)
WORKSPACE METHOD: telsemSurfaceTypeLandSea.
void telsem_atlasesReadAscii(ArrayOfTelsemAtlas &telsem_atlases, const String &directory, const String &filename_pattern, const Verbosity &verbosity)
WORKSPACE METHOD: telsem_atlasesReadAscii.
void telsemAtlasLookup(Vector &emis, const Numeric &lat, const Numeric &lon, const TelsemAtlas &atlas, const Verbosity &)
WORKSPACE METHOD: telsemAtlasLookup.
void telsem_atlasReadAscii(TelsemAtlas &atlas, const String &directory, const Index &month, const String &filename_pattern, const Verbosity &verbosity)
WORKSPACE METHOD: telsem_atlasReadAscii.
This file contains the definition of String, the ARTS string class.
constexpr Numeric earth_radius
Global constant, the radius of the Earth [m].
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, const ConstVectorView &lat_grid, const ConstVectorView &lat_true, const ConstVectorView &lon_true, const ConstVectorView &pos)
Determines the true alt and lon for an "ARTS position".
Declaration of functions in rte.cc.
This file contains the definition of the TELSEM atlas format.