diff --git a/meteoio/spatialInterpolations/UserAlgorithm.cc b/meteoio/spatialInterpolations/UserAlgorithm.cc index ab6ea08f1abe7ada353d88bbde0efac03336e87f..8e1e68b19debd35af33a033c7a325bd399e170b6 100644 --- a/meteoio/spatialInterpolations/UserAlgorithm.cc +++ b/meteoio/spatialInterpolations/UserAlgorithm.cc @@ -24,20 +24,22 @@ namespace mio { USERInterpolation::USERInterpolation(const std::vector< std::pair >& vecArgs, const std::string& i_algo, const std::string& i_param, TimeSeriesManager& i_tsm, GridsManager& i_gdm) - : InterpolationAlgorithm(vecArgs, i_algo, i_param, i_tsm), gdm(i_gdm), filename(), grid2d_path(), subdir(), file_ext(), time_constant(false), lowest_priority(false) + : InterpolationAlgorithm(vecArgs, i_algo, i_param, i_tsm), gdm(i_gdm), filename(), grid2d_path(), subdir(), file_ext(), naming("YYYYMMDDhhmmss_PARAM"), time_constant(false), lowest_priority(false) { for (size_t ii=0; ii{numeric date with second resolution}_{capitalized meteo parameter}.{ext}, for example 20081201150000_TA.asc. - * But the following argument allows overriding this. + * - NAMING: provide file name template using YYYY for year, MM for month, DD for day, hh for hour, mm for minute, ss for second (optional) and PARAM for parameter name. + * Examples: + * - param::user::naming = YYYYMMDDhhmmss_PARAM (default) searches for files named: {numeric date with second resolution}_{capitalized meteo parameter}.{ext}, for example 20081201150000_TA.asc. + * - TA::user::naming = YYYY-MM-DDThh.mm_PARAM searches for files named 2008-12-01T15.00_TA.asc. * - TIME_CONSTANT: if true, use the same grid for all timesteps (default: false). If TIME_CONSTANT is set to true, files must be named according to: * {capitalized meteo parameter}.{ext}, for example TA.asc. - * + * * If no grid exists for a given timestamp and parameter, the algorithm returns a zero rating so any other interpolation algorithm can pickup * and provide a fallback. Therefore, it is not necessary to provide grids for all time steps but one can focuss on only the relevant and interesting * time steps. The following argument changes this behavior: @@ -54,6 +55,7 @@ namespace mio { * PSUM::algorithms = USER # read grids from GRID2DPATH/precip with the ".dat" extension * PSUM::user::subdir = precip * PSUM::user::ext = .dat + * PSUM::user::naming = YYYY-MM-DDThh.mm.ss_PARAM * * TSG::algorithms = USER # read grids from GRID2DPATH using the GRID2D plugin * TSG::user::ext = .asc @@ -70,7 +72,7 @@ class USERInterpolation : public InterpolationAlgorithm { std::string getGridFileName() const; GridsManager& gdm; std::string filename, grid2d_path; - std::string subdir, file_ext; + std::string subdir, file_ext, naming; bool time_constant, lowest_priority; };