10#ifndef SEIMS_PRINTINFO_H
11#define SEIMS_PRINTINFO_H
121 void Flush(
const string& projectPath, MongoGridFs* gfs,
IntRaster* templateRaster,
const string& header);
184 vector<int> m_subbasinSeleted;
186 int* m_subbasinSelectedArray;
189 PrintInfo(
int scenario_id = 0,
int calibration_id = -1);
222 void AddPrintItem(time_t start, time_t end,
const string& file,
const string& sufi);
225 void AddPrintItem(
string& type, time_t start, time_t end,
const string& file,
const string& sufi,
229 void AddPrintItem(time_t start, time_t end,
const string& file,
string sitename,
const string& sufi,
Class to store parameter item information.
@ AT_Unknown
unknown
Definition: PrintInfo.h:26
@ AT_Maximum
maximum
Definition: PrintInfo.h:30
@ AT_Minimum
minimum
Definition: PrintInfo.h:29
@ AT_SpecificCells
specific cells
Definition: PrintInfo.h:31
@ AT_Sum
sum
Definition: PrintInfo.h:27
@ AT_Average
average
Definition: PrintInfo.h:28
#define CVT_INT(param)
A reference to the postfix of executable file for RELWITHDEBINFO mode.
Definition: basic.h:325
Class to store and manage parameter information from the parameter database.
Definition: ParamInfo.h:37
void setIntervalUnits(string &units)
Set the interval units.
Definition: PrintInfo.h:216
FLTPT ** m_1DDataWithRowCol
Aggregated data, the second dimension contains: row, col, value.
Definition: PrintInfo.h:51
map< time_t, FLTPT > TimeSeriesData
For time series data of a single subbasin, DT_Single.
Definition: PrintInfo.h:62
void AddPrintItem(string &type, time_t start, time_t end, const string &file, const string &sufi, int subbasinID=0)
Add an output item with the given aggregate type, start time, end time, file name and subbasin ID.
void getSubbasinSelected(int *count, int **subbasins)
Get all the subbasin IDs (in float array) selected for this outputID.
void setStartTime(const time_t &st)
set start time time_t
Definition: PrintInfo.h:98
void AggregateData(time_t time, int numrows, FLTPT *data)
Aggregate the 1D data from the given data parameter using the given method type.
string Filename
output filename without suffix, and contain subbasin ID as prefix for MPI version
Definition: PrintInfo.h:116
int m_scenarioID
Scenario ID.
Definition: PrintInfo.h:166
string getOutputID() const
Get the OutputId for this object.
Definition: PrintInfo.h:204
void setInterval(int interval)
Set the interval.
Definition: PrintInfo.h:210
void AddPrintItem(time_t start, time_t end, const string &file, const string &sufi)
Add an output item with the given start time, end time and file name.
time_t getEndTime()
Get end time time_t.
Definition: PrintInfo.h:106
map< time_t, float * > TimeSeriesDataForRaster
For time series data of DT_Raster1D(output some .tif files. Distinct from TimeSeriesDataForSubbasin,...
Definition: PrintInfo.h:68
int SiteID
used only by PET_TS??? The site id
Definition: PrintInfo.h:80
void AggregateData(int numrows, FLTPT **data, AggregationType type, FLTPT NoDataValue)
Aggregate the 2D data from the given data parameter using the given method type.
void Flush(const string &projectPath, MongoGridFs *gfs, IntRaster *templateRaster, const string &header)
create "output" folder to store all results
int SiteIndex
The subbasin id.
Definition: PrintInfo.h:82
ParamInfo< FLTPT > * m_param
The calibration parameters corresponding to the output id, if stated.
Definition: PrintInfo.h:178
~PrintInfoItem()
Destructor.
map< time_t, FLTPT * > TimeSeriesDataForSubbasin
For time series data of a single subbasin, DT_Raster1D or DT_Array1D.
Definition: PrintInfo.h:64
void add1DTimeSeriesResult(time_t, int n, const FLTPT *data)
Add 1D time series data result to TimeSeriesDataForSubbasin.
PrintInfoItem(int scenario_id=0, int calibration_id=-1)
Constructor.
string Corename
output filename without suffix, core name without subbasin ID
Definition: PrintInfo.h:114
vector< PrintInfoItem * > m_PrintItems
For one OutputID, there may be several output items, e.g., different time period, different subbasin ...
Definition: PrintInfo.h:180
int TimeSeriesDataForSubbasinCount
Count of TimeSeriesDataForSubbasin.
Definition: PrintInfo.h:66
FLTPT ** m_2DData
For 2D raster/array data.
Definition: PrintInfo.h:59
string getIntervalUnits() const
Get the interval units.
Definition: PrintInfo.h:219
void AddPrintItem(time_t start, time_t end, const string &file, string sitename, const string &sufi, bool isSubbasin)
Add an output item with the given start time (string), end time (string) and file name,...
void add1DRasterTimeSeriesResult(time_t, int n, const float *data)
Add 1D time series data result to TimeSeriesDataForRaster.
time_t m_startTime
Start time time_t.
Definition: PrintInfo.h:92
int m_calibrationID
Calibration ID.
Definition: PrintInfo.h:168
int m_Interval
Time interval of output.
Definition: PrintInfo.h:170
int m_nLayers
number of layers of raster data, greater or equal than 1
Definition: PrintInfo.h:57
string m_OutputID
Unique Output ID, which should be one of "VAR_" defined in text.h and Output of any modules.
Definition: PrintInfo.h:176
FLTPT * m_1DData
For 1D raster/array data.
Definition: PrintInfo.h:55
time_t getStartTime()
get start time time_t
Definition: PrintInfo.h:95
string Suffix
file suffix, e.g., txt, tif, asc, etc.
Definition: PrintInfo.h:112
void setOutputID(string id)
Set the OutputID for this object.
Definition: PrintInfo.h:201
bool IsDateInRange(time_t dt)
Determine if the given date is within the date range for this item.
AggregationType getAggregationType()
Get the Aggregation type.
Definition: PrintInfo.h:141
void AggregateData2D(time_t time, int nRows, int nCols, FLTPT **data)
Aggregate the 2D raster data from the given data parameter using the given method type.
int m_moduleIndex
Module index of the OutputID.
Definition: PrintInfo.h:174
int TimeSeriesDataForRasterCount
Count of TimeSeriesDataForRaster.
Definition: PrintInfo.h:70
void setEndTime(const time_t &st)
set end time time_t
Definition: PrintInfo.h:109
int getInterval()
Get the interval.
Definition: PrintInfo.h:213
string AggType
Aggregation type string.
Definition: PrintInfo.h:118
time_t m_endTime
End time time_t.
Definition: PrintInfo.h:103
int m_nRows
rows number, i.e., number of valid cells
Definition: PrintInfo.h:53
PrintInfo(int scenario_id=0, int calibration_id=-1)
Constructor, initialize an empty instance.
void setAggregationType(const AggregationType type)
Set the Aggregation type.
Definition: PrintInfo.h:138
string getOutputTimeSeriesHeader()
Get Header string (all field names) for current OutputID. TODO, how to make it more flexible?...
PrintInfoItem * getPrintInfoItem(int index)
Get a reference to the output item located at the given index position.
int ItemCount() const
Get the number of output items.
Definition: PrintInfo.h:195
string m_IntervalUnits
Unit of time interval, which can only be DAY, HR, SEC.
Definition: PrintInfo.h:172
static AggregationType MatchAggregationType(const string &type)
convert the given string into a matching Aggregation type
int SubbasinID
The subbasin index.
Definition: PrintInfo.h:85
Outputs of one variable, which may contain one or more PrintInfoItem
Definition: PrintInfo.h:163
Class stores a single output item of an OuputID.
Definition: PrintInfo.h:42
AggregationType
Aggregation type for OUTPUT.
Definition: PrintInfo.h:25
Common Cross-platform Geographic Library (CCGL)
The SEIMS related definitions and utilities header.
#define IntRaster
Integer-typed raster.
Definition: seims.h:126