WSL/SLF GitLab Repository

Commit 9a8faf59 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Small fixes for the doxygen issues...

parent fc76f7f6
......@@ -35,8 +35,9 @@ namespace mio {
/**
* @class BufferedIOHandler
* @brief This class serves as a wrapper around all children of IOInterface. It internally handles
* the buffering of the data and introduces a few convenient functions to access meteo data
* @brief This class is the class to use for buffered I/O operations. It is responsible for transparently loading the plugins
* and transparently buffering the data. It follows the interface defined by the IOInterface class with the addition of
* a few convenience methods.
*
* @author Thomas Egger
* @date 2009-07-25
......@@ -50,11 +51,11 @@ class BufferedIOHandler {
class BufferedIOHandler : public IOInterface {
#endif
public:
/**
* @brief The constructor accepts an already initialized child of IOInterface (e.g. A3DIO, BormaIO, ImisIO)
* and a ConfigReader object
*
*
* Example Usage:
* @code
* IOHandler *io1;
......@@ -71,8 +72,8 @@ class BufferedIOHandler : public IOInterface {
#endif
/**
* @brief The function returns the next MeteoData object for each station with a
* date >= to the parameter _date. vecMeteo and vecStation will be empty if there
* @brief The function returns the next MeteoData object for each station with a
* date >= to the parameter _date. vecMeteo and vecStation will be empty if there
* is no MeteoData to be found.
* NOTE: only the real measured data is looked at: no resampled values are taken into account
*
......@@ -83,29 +84,29 @@ class BufferedIOHandler : public IOInterface {
void getNextMeteoData(const Date& _date, std::vector<MeteoData>& vecMeteo, std::vector<StationData>& vecStation);
virtual void readStationData(const Date& date, std::vector<StationData>& vecStation);
/**
* @brief See BufferedIOHandler::readMeteoData(const Date& date_in,
* vector<MeteoData>& vecMeteo,
* @brief See BufferedIOHandler::readMeteoData(const Date& date_in,
* vector<MeteoData>& vecMeteo,
* vector<StationData>& vecStation).
*/
void readMeteoData(const Date& dateStart, const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo);
/**
* @brief Fill vector<MeteoData> and vector<StationData> objects with multiple datasets
* @brief Fill vector<MeteoData> and vector<StationData> objects with multiple datasets
* corresponding to the time indicated by the Date object.
* Matching rule: Find first data set for every station which has an event time (measurement time)
* that is greater (newer) or equal to the time represented by the Date object parameter. The
* vector<StationData> object holds multiple StationData objects representing meta information
* Matching rule: Find first data set for every station which has an event time (measurement time)
* that is greater (newer) or equal to the time represented by the Date object parameter. The
* vector<StationData> object holds multiple StationData objects representing meta information
* about the meteo stations that recorded the meteo data.
*
* NOTE:
* NOTE:
* - vecMeteo and vecStation will contain nodata objects if an exact time match is impossible
* and resampling is turned off. If resampling is turned on a resampled value is returned
* and resampling is turned off. If resampling is turned on a resampled value is returned
* if resampling is possible (enough measurements), otherwise nodata objects will be returned
* - is there is absolutely no data to be found, and hence not even station data, vecMeteo and vecStation
* will be filled with only one nodata obejct of MeteoData and StationData respectively
*
*
* Example Usage:
* @code
* vector<MeteoData> vecMeteo; //empty vector
......@@ -129,8 +130,8 @@ class BufferedIOHandler : public IOInterface {
virtual void readAssimilationData(const Date& date_in, Grid2DObject& da_out);
virtual void readLanduse(Grid2DObject& landuse_out);
virtual void readSpecialPoints(std::vector<Coords>& pts);
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector< std::vector<MeteoData> >& vecMeteo,
std::vector< std::vector<StationData> >& vecStation,
const unsigned int& stationindex=IOUtils::npos);
#ifdef _POPC_
......@@ -138,7 +139,7 @@ class BufferedIOHandler : public IOInterface {
std::vector< std::vector<StationData> >& vecStation,
const std::string& name="");
#else
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
virtual void writeMeteoData(const std::vector< std::vector<MeteoData> >& vecMeteo,
const std::vector< std::vector<StationData> >& vecStation,
const std::string& name="");
#endif
......@@ -156,11 +157,11 @@ class BufferedIOHandler : public IOInterface {
bool bufferData(const Date& _date, const unsigned int& stationindex);
void bufferAllData(const Date& _date);
void setBufferProperties();
IOHandler& iohandler;
ConfigReader cfg;
MeteoFilter meteoFilter;
bool always_rebuffer;
Date bufferbefore, bufferafter; //NrOfDays to buffer before and after a given date
......
......@@ -20,13 +20,9 @@
#ifdef PROJ4
#include <proj_api.h>
#endif
#ifndef PI
#define PI 3.141592653589
#endif
using namespace std;
using namespace mio;
using namespace mio::IOUtils;
/**
* @page coords Available coordinate systems
......@@ -34,14 +30,14 @@ using namespace mio::IOUtils;
* the client program uses. However, in order to do so, the input coordinate system must be specified. In order to output
* geolocalized data, the desired coordinate system must also be specified for the outputs (in the output section).
* This is done through the use of the COORDIN and COORDPARAM keys (see the documentation for each plugin).
*
*
* There are two ways of supporting a given coordinate system: through the use of an adhoc implementation
* (that becomes part of MeteoIO) or through the use of an external library, Proj4 [ref: http://trac.osgeo.org/proj/].
* The current internal implementations are the following (given by their keyword):
* - CH1903 for coordinates in the Swiss Grid [ref: http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf]
* - UTM for UTM coordinates (the zone must be specified in the parameters, for example 31T) [ref: http://www.oc.nps.edu/oc2902w/maps/utmups.pdf]
* - LOCAL for local coordinate system (using the horizontal and vertical distance from a reference point, see Coords::geo_distances for the available choice of distance algorithms)
*
*
* Such an example of use is the following:
* @code
* COORDSYS = UTM
......@@ -60,16 +56,16 @@ using namespace mio::IOUtils;
* COORDSYS = PROJ4
* COORDPARAM = +init=epsg:21781
* @endcode
*
*
*/
const struct mio::Coords::ELLIPSOID Coords::ellipsoids[] = {
{ 6378137., 6356752.3142 }, ///< E_WGS84
{ 6378137., 6356752.3141 }, ///< E_GRS80
{ 6377563.396, 6356256.909 }, ///< E_AIRY
{ 6378388., 6356911.946 }, ///< E_INTL1924
{ 6378249.145, 6356514.86955 }, ///< E_CLARKE1880
{ 6378160., 6356774.719 } ///< E_GRS67
const struct Coords::ELLIPSOID Coords::ellipsoids[] = {
{ 6378137., 6356752.3142 }, ///< E_WGS84
{ 6378137., 6356752.3141 }, ///< E_GRS80
{ 6377563.396, 6356256.909 }, ///< E_AIRY
{ 6378388., 6356911.946 }, ///< E_INTL1924
{ 6378249.145, 6356514.86955 }, ///< E_CLARKE1880
{ 6378160., 6356774.719 } ///< E_GRS67
};
/**
......@@ -121,11 +117,11 @@ Coords& Coords::operator=(const Coords& source) {
return *this;
}
namespace mio {
/**
* @brief Print the content of the Coords object (usefull for debugging)
* The Coords is bound by "<Coords>" and "</Coords>" on separate lines
*/
namespace mio {
std::ostream& operator<<(std::ostream &os, const Coords& coord)
{
os << "<Coords>\n";
......@@ -365,7 +361,7 @@ void Coords::setGridIndex(const int _grid_i, const int _grid_j, const int _grid_
* This projection will be used for converting between lat/lon and East/North
* @param[in] _coordinatesystem string identifying the coordinate system to use
* @param[in] _parameters string giving some additional parameters for the projection (optional)
*
*
* The coordinate system can be any of the following:
* - CH1903 for coordinates in the Swiss Grid [ref: http://geomatics.ladetto.ch/ch1903_wgs84_de.pdf]
* - UTM for UTM coordinates (the zone must be specified in the parameters, for example 31T) [ref: http://www.oc.nps.edu/oc2902w/maps/utmups.pdf]
......@@ -438,8 +434,8 @@ void Coords::setDistances(const geo_distances _algo) {
/**
* @brief Check consistency of coordinates
* When both latitude/longitude and easting/northing are given, there is
* a risk of inconsistency between these two sets of coordinates.
* This method checks that enough information is available (ie: at least one set
* a risk of inconsistency between these two sets of coordinates.
* This method checks that enough information is available (ie: at least one set
* of coordinates is present) and if more than one is present, that it is consistent (within 5 meters)
* It throws and exception if something is not right.
*/
......@@ -790,7 +786,7 @@ void Coords::WGS84_to_UTM(double lat_in, double long_in, double& east_out, doubl
//also http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM
//also http://www.oc.nps.edu/oc2902w/maps/utmups.pdf or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/)
//Geometric constants
const double to_rad = PI / 180.0;
const double to_rad = M_PI / 180.0;
const double a = ellipsoids[E_WGS84].a; //major ellipsoid semi-axis
const double b = ellipsoids[E_WGS84].b; //minor ellipsoid semi-axis
const double e2 = (a*a-b*b) / (a*a); //ellispoid eccentricity, squared
......@@ -806,7 +802,7 @@ void Coords::WGS84_to_UTM(double lat_in, double long_in, double& east_out, doubl
const double long0 = (double)((zoneNumber - 1)*6 - 180 + 3) * to_rad; //+3 puts origin in middle of zone
//Geometrical parameters
const double nu = a / sqrt(1.-e2*pow2(sin(Lat))); //radius of curvature of the earth perpendicular to the meridian plane
const double nu = a / sqrt(1.-e2*IOUtils::pow2(sin(Lat))); //radius of curvature of the earth perpendicular to the meridian plane
const double p = (Long-long0);
//calculating first the coefficients of the series, then the Meridional Arc M itself
......@@ -822,9 +818,9 @@ void Coords::WGS84_to_UTM(double lat_in, double long_in, double& east_out, doubl
//calculating the coefficients for the series
const double K1 = M*k0;
const double K2 = 1./4.*k0*nu*sin(2.*Lat);
const double K3 = (k0*nu*sin(Lat)*pow3(cos(Lat))*1./24.) * (5. - pow2(tan(Lat)) + 9.*eP2*pow2(cos(Lat)) + 4.*eP2*eP2*pow4(cos(Lat)));
const double K3 = (k0*nu*sin(Lat)*IOUtils::pow3(cos(Lat))*1./24.) * (5. - IOUtils::pow2(tan(Lat)) + 9.*eP2*IOUtils::pow2(cos(Lat)) + 4.*eP2*eP2*IOUtils::pow4(cos(Lat)));
const double K4 = k0*nu*cos(Lat);
const double K5 = (k0*nu*pow3(cos(Lat))*1./6.) * (1. - pow2(tan(Lat)) + eP2*pow2(cos(Lat)));
const double K5 = (k0*nu*IOUtils::pow3(cos(Lat))*1./6.) * (1. - IOUtils::pow2(tan(Lat)) + eP2*IOUtils::pow2(cos(Lat)));
north_out = K1 + K2*p*p + K3*p*p*p*p;
east_out = K4*p + K5*p*p*p + 500000.0;
......@@ -847,7 +843,7 @@ void Coords::UTM_to_WGS84(double east_in, double north_in, double& lat_out, doub
//also http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM
//also http://www.oc.nps.edu/oc2902w/maps/utmups.pdf or Chuck Gantz (http://www.gpsy.com/gpsinfo/geotoutm/)
//Geometric constants
const double to_deg = 180.0 / PI;
const double to_deg = 180.0 / M_PI;
const double a = ellipsoids[E_WGS84].a; //major ellipsoid semi-axis
const double b = ellipsoids[E_WGS84].b; //minor ellipsoid semi-axis
const double e2 = (a*a-b*b) / (a*a); //ellispoid eccentricity, squared
......@@ -886,10 +882,10 @@ void Coords::UTM_to_WGS84(double east_in, double north_in, double& lat_out, doub
const double fp = mu + J1*sin(2.*mu) + J2*sin(4.*mu) + J3*sin(6.*mu) + J4*sin(8.*mu);
//calculating the parameters
const double C1 = eP2 * pow2(cos(fp));
const double T1 = pow2( tan(fp) );
const double R1 = a*(1.-e2) / pow((1.-e2*pow2(sin(fp))), 1.5);
const double N1 = a / sqrt(1.-e2*pow2(sin(fp)));
const double C1 = eP2 * IOUtils::pow2(cos(fp));
const double T1 = IOUtils::pow2( tan(fp) );
const double R1 = a*(1.-e2) / pow((1.-e2*IOUtils::pow2(sin(fp))), 1.5);
const double N1 = a / sqrt(1.-e2*IOUtils::pow2(sin(fp)));
const double D = east_in / (N1*k0);
//calculating the coefficients of the series for latitude and longitude
......@@ -918,7 +914,7 @@ void Coords::WGS84_to_PROJ4(double lat_in, double long_in, double& east_out, dou
const std::string src_param="+proj=latlong +datum=WGS84 +ellps=WGS84";
projPJ pj_latlong, pj_dest;
double x=long_in*DEG_TO_RAD, y=lat_in*DEG_TO_RAD;
if ( !(pj_dest = pj_init_plus(coordparam.c_str())) ) {
pj_free(pj_dest);
throw InvalidArgumentException("Failed to initalize Proj4 with given arguments: "+coordparam, AT);
......@@ -995,7 +991,7 @@ void Coords::distance(const Coords& destination, double& distance, double& beari
//HACK: this is the 2D distance, it does not work in 3D!!
if(isSameProj(destination)) {
//we can use simple cartesian grid arithmetic
const double to_deg = 180.0 / PI;
const double to_deg = 180.0 / M_PI;
distance = sqrt( IOUtils::pow2(easting - destination.getEasting()) + IOUtils::pow2(northing - destination.getNorthing()) );
bearing = atan2( northing - destination.getNorthing() , easting - destination.getEasting() );
bearing = fmod( bearing*to_deg+360. , 360. );
......@@ -1023,7 +1019,7 @@ void Coords::distance(const Coords& destination, double& distance, double& beari
void Coords::WGS84_to_local(double lat_in, double long_in, double& east_out, double& north_out) const
{
double alpha;
const double to_rad = PI / 180.0;
const double to_rad = M_PI / 180.0;
double distance;
if((ref_latitude==IOUtils::nodata) || (ref_longitude==IOUtils::nodata)) {
......@@ -1041,7 +1037,7 @@ void Coords::WGS84_to_local(double lat_in, double long_in, double& east_out, dou
default:
throw InvalidArgumentException("Unrecognized geodesic distance algorithm selected", AT);
}
east_out = distance*sin(alpha*to_rad);
north_out = distance*cos(alpha*to_rad);
}
......@@ -1057,7 +1053,7 @@ void Coords::WGS84_to_local(double lat_in, double long_in, double& east_out, dou
*/
void Coords::local_to_WGS84(double east_in, double north_in, double& lat_out, double& long_out) const
{
const double to_deg = 180.0 / PI;
const double to_deg = 180.0 / M_PI;
const double distance = sqrt( IOUtils::pow2(east_in) + IOUtils::pow2(north_in) );
const double bearing = fmod( atan2(east_in, north_in)*to_deg+360. , 360.);
......@@ -1102,16 +1098,16 @@ void Coords::WGS84_to_NULL(double /*lat_in*/, double /*long_in*/, double& /*east
void Coords::cosineInverse(const double& lat_ref, const double& lon_ref, const double& distance, const double& bearing, double& lat, double& lon) const
{
const double Rearth = 6371.e3;
const double to_rad = PI / 180.0;
const double to_deg = 180.0 / PI;
const double to_rad = M_PI / 180.0;
const double to_deg = 180.0 / M_PI;
const double lat_ref_rad = lat_ref*to_rad;
const double bearing_rad = bearing*to_rad;
lat = asin( sin(lat_ref_rad)*cos(distance/Rearth) +
lat = asin( sin(lat_ref_rad)*cos(distance/Rearth) +
cos(lat_ref_rad)*sin(distance/Rearth)*cos(bearing_rad) );
lon = lon_ref*to_rad + atan2( sin(bearing_rad)*sin(distance/Rearth)*cos(lat_ref_rad) ,
lon = lon_ref*to_rad + atan2( sin(bearing_rad)*sin(distance/Rearth)*cos(lat_ref_rad) ,
cos(distance/Rearth) - sin(lat_ref_rad)*sin(lat) );
lon = fmod(lon+PI, 2.*PI) - PI;
lon = fmod(lon+M_PI, 2.*M_PI) - M_PI;
lat *= to_deg;
lon *= to_deg;
......@@ -1130,13 +1126,13 @@ void Coords::cosineInverse(const double& lat_ref, const double& lon_ref, const d
double Coords::cosineDistance(const double& lat1, const double& lon1, const double& lat2, const double& lon2, double& alpha) const
{
const double Rearth = 6371.e3;
const double to_rad = PI / 180.0;
const double d = acos(
sin(lat1*to_rad) * sin(lat2*to_rad)
+ cos(lat1*to_rad) * cos(lat2*to_rad) * cos((lon2-lon1)*to_rad)
const double to_rad = M_PI / 180.0;
const double d = acos(
sin(lat1*to_rad) * sin(lat2*to_rad)
+ cos(lat1*to_rad) * cos(lat2*to_rad) * cos((lon2-lon1)*to_rad)
) * Rearth;
alpha = atan2( sin((lon2-lon1)*to_rad)*cos(lat2*to_rad) ,
alpha = atan2( sin((lon2-lon1)*to_rad)*cos(lat2*to_rad) ,
cos(lat1*to_rad)*sin(lat2*to_rad) - sin(lat1*to_rad)*cos(lat2*to_rad)*cos((lon2-lon1)*to_rad)
) / to_rad;
alpha = fmod((alpha+360.), 360.);
......@@ -1163,8 +1159,8 @@ double Coords::VincentyDistance(const double& lat1, const double& lon1, const do
const double a = ellipsoids[E_WGS84].a; //major ellipsoid semi-axis
const double b = ellipsoids[E_WGS84].b; //minor ellipsoid semi-axis
const double f = (a - b) / a; //ellispoid flattening
const double to_rad = PI / 180.0;
const double to_rad = M_PI / 180.0;
const double L = (lon1 - lon2)*to_rad;
const double U1 = atan( (1.-f)*tan(lat1*to_rad) );
const double U2 = atan( (1.-f)*tan(lat2*to_rad) );
......@@ -1190,23 +1186,23 @@ double Coords::VincentyDistance(const double& lat1, const double& lon1, const do
}
C = f/16. * cos_alpha2*(4.+f*(4.-3.*cos_alpha2));
lambda_p = lambda;
lambda = L + (1.-C)*f*sin_alpha*(
sigma + C*sin_sigma*( cos_2sigma_m + C * cos_sigma * (-1.+2.*IOUtils::pow2(cos_2sigma_m)) )
lambda = L + (1.-C)*f*sin_alpha*(
sigma + C*sin_sigma*( cos_2sigma_m + C * cos_sigma * (-1.+2.*IOUtils::pow2(cos_2sigma_m)) )
);
n++;
} while ( (n<n_max) && (fabs(lambda - lambda_p) > thresh) );
if(n>n_max) {
throw IOException("Distance calculation not converging", AT);
}
u2 = cos_alpha2 * (a*a - b*b) / (b*b);
A = 1. + u2/16384. * ( 4096.+u2*(-768.+u2*(320.-175.*u2)) );
B = u2/1024. * ( 256.+u2*(-128.+u2*(74.-47.*u2)) );
delta_sigma = B*sin_sigma*( cos_2sigma_m+B/4.*( cos_sigma*(-1.+2.*IOUtils::pow2(cos_2sigma_m)) - B/6.*(cos_2sigma_m*(-3.+4.*IOUtils::pow2(sin_sigma))*(-3.+4.*IOUtils::pow2(cos_2sigma_m))) ) );
s = b*A*(sigma - delta_sigma); //distance between the two points
//computation of the average forward bearing
double alpha1 = atan2(cos(U2)*sin(lambda), cos(U1)*sin(U2)-sin(U1)*cos(U2)*cos(lambda)) / to_rad; //forward azimuth
//double alpha2 = atan2(cos(U1)*sin(lambda), sin(U1)*cos(U2)-cos(U1)*sin(U2)*cos(lambda)) / to_rad; //reverse azimuth
......@@ -1239,8 +1235,8 @@ void Coords::VincentyInverse(const double& lat_ref, const double& lon_ref, const
const double a = ellipsoids[E_WGS84].a; //major ellipsoid semi-axis, value for wgs84
const double b = ellipsoids[E_WGS84].b; //minor ellipsoid semi-axis, value for wgs84
const double f = (a - b) / a; //ellispoid flattening
const double to_rad = PI / 180.0;
const double to_deg = 180.0 / PI;
const double to_rad = M_PI / 180.0;
const double to_deg = 180.0 / M_PI;
const double alpha1 = bearing*to_rad;
const double tanU1 = (1.-f)*tan(lat_ref*to_rad);
......@@ -1252,23 +1248,23 @@ void Coords::VincentyInverse(const double& lat_ref, const double& lon_ref, const
const double u2 = cos2alpha * (a*a - b*b) / (b*b);
const double A = 1. + u2/16384. * (4096. + u2*(-768.+u2*(320.-175.*u2)) );
const double B = u2/1024. * (256. + u2*(-128.+u2*(74.-47.*u2)));
double sigma = distance / (b*A);
double sigma_p = 2.*PI;
double sigma_p = 2.*M_PI;
double cos2sigma_m = cos( 2.*sigma1 + sigma ); //required to avoid uninitialized value
while (fabs(sigma - sigma_p) > thresh) {
cos2sigma_m = cos( 2.*sigma1 + sigma );
double delta_sigma = B*sin(sigma) * ( cos2sigma_m + B/4. * (
cos(sigma)*(-1.+2.*cos2sigma_m*cos2sigma_m)
-B/6. * cos2sigma_m * (-3.+4.*pow2(sin(sigma))) * (-3.+4.*cos2sigma_m*cos2sigma_m)
double delta_sigma = B*sin(sigma) * ( cos2sigma_m + B/4. * (
cos(sigma)*(-1.+2.*cos2sigma_m*cos2sigma_m)
-B/6. * cos2sigma_m * (-3.+4.*IOUtils::pow2(sin(sigma))) * (-3.+4.*cos2sigma_m*cos2sigma_m)
) );
sigma_p = sigma;
sigma = distance / (b*A) + delta_sigma;
}
lat = atan2( sinU1*cos(sigma) + cosU1*sin(sigma)*cos(alpha1),
(1.-f) * sqrt( sinAlpha*sinAlpha + pow2(sinU1*sin(sigma) - cosU1*cos(sigma)*cos(alpha1)) )
(1.-f) * sqrt( sinAlpha*sinAlpha + IOUtils::pow2(sinU1*sin(sigma) - cosU1*cos(sigma)*cos(alpha1)) )
);
const double lambda = atan2( sin(sigma)*sin(alpha1), cosU1*cos(sigma) - sinU1*sin(sigma)*cos(alpha1) );
const double C = f/16. * cos2alpha * (4.+f*(4.-3.*cos2alpha));
......@@ -1300,12 +1296,12 @@ void Coords::setFunctionPointers() {
//init function pointers
std::map<std::string, convfunc>::iterator mapitTo;
std::map<std::string, convfunc>::iterator mapitFrom;
mapitTo = to_wgs84.find(coordsystem);
mapitFrom = from_wgs84.find(coordsystem);
mapitTo = to_wgs84.find(coordsystem);
mapitFrom = from_wgs84.find(coordsystem);
if ((mapitTo == to_wgs84.end()) || (mapitFrom == from_wgs84.end()))
throw IOException("No known conversions exist for coordinate system " + coordsystem, AT);
convToWGS84 = mapitTo->second;
convFromWGS84 = mapitFrom->second;
......
......@@ -23,6 +23,7 @@
#include <string>
#include <iostream>
#include <map>
#include <cmath>
namespace mio {
......@@ -145,7 +146,7 @@ class Coords {
std::string coordparam;
convfunc convToWGS84, convFromWGS84;
geo_distances distance_algo;
///Keywords for selecting an ellipsoid to use
enum ELLIPSOIDS_NAMES {
E_WGS84, ///<Globally useable WGS84 ellipsoid
......
......@@ -49,6 +49,7 @@ class Grid2DObject : POPBase {
class Grid2DObject {
#endif
public:
///structure to contain the grid coordinates of a point in a 2D grid
typedef struct GRID_POINT_2D {
unsigned int ix; ///<grid index along X
unsigned int iy; ///<grid index along Y
......@@ -82,7 +83,7 @@ class Grid2DObject {
/**
* @brief Compute the positional parameters that are not already known
* This means that the Coords::point object that is given either contains geographic coordinates or
* This means that the Coords::point object that is given either contains geographic coordinates or
* grid indices. This method will calculate the missing ones (so that (i,j) match with (lat,lon)
* and (east,north)). If the given point had a "NULL" projection, it will be set to the grid's.
* @param point coordinate to convert
......@@ -92,7 +93,7 @@ class Grid2DObject {
/**
* @brief Compute the positional parameters that are not already known
* This means that the Coords::point object that is given either contains geographic coordinates or
* This means that the Coords::point object that is given either contains geographic coordinates or
* grid indices. This method will calculate the missing ones (so that (i,j) match with (lat,lon)
* and (east,north)). Any point that is either invalid or outside the grid is removed from the vector.
* If the given point had a "NULL" projection, it will be set to the grid's.
......@@ -111,7 +112,7 @@ class Grid2DObject {
void set(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner);
/**
* @brief Set all variables in one go. Notably the member grid2D of type
* @brief Set all variables in one go. Notably the member grid2D of type
* Array2D\<double\> will be destroyed and recreated to size ncols x nrows.
* @param ncols (unsigned int) number of colums in the grid2D
* @param nrows (unsigned int) number of rows in the grid2D
......@@ -121,7 +122,7 @@ class Grid2DObject {
*/
void set(const unsigned int& ncols, const unsigned int& nrows,
const double& cellsize, const Coords& _llcorner, const Array2D<double>& grid2D_in); //TODO: const CArray would be better...
/**
* @brief check if the current Grid2DObject has the same geolocalization attributes
* as another Grid2DObject (as well as same cells). The grid coordinates (xllcorner & yllcorner) are NOT
......
......@@ -36,10 +36,14 @@ typedef std::map<std::string, IOPlugin::IOPlugin>::iterator PLUGIN_ITERATOR;
/**
* @file IOHandler.h
* The is the class implementing the interface as defined by the mio::IOInterface class.
* This class is responsible for loading the necessary plugins and getting the data through them.
*/
/**
* @class IOHandler
* @brief This class is the class to use for raw I/O operations. It is responsible for transparently loading the plugins
* and it follows the interface defined by the IOInterface class with the addition of
* a few convenience methods.
*/
class IOHandler : public IOInterface {
public:
IOHandler(const std::string& configfile);
......@@ -57,7 +61,7 @@ class IOHandler : public IOInterface {
const std::vector<STATION_DATASET>& vecStation,
const std::string& name="");
virtual void readMeteoData(const Date& dateStart, const Date& dateEnd,
std::vector<METEO_DATASET>& vecMeteo,
std::vector<METEO_DATASET>& vecMeteo,
std::vector<STATION_DATASET>& vecStation,
const unsigned& stationindex=IOUtils::npos);
void readMeteoData(const Date& date, METEO_DATASET& vecMeteo, STATION_DATASET& vecStation);
......@@ -67,7 +71,7 @@ class IOHandler : public IOInterface {
private:
void loadDynamicPlugins();
void loadPlugin(const std::string& libname, const std::string& classname,
void loadPlugin(const std::string& libname, const std::string& classname,
DynamicLibrary*& dynLibrary, IOInterface*& io);
void deletePlugin(DynamicLibrary*& dynLibrary, IOInterface*& io) throw();
void registerPlugins();
......
......@@ -17,6 +17,8 @@
*/
#ifndef __MAINPAGE_H__
#define __MAINPAGE_H__
namespace mio {
/**
* @mainpage Welcome to MeteoIO
* @section intro_sec Introduction
......@@ -28,7 +30,7 @@
* - enabling unattended use from an IO point of view
* - offering high modularity so that individual elements of the library can easily be replaced/expanded/added
* - by its modularity, help interdisciplinary development, each module being targeted at a specific developer profile
*
*
* This library is available under LPGL version 3 or above, see <a href="http://www.gnu.org/licenses/lgpl.txt">www.gnu.org</a>.
*
* @section table_of_content Table of content
......@@ -86,29 +88,29 @@
* @code
* [General]
* PLUGINPATH = ../../lib #optional, if not provided the plugins will be search in the normal library path
*
*
* [Input]
* COORDSYS = CH1903 #mandatory: which coordinate system is used for the geographic coordinates
* COORDPARAM = -999 #extra arguments for the chosen coordinate system (often, none)
*
*
* DEM = ARC #plugin to use for reading DEM information
* #this might be followed by any number of arguments that are specific to this plugin
*
*
* METEO = A3D #plugin to use for reading meteorological data
* #this might be followed by any number of arguments that are specific to this plugin
*
*
* [Output]
* COORDSYS = CH1903
*
* GRID2D = ARC #plugin to use for writing 2D grids
*
*
* [Filters]
* TA::filter1 = min_max #first filter to use on the parameter TA
* TA::arg1 = 230 330 #arguments for this first filter
* TA::filter2 = rate #second filter to use (in chronological order)
* TA::arg2 = 0.01 #arguments for this second filter
* #add any extra filter that you want to use. They will be applied serially
*
*
* [Interpolations2D]
* TA::algorithms = IDW_LAPSE CST_LAPSE #list of algorithms to consider for use for spatially interpolating parameter TA
* TA::cst_lapse = -0.008 #parameter for a specific interpolation algorithm for parameter TA
......@@ -122,12 +124,12 @@
/**
* @page quick_overview Quick overview
* This library contains various classes that have been designed to deal with various sets of problems. This page shows the different sets of problems and what kind of functionnality the library offers to tackle them.
*
*
*
* @section iohandler_sec Data reading
* The class IOHandler provides the meteorological data from the sources selected by the user in its configuration file. This class inherits from IOInterface and is implemented through plugins that are responsible for implementing a given data access (see \ref dev_plugins "Plugins developer's guide" for more information). It therefore proposes a uniform, standardized access to the data that can be meteorological data, gridded data (including Digital Elevation Model (DEM) data or variations like for landuse codes) and tables of coordinates (for special processing at users selected locations). A buffered version of this class exists: BufferedIOHandler that should be prefered. The description of the plugins and their usage can be found in \ref plugins "Available plugins".
* This class also transparently calls the filtering class, FilterAlgorithms in order to filter the data according to the configuration of the user.
*
*
*
* @section meteo Meteorological data
* The data structures designed for storing meteorological data have been split into two classes: MeteoData and StationData.
......@@ -137,7 +139,7 @@
* The class StationData contains the metadata of a weather station, that is mostly its location. It supports the comparison operators.
* @subsection getmeteo_sec Getting the data
* The getMeteoData method defined in the IOHandler class provides a vector of MeteoData and StationData for the requested time step. More details are given in \ref iohandler_sec .
*
*
*
* @section arrays Arrays related functionnalities
* @subsection arrays_sec Arrays
......@@ -146,7 +148,7 @@
* Built on top of the arrays, defined as classes Grid2DObject and Grid3DObject, the grids add the geolocalization. This means that the coordinates of the lower-left corner of the array are stored as well as the cellsize. They can be built manually, or by providing an array. A subset constructor is available, allowing to extract a subset of the grid. It is also possible to get the lat/long (in WGS84) coordinates matching an (i,j) coordinate in the grid. Finally, It is possible to test for geolocalization equality (ie: do two grids have the same geolocalization).
* @subsection dem_sec Digital Elevation Models
* The last layer for gridded data is class DEMObject. Various parameters that are specific to Digital Elevation Models (DEM) are added: for each grid point, the slope, the azimuth, the curvature as well as the normal vector are defined (an optional parameter can be used to select the algorithm to be used). The minimums and maximums (over the grid) for each of these parameters are available. A subset of the DEM can be extracted using the subset constructor.
*
*
*
* @section proj_sec Geographic projections
* The class Coords is dedicated to geographic projections. It can use both internal algorithms and projections provided by <a href="http://trac.osgeo.org/proj/">libproj4</a>.
......@@ -154,7 +156,7 @@
* The class Coords takes one or two arguments describing the coordinate system of the input data and then converts back and forth with lat/long WGS84. It can be used to construct a local coordinate system, that is to say a metric grid whose origin is chosen by the user (through the lat/long parameters provided to the constructor). This is useful when working with multiple gridded coordinate system in order to get a common system that would still allow easy distances calculations. See the supported \ref Coordinate_types "projections".
* @subsection dist_sec Distances
* A few method used internally to work with custom, local grids are exposed to the user in order to easily compute distances beetwen points (using their lat/long). The algorithms can optionnaly be chosen (otherwise a default choice is used).
*
*
*
* @section interpol_sec Interpolations
* @subsection interpol2d_sec Spatial interpolations