52 throw std::runtime_error(
53 "Given coordinates are not contained in " 54 " TELSEM atlas. To enable nearest neighbor" 55 "interpolation set *d_max* to a positive " 64 out <<
"Distance of nearest neighbor exceeds provided limit (";
65 out << d <<
" > " << d_max <<
").";
66 throw std::runtime_error(out.str());
78 std::tie(emis(
i, 0), emis(
i, 1)) =
79 atlas.
emis_interp(theta, f[
i] * 1e-9, class1, class2, emis_v, emis_h);
85 const Index &atmosphere_dim,
97 lat, lon, atmosphere_dim, lat_grid, lat_true, lon_true, rtp_pos);
120 emis = atlas[cellnumber];
130 const String &filename_pattern,
133 const Index imonth = filename_pattern.find(
"@MM@");
136 os <<
"Substring '@MM@' not found in filename_pattern for" << std::endl
137 <<
"month number replacement: " << filename_pattern;
148 String this_filename = filename_pattern;
149 this_filename.replace(imonth, 4, month_ss.
str());
150 this_filename = directory +
'/' + this_filename;
152 out2 <<
"Reading TELSEM atlas: " << this_filename <<
'\n';
157 String corr_filename = directory +
'/' +
"correlations";
158 out2 <<
"Reading correlations: " << corr_filename <<
'\n';
159 std::ifstream corr_is;
164 std::getline(corr_is, s);
165 for (
Index j = 0; j < 7; j++) {
166 for (
Index k = 0; k < 7; k++) {
167 corr_is >> correlation(
i, j, k);
169 throw std::runtime_error(
"Error reading correlation.");
171 std::getline(corr_is, s);
180 const String &filename_pattern,
183 const Index imonth = filename_pattern.find(
"@MM@");
186 os <<
"Substring '@MM@' not found in filename_pattern for" << std::endl
187 <<
"month number replacement: " << filename_pattern;
190 telsem_atlases.resize(12);
194 if (
i < 10) month << 0;
196 String this_filename = filename_pattern;
197 this_filename.replace(imonth, 4, month.
str());
198 this_filename = directory +
'/' + this_filename;
200 out2 <<
"Reading TELSEM atlas: " << this_filename <<
'\n';
202 telsem_atlases[i - 1].read(is);
203 telsem_atlases[i - 1].set_month(i);
207 String corr_filename = directory +
'/' +
"correlations";
208 out2 <<
"Reading correlations: " << corr_filename <<
'\n';
214 for (
Index j = 0; j < 7; j++) {
215 for (
Index k = 0; k < 7; k++) {
216 is >> correlation(
i, j, k);
217 if (is.fail())
throw std::runtime_error(
"Error reading correlation.");
224 telsem_atlases[
i].set_correl(correlation);
INDEX Index
The type to use for all integer numbers and indices.
This file contains the definition of the TELSEM atlas format.
std::pair< Numeric, Numeric > get_coordinates(Index cellnum) const
Vector get_emis_h(Index cellnum) const
Index calc_cellnum(Numeric lat, Numeric lon) const
void read(std::istream &is)
void telsem_atlasesReadAscii(ArrayOfTelsemAtlas &telsem_atlases, const String &directory, const String &filename_pattern, const Verbosity &verbosity)
WORKSPACE METHOD: telsem_atlasesReadAscii.
bool contains(Index cellnumber) const
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 basic functions to handle ASCII files.
Index nelem() const
Returns the number of elements.
Index get_class2(Index cellnumber) const
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.
Index get_class1(Index cellnumber) const
Vector get_emis_v(Index i) const
void pos2true_latlon(Numeric &lat, Numeric &lon, const Index &atmosphere_dim, ConstVectorView lat_grid, ConstVectorView lat_true, ConstVectorView lon_true, ConstVectorView pos)
Determines the true alt and lon for an "ARTS position".
_CS_string_type str() const
Index calc_cellnum_nearest_neighbor(Numeric lat, Numeric lon) const
Numeric sphdist(const Numeric &lat1, const Numeric &lon1, const Numeric &lat2, const Numeric &lon2)
sphdist
NUMERIC Numeric
The type to use for all floating point numbers.
std::pair< Numeric, Numeric > emis_interp(Numeric theta, Numeric freq, Index class1, Index class2, const ConstVectorView &ev, const ConstVectorView &eh) const
Implementation of Matrix, Vector, and such stuff.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
This can be used to make arrays out of anything.
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
void telsemAtlasLookup(Vector &emis, const Numeric &lat, const Numeric &lon, const TelsemAtlas &atlas, const Verbosity &)
WORKSPACE METHOD: telsemAtlasLookup.
void resize(Index n)
Resize function.
void set_correl(const Tensor3 &t)
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.
This file contains the definition of String, the ARTS string class.
Declaration of functions in rte.cc.
void resize(Index r, Index c)
Resize function.