Commit 1d4e1dcf authored by remi cresson's avatar remi cresson
Browse files

ENH: Input dates are ASCII file with dates in the YYYYMMDD format

parent 76116a67
......@@ -166,13 +166,13 @@ private:
AddParameter(ParameterType_InputImageList, "ndvits", "Input NDVI time series images");
// Input NDVI time series dates
AddParameter(ParameterType_StringList, "ndvidates", "Input NDVI time series dates (Must be dd/mm/yyyy format)");
AddParameter(ParameterType_InputFilename, "ndvidates", "Input NDVI time series dates ASCII file (Must be YYYYMMDD format)");
// Input rainfall time series images
AddParameter(ParameterType_InputImageList, "rainfts", "Input rainfall time series images");
// Input rainfall time series dates
AddParameter(ParameterType_StringList, "rainfdates", "Input rainfall time series dates (Must be dd/mm/yyyy format)");
AddParameter(ParameterType_StringList, "rainfdates", "Input rainfall time series dates (Must be YYYYMMDD format)");
// Parameter group for NDVI time series
AddParameter(ParameterType_Group, "ndvi", "NDVI Time series");
......@@ -256,14 +256,16 @@ private:
}
/*
* Retrieve the dates (numeric) from the input dates (string) dd/mm/yyyy
* Retrieve the dates (numeric) from the input dates (string)
* Input dates (string) must be formated using the following pattern: YYYYMMDD
*/
std::vector<DateType> GetTimeSeriesDates(std::string key){
std::vector<std::string> list = this->GetParameterStringList(key);
std::vector<DateType> dates = otb::dates::GetDatesFromStringVector(list);
otbAppLogINFO("Using " << dates.size() << " input dates from " << list[0] << " to " << list[list.size()-1] );
std::vector<DateType> dates = otb::dates::GetDatesFromFile(key);
unsigned int n = dates.size() - 1;
otbAppLogINFO("Using " << dates.size() << " input dates from "
<< dates[0].year << "/" << dates[0].month << "/" << dates[0].day << " to "
<< dates[n].year << "/" << dates[n].month << "/" << dates[n].day );
return dates;
}
......
Markdown is supported
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