WSL/SLF GitLab Repository
Skip to content
GitLab
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
2a0f0784
Commit
2a0f0784
authored
Oct 02, 2013
by
Mathias Bavay
Browse files
changed a few names for consistency, added a few const or static methods
parent
18b10ad0
Changes
6
Hide whitespace changes
Inline
Side-by-side
meteoio/DataGenerator.cc
View file @
2a0f0784
...
...
@@ -110,7 +110,7 @@ void DataGenerator::fillMissing(std::vector<METEO_SET>& vecVecMeteo) const
void
DataGenerator
::
setAlgorithms
(
const
Config
&
cfg
)
{
set
<
string
>
set_of_used_parameters
;
get
_p
arameters
(
cfg
,
set_of_used_parameters
);
get
P
arameters
(
cfg
,
set_of_used_parameters
);
set
<
string
>::
const_iterator
it
;
for
(
it
=
set_of_used_parameters
.
begin
();
it
!=
set_of_used_parameters
.
end
();
++
it
)
{
...
...
@@ -132,7 +132,7 @@ void DataGenerator::setAlgorithms(const Config& cfg)
}
}
size_t
DataGenerator
::
get
_p
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
)
void
DataGenerator
::
get
P
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
)
{
std
::
vector
<
std
::
string
>
vec_keys
;
cfg
.
findKeys
(
vec_keys
,
std
::
string
(),
"Generators"
);
...
...
@@ -144,8 +144,6 @@ size_t DataGenerator::get_parameters(const Config& cfg, std::set<std::string>& s
set_parameters
.
insert
(
IOUtils
::
strToUpper
(
tmp
)
);
}
}
return
set_parameters
.
size
();
}
size_t
DataGenerator
::
getAlgorithmsForParameter
(
const
Config
&
cfg
,
const
std
::
string
&
parname
,
std
::
vector
<
std
::
string
>&
vecAlgorithms
)
...
...
meteoio/DataGenerator.h
View file @
2a0f0784
...
...
@@ -118,7 +118,7 @@ class DataGenerator {
const
std
::
string
toString
()
const
;
private:
static
size_t
get
_p
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
);
static
void
get
P
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
);
static
size_t
getAlgorithmsForParameter
(
const
Config
&
cfg
,
const
std
::
string
&
parname
,
std
::
vector
<
std
::
string
>&
vecAlgorithms
);
static
size_t
getArgumentsForAlgorithm
(
const
Config
&
cfg
,
const
std
::
string
&
parname
,
const
std
::
string
&
algorithm
,
...
...
meteoio/MeteoProcessor.cc
View file @
2a0f0784
...
...
@@ -25,7 +25,7 @@ MeteoProcessor::MeteoProcessor(const Config& cfg) : mi1d(cfg), processing_stack(
{
//Parse [Filters] section, create processing stack for each configured parameter
set
<
string
>
set_of_used_parameters
;
get
_p
arameters
(
cfg
,
set_of_used_parameters
);
get
P
arameters
(
cfg
,
set_of_used_parameters
);
for
(
set
<
string
>::
const_iterator
it
=
set_of_used_parameters
.
begin
();
it
!=
set_of_used_parameters
.
end
();
++
it
){
ProcessingStack
*
tmp
=
new
ProcessingStack
(
cfg
,
*
it
);
...
...
@@ -40,7 +40,7 @@ MeteoProcessor::~MeteoProcessor()
delete
it
->
second
;
}
size_t
MeteoProcessor
::
get
_p
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
)
const
void
MeteoProcessor
::
get
P
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
)
{
std
::
vector
<
std
::
string
>
vec_keys
;
cfg
.
findKeys
(
vec_keys
,
std
::
string
(),
"Filters"
);
...
...
@@ -52,11 +52,9 @@ size_t MeteoProcessor::get_parameters(const Config& cfg, std::set<std::string>&
set_parameters
.
insert
(
tmp
);
}
}
return
set_parameters
.
size
();
}
void
MeteoProcessor
::
getWindowSize
(
ProcessingProperties
&
o_properties
)
void
MeteoProcessor
::
getWindowSize
(
ProcessingProperties
&
o_properties
)
const
{
ProcessingProperties
tmp
;
...
...
@@ -70,7 +68,7 @@ void MeteoProcessor::getWindowSize(ProcessingProperties& o_properties)
compareProperties
(
tmp
,
o_properties
);
}
void
MeteoProcessor
::
compareProperties
(
const
ProcessingProperties
&
newprop
,
ProcessingProperties
&
current
)
const
void
MeteoProcessor
::
compareProperties
(
const
ProcessingProperties
&
newprop
,
ProcessingProperties
&
current
)
{
current
.
points_before
=
MAX
(
current
.
points_before
,
newprop
.
points_before
);
current
.
points_after
=
MAX
(
current
.
points_after
,
newprop
.
points_after
);
...
...
meteoio/MeteoProcessor.h
View file @
2a0f0784
...
...
@@ -64,13 +64,13 @@ class MeteoProcessor {
bool
resample
(
const
Date
&
date
,
const
std
::
vector
<
MeteoData
>&
ivec
,
MeteoData
&
md
);
void
getWindowSize
(
ProcessingProperties
&
o_properties
);
void
getWindowSize
(
ProcessingProperties
&
o_properties
)
const
;
const
std
::
string
toString
()
const
;
private:
s
ize_t
get
_p
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
)
const
;
void
compareProperties
(
const
ProcessingProperties
&
newprop
,
ProcessingProperties
&
current
)
const
;
s
tatic
void
get
P
arameters
(
const
Config
&
cfg
,
std
::
set
<
std
::
string
>&
set_parameters
);
static
void
compareProperties
(
const
ProcessingProperties
&
newprop
,
ProcessingProperties
&
current
);
Meteo1DInterpolator
mi1d
;
std
::
map
<
std
::
string
,
ProcessingStack
*>
processing_stack
;
...
...
meteoio/meteofilters/ProcessingStack.cc
View file @
2a0f0784
...
...
@@ -33,7 +33,8 @@ ProcessingStack::ProcessingStack(const Config& cfg, const std::string& parname)
std
::
ostringstream
tmp
;
tmp
<<
param_name
<<
"::arg"
<<
(
ii
+
1
);
getArgumentsForFilter
(
cfg
,
tmp
.
str
(),
vec_args
);
//Read arguments
//Read arguments
cfg
.
getValue
(
tmp
.
str
(),
"Filters"
,
vec_args
,
IOUtils
::
nothrow
);
filter_stack
.
push_back
(
BlockFactory
::
getBlock
(
block_name
,
vec_args
)
);
}
}
...
...
@@ -65,13 +66,6 @@ void ProcessingStack::getWindowSize(ProcessingProperties& o_properties)
}
}
void
ProcessingStack
::
getArgumentsForFilter
(
const
Config
&
cfg
,
const
std
::
string
&
keyname
,
std
::
vector
<
std
::
string
>&
vecArguments
)
{
// Retrieve the values for a given 'keyname' and store them in a vector calles 'vecArguments'
cfg
.
getValue
(
keyname
,
"Filters"
,
vecArguments
,
IOUtils
::
nothrow
);
}
//this method applies the whole processing stack for all the stations, all the data points for one meteo param
//(as defined in the constructor)
void
ProcessingStack
::
process
(
const
std
::
vector
<
std
::
vector
<
MeteoData
>
>&
ivec
,
...
...
meteoio/meteofilters/ProcessingStack.h
View file @
2a0f0784
...
...
@@ -48,8 +48,6 @@ class ProcessingStack {
const
std
::
string
toString
()
const
;
private:
static
void
getArgumentsForFilter
(
const
Config
&
cfg
,
const
std
::
string
&
keyname
,
std
::
vector
<
std
::
string
>&
vecArguments
);
std
::
vector
<
ProcessingBlock
*>
filter_stack
;
//for now: strictly linear chain of processing blocks
const
std
::
string
param_name
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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