WSL/SLF GitLab Repository
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
snow-models
meteoio
Commits
eb3f8a06
Commit
eb3f8a06
authored
Oct 20, 2016
by
Mathias Bavay
Browse files
code cleanup and improvements to some of the figures (for the INARCH workshop)
parent
d2fdb437
Changes
8
Hide whitespace changes
Inline
Side-by-side
doc/images/meteoio_workflow.fig
View file @
eb3f8a06
...
...
@@ -210,5 +210,6 @@ Single
4 1 0 50 -1 2 16 0.0000 4 180 1695 4635 8100 Generate Data\001
4 1 0 50 -1 2 16 0.0000 4 225 1755 4725 9450 Spatialize Data\001
4 1 -1 50 -1 3 20 0.0000 4 240 855 8145 8235 Caller\001
4 1 0 50 -1 2 16 0.0000 4 240 190
5
4725 4005
r
aw data editing\001
4 1 0 50 -1 2 16 0.0000 4 240 19
8
0 4725 4005
R
aw data editing\001
4 1 0 50 -1 2 16 0.0000 4 180 1230 4725 2655 Read Data\001
4 1 -1 50 -1 3 20 0.0000 4 285 2235 8145 8640 (data consumer)\001
doc/images/meteoio_workflow.pdf
View file @
eb3f8a06
No preview for this file type
doc/images/meteoio_workflow.png
View replaced file @
d2fdb437
View file @
eb3f8a06
7.2 KB
|
W:
|
H:
7.81 KB
|
W:
|
H:
2-up
Swipe
Onion skin
doc/images/typical_setup.pdf
View file @
eb3f8a06
No preview for this file type
meteoio/Meteo1DInterpolator.h
View file @
eb3f8a06
...
...
@@ -21,7 +21,7 @@
#include
<meteoio/dataClasses/MeteoData.h>
#include
<meteoio/Config.h>
#include
<meteoio/meteoResampling/ResamplingAlgorithms.h>
#include
<meteoio/meteoFilters/ProcessingBlock.h>
#include
<meteoio/meteoFilters/ProcessingBlock.h>
//for ProcessingProperties
#include
<string>
#include
<vector>
...
...
meteoio/Meteo2DInterpolator.cc
View file @
eb3f8a06
...
...
@@ -119,12 +119,12 @@ Meteo2DInterpolator::~Meteo2DInterpolator()
*/
void
Meteo2DInterpolator
::
setAlgorithms
()
{
s
et
<
string
>
set_of_used_parameters
;
s
td
::
set
<
std
::
string
>
set_of_used_parameters
;
get_parameters
(
cfg
,
set_of_used_parameters
);
s
et
<
string
>::
const_iterator
it
;
s
td
::
set
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
set_of_used_parameters
.
begin
();
it
!=
set_of_used_parameters
.
end
();
++
it
)
{
const
std
::
string
parname
=
*
it
;
const
std
::
string
parname
(
*
it
)
;
std
::
vector
<
std
::
string
>
tmpAlgorithms
;
const
size_t
nrOfAlgorithms
=
getAlgorithmsForParameter
(
cfg
,
parname
,
tmpAlgorithms
);
...
...
@@ -151,7 +151,7 @@ size_t Meteo2DInterpolator::get_parameters(const Config& cfg, std::set<std::stri
for
(
size_t
ii
=
0
;
ii
<
vec_keys
.
size
();
ii
++
)
{
const
size_t
found
=
vec_keys
[
ii
].
find_first_of
(
":"
);
if
(
found
!=
std
::
string
::
npos
){
const
string
tmp
=
vec_keys
[
ii
].
substr
(
0
,
found
);
const
std
::
string
tmp
(
vec_keys
[
ii
].
substr
(
0
,
found
)
)
;
set_parameters
.
insert
(
IOUtils
::
strToUpper
(
tmp
)
);
}
}
...
...
@@ -172,7 +172,7 @@ void Meteo2DInterpolator::interpolate(const Date& date, const DEMObject& dem, co
if
(
!
algorithms_ready
)
setAlgorithms
();
const
string
param_name
=
MeteoData
::
getParameterName
(
meteoparam
);
const
std
::
string
param_name
(
MeteoData
::
getParameterName
(
meteoparam
)
)
;
//Get grid from buffer if it exists
std
::
ostringstream
grid_hash
;
...
...
@@ -181,7 +181,7 @@ void Meteo2DInterpolator::interpolate(const Date& date, const DEMObject& dem, co
return
;
//Show algorithms to be used for this parameter
const
map
<
string
,
vector
<
InterpolationAlgorithm
*>
>::
iterator
it
=
mapAlgorithms
.
find
(
param_name
);
const
std
::
map
<
string
,
vector
<
InterpolationAlgorithm
*>
>::
iterator
it
=
mapAlgorithms
.
find
(
param_name
);
if
(
it
==
mapAlgorithms
.
end
())
throw
IOException
(
"No interpolation algorithms configured for parameter "
+
param_name
,
AT
);
...
...
@@ -224,7 +224,7 @@ void Meteo2DInterpolator::interpolate(const Date& date, const DEMObject& dem, co
const
std
::
vector
<
Coords
>&
in_coords
,
std
::
vector
<
double
>&
result
,
std
::
string
&
info_string
)
{
result
.
clear
();
vector
<
Coords
>
vec_coords
(
in_coords
);
std
::
vector
<
Coords
>
vec_coords
(
in_coords
);
if
(
use_full_dem
)
{
Grid2DObject
result_grid
;
...
...
@@ -289,7 +289,7 @@ size_t Meteo2DInterpolator::getArgumentsForAlgorithm(const std::string& param,
std
::
vector
<
std
::
string
>&
vecArgs
)
const
{
vecArgs
.
clear
();
const
string
keyname
=
param
+
"::"
+
algorithm
;
const
std
::
string
keyname
=
param
+
"::"
+
algorithm
;
cfg
.
getValue
(
keyname
,
"Interpolations2D"
,
vecArgs
,
IOUtils
::
nothrow
);
return
vecArgs
.
size
();
...
...
@@ -301,9 +301,9 @@ void Meteo2DInterpolator::checkMinMax(const double& minval, const double& maxval
for
(
size_t
ii
=
0
;
ii
<
nxy
;
ii
++
){
double
&
value
=
gridobj
(
ii
);
if
(
value
==
IOUtils
::
nodata
)
{
if
(
value
==
IOUtils
::
nodata
)
continue
;
}
if
(
value
<
minval
)
{
value
=
minval
;
}
else
if
(
value
>
maxval
)
{
...
...
@@ -418,7 +418,7 @@ size_t Meteo2DInterpolator::getVirtualStationsData(const Date& i_date, METEO_SET
vecMeteo
.
clear
();
// Check if data is available in cache
const
map
<
Date
,
vector
<
MeteoData
>
>::
const_iterator
it
=
virtual_point_cache
.
find
(
i_date
);
const
std
::
map
<
Date
,
vector
<
MeteoData
>
>::
const_iterator
it
=
virtual_point_cache
.
find
(
i_date
);
if
(
it
!=
virtual_point_cache
.
end
()){
vecMeteo
=
it
->
second
;
return
vecMeteo
.
size
();
...
...
@@ -514,7 +514,8 @@ size_t Meteo2DInterpolator::getVirtualStationsFromGrid(const Date& i_date, METEO
return
vecMeteo
.
size
();
}
const
std
::
string
Meteo2DInterpolator
::
toString
()
const
{
const
std
::
string
Meteo2DInterpolator
::
toString
()
const
{
ostringstream
os
;
os
<<
"<Meteo2DInterpolator>
\n
"
;
os
<<
"Config& cfg = "
<<
hex
<<
&
cfg
<<
dec
<<
"
\n
"
;
...
...
meteoio/Meteo2DInterpolator.h
View file @
eb3f8a06
...
...
@@ -22,12 +22,10 @@
#include
<meteoio/TimeSeriesManager.h>
#include
<meteoio/Config.h>
#include
<meteoio/dataClasses/Buffer.h>
#include
<meteoio/dataClasses/Date.h>
#include
<meteoio/dataClasses/MeteoData.h>
#include
<meteoio/dataClasses/DEMObject.h>
#include
<meteoio/spatialInterpolations/InterpolationAlgorithms.h>
#include
<memory>
#include
<vector>
#include
<map>
...
...
meteoio/meteoFilters/ProcShade.cc
View file @
eb3f8a06
...
...
@@ -146,8 +146,7 @@ void ProcShade::readMask(const std::string& filter, const std::string& filename,
std
::
ifstream
fin
(
filename
.
c_str
());
if
(
fin
.
fail
())
{
std
::
ostringstream
ss
;
ss
<<
"Filter "
<<
filter
<<
": "
;
ss
<<
"error opening file
\"
"
<<
filename
<<
"
\"
, possible reason: "
<<
strerror
(
errno
);
ss
<<
"Filter "
<<
filter
<<
": "
<<
"error opening file
\"
"
<<
filename
<<
"
\"
, possible reason: "
<<
strerror
(
errno
);
throw
AccessException
(
ss
.
str
(),
AT
);
}
...
...
@@ -222,10 +221,10 @@ void ProcShade::parse_args(const std::vector<std::string>& vec_args)
}
else
if
(
nrArgs
==
1
)
{
const
std
::
string
root_path
(
cfg
.
getConfigRootDir
()
);
//if this is a relative path, prefix the path with the current path
const
std
::
string
in_filename
=
vec_args
[
0
];
const
std
::
string
in_filename
(
vec_args
[
0
]
)
;
const
std
::
string
prefix
=
(
FileUtils
::
isAbsolutePath
(
in_filename
)
)
?
""
:
root_path
+
"/"
;
const
std
::
string
path
=
FileUtils
::
getPath
(
prefix
+
in_filename
,
true
);
//clean & resolve path
const
std
::
string
filename
=
path
+
"/"
+
FileUtils
::
getFilename
(
in_filename
);
const
std
::
string
path
(
FileUtils
::
getPath
(
prefix
+
in_filename
,
true
)
)
;
//clean & resolve path
const
std
::
string
filename
(
path
+
"/"
+
FileUtils
::
getFilename
(
in_filename
)
)
;
std
::
vector
<
std
::
pair
<
double
,
double
>
>
mask
;
readMask
(
getName
(),
filename
,
mask
);
masks
[
"*"
]
=
mask
;
//this mask is valid for ALL stations
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment