WSL/SLF GitLab Repository

Commit dc224f06 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

A stupid bug has been fixed in SMETIO: the OSWR was not renamed as RSWR...

A stupid bug has been fixed in SMETIO: the OSWR was not renamed as RSWR anymore. Otherwise, small documentation fixes.
parent 1a5d9966
......@@ -187,7 +187,6 @@ template<class T> void Array1D<T>::resize(const unsigned int& asize, const T& in
nx = asize;
}
template<class T> inline T& Array1D<T>::operator()(const unsigned int& index) {
#ifndef NOSAFECHECKS
if (index >= nx) {
......@@ -378,7 +377,6 @@ template<class T> void Array1D<T>::abs() {
}
}
template<class T> const Array1D<T> Array1D<T>::getAbs() const {
Array1D<T> result = *this; //make a copy
result.abs(); //already implemented
......
......@@ -413,7 +413,6 @@ template<class P> std::iostream& operator>>(std::iostream& is, Array2D<P>& array
return is;
}
template<class T> T Array2D<T>::getMin() const {
T min = std::numeric_limits<T>::max();
......
......@@ -72,7 +72,6 @@ template <class T> class Array3DProxy2 {
const unsigned int any;
};
/**
* @class Array3D
* @brief The template class Array3D is a 3D Array (Tensor) able to hold any type of object as datatype.
......@@ -298,7 +297,6 @@ template<class T> Array3DProxy<T> Array3D<T>::operator[](const unsigned int& i)
return Array3DProxy<T>(*this, i);
}
template<class T> Array3D<T>::Array3D() : vecData(), nx(0), ny(0), nz(0), nxny(0), keep_nodata(true)
{
}
......@@ -375,7 +373,6 @@ template<class T> void Array3D<T>::fill(const Array3D<T>& i_array3D,
}
}
template<class T> Array3D<T>::Array3D(const unsigned int& anx, const unsigned int& any, const unsigned int& anz)
: vecData(anx*any*anz), nx(anx), ny(any), nz(anz), nxny(anx*any), keep_nodata(true)
{
......@@ -576,7 +573,6 @@ template<class T> void Array3D<T>::abs() {
}
}
template<class T> const Array3D<T> Array3D<T>::getAbs() const {
Array3D<T> result = *this; //make a copy
result.abs(); //already implemented
......
......@@ -248,7 +248,6 @@ template<class T> inline const T Array4D<T>::operator()(const unsigned int& w, c
return vecData[w + nw*x + y*nwnx + z*nwnxny];
}
template<class T> Array4D<T>::Array4D() : vecData(), nw(0), nx(0), ny(0), nz(0), nwnx(0), nwnxny(0), keep_nodata(true)
{
}
......@@ -329,7 +328,6 @@ template<class T> void Array4D<T>::fill(const Array4D<T>& i_array4D,
}
}
template<class T> Array4D<T>::Array4D(const unsigned int& anw, const unsigned int& anx, const unsigned int& any, const unsigned int& anz)
: vecData(anw*anx*any*anz), nw(anw), nx(anx), ny(any), nz(anz), nwnx(anw*anx), nwnxny(anw*anx*any), keep_nodata(true)
{
......
......@@ -178,7 +178,7 @@ class StandardPressureGenerator : public GeneratorAlgorithm {
* The last evaluation of cloudiness (as a ratio of cloudy_ilwr / clear_sky_ilwr) is used all along
* during the times when no ISWR is available if such ratio is not too old (ie. no more than 1 day old).
* If only RSWR is measured, the measured snow height is used to determine if there is snow on the ground or not.
* In case of snow, a snow albedo of 0.56 is used while in the abscence of snow, a grass albedo of 0.23 is used
* In case of snow, a snow albedo of 0.85 is used while in the abscence of snow, a grass albedo of 0.23 is used
* in order to compute ISWR from RSWR.
*/
class UnsworthGenerator : public GeneratorAlgorithm {
......
......@@ -72,10 +72,10 @@ namespace mio {
*
* @section processing_available Available processing elements
* New filters can easily be developed. The filters that are currently available are the following:
* - RATE: rate of change filter, see FilterRate
* - MIN_MAX: range check filter, see FilterMinMax
* - MIN: minimum check filter, see FilterMin
* - MAX: maximum check filter, see FilterMax
* - MIN_MAX: range check filter, see FilterMinMax
* - RATE: rate of change filter, see FilterRate
* - STD_DEV: reject data outside mean +/- k*stddev, see FilterStdDev
* - MAD: median absolute deviation, see FilterMAD
* - TUKEY: Tukey53H spike detection, based on median, see FilterTukey
......
......@@ -241,6 +241,8 @@ void SMETIO::identify_fields(const std::vector<std::string>& fields, std::vector
//specific key mapping
if (key == "PSUM") {
indexes.push_back(md.getParameterIndex("HNW"));
} else if (key == "OSWR") {
indexes.push_back(md.getParameterIndex("RSWR"));
} else if (key == "OLWR") {
md.addParameter("OLWR");
indexes.push_back(md.getParameterIndex("OLWR"));
......@@ -424,7 +426,7 @@ void SMETIO::readMeteoData(const Date& dateStart, const Date& dateEnd,
//Now loop through all requested stations, open the respective files and parse them
for (size_t ii=startindex; ii<endindex; ii++){
const string filename = vecFiles.at(ii); //filename of current station
const string& filename = vecFiles.at(ii); //filename of current station
if (!IOUtils::fileExists(filename))
throw FileNotFoundException(filename, AT);
......@@ -473,8 +475,7 @@ void SMETIO::writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMete
if(out_dflt_TZ != IOUtils::nodata) timezone=out_dflt_TZ; //if the user set an output time zone, all will be converted to it
try {
smet::SMETType type = smet::ASCII;
if (!outputIsAscii) type = smet::BINARY;
const smet::SMETType type = (outputIsAscii)? smet::ASCII : smet::BINARY;
smet::SMETWriter mywriter(filename, type, outputIsGzipped);
generateHeaderInfo(sd, outputIsAscii, isConsistent, timezone,
......@@ -645,7 +646,7 @@ size_t SMETIO::getNrOfParameters(const std::string& stationname, const std::vect
for (size_t ii=0; ii<vecMeteo.size(); ii++){
has_one_element = true;
size_t current_size = vecMeteo[ii].getNrOfParameters();
const size_t current_size = vecMeteo[ii].getNrOfParameters();
if (actual_nr_of_parameters == IOUtils::npos){
actual_nr_of_parameters = current_size;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment