40 #include <drain/util/VariableFormatter.h>
41 #include <drain/util/ReferenceMap.h>
42 #include <drain/util/Rectangle.h>
43 #include <drain/util/Time.h>
44 #include <drain/image/Geometry.h>
49 #include "EncodingODIM.h"
86 ODIM_2_2 = 16 | KILOMETRES,
95 static VersionFlagger versionFlagger;
97 typedef std::set<std::string> nameSet;
100 const nameSet timeKeys;
103 const nameSet dateKeys;
106 const nameSet locationKeys;
116 ODIM(
const ODIM & odim) : NI(odim.NI){
184 std::string startdate;
185 std::string starttime;
191 std::vector<double> angles;
200 area.set(cols, rows);
236 return getTime(t, startdate, starttime);
242 return getTime(t, enddate, endtime);
249 bool setTime(
const std::string & s);
284 template <group_t G,
class T>
287 static const T odimLimited(G);
288 static const std::list<std::string> & keys = odimLimited.getKeyList();
290 odim.copyTo(keys, dst);
293 template <group_t G,
class T>
313 bool getTime(
drain::Time & t,
const std::string &dateStr,
const std::string &timeStr);
318 void copyTo(
const std::list<std::string> & keys, Hi5Tree & dst)
const;
323 void initFromMap(
const std::map<std::string,T> & m){
331 this->quantity = img.getProperties().
get(
"what:quantity",
"");
358 std::ostream & operator<<(std::ostream &ostr,
const ODIM & odim){
359 odim.drain::SmartMap<drain::Reference>::toStream(ostr);
Flagger accepting values of enum type E.
Definition: Flags.h:763
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
void updateFromMap(const std::map< std::string, T2 > &m)
Assign values from a map. Updates existing entries only.
Definition: SmartMap.h:294
std::string get(const std::string &key, const std::string &defaultValue) const
Retrieves a value, or default value if value is unset.
Definition: SmartMap.h:127
Utility for handling time. Internally, uses tm (C time structure).
Definition: Time.h:54
Policies for coordinate underflows and overflows.
Definition: CoordinatePolicy.h:106
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition: Image.h:184
Structure for data storage type, scaling and marker codes. Does not contain quantity.
Definition: EncodingODIM.h:75
EncodingODIM(group_t initialize=ODIMPathElem::ALL_LEVELS)
Default constructor.
Definition: EncodingODIM.h:99
void copyFrom(const drain::image::Image &data)
Copies image attributes and type . Experimental.
Definition: EncodingODIM.cpp:250
static const group_t ALL_LEVELS
Abbreviation for linking (referencing) attributes at different levels (tree depths).
Definition: ODIMPath.h:118
ODIM metadata (quantity, gain, offset, undetect, nodata, date, time)
Definition: ODIM.h:79
virtual void updateLenient(const ODIM &odim)
Updates object, quantity, product and time information.
Definition: ODIM.cpp:289
Version
Definition: ODIM.h:83
@ ODIM_2_3
Definition: ODIM.h:87
@ ODIM_2_4
Definition: ODIM.h:89
drain::Point2D< double > resolution
Spatial resolution in metres.
Definition: ODIM.h:156
virtual void adjustGeometry(size_t cols, size_t rows)
Change geometry and adjust spatial resolution respectively.
Definition: ODIM.cpp:279
virtual const drain::image::CoordinatePolicy & getCoordinatePolicy() const
Returns recommended coordinate policy. Redefined in PolarODIM.
Definition: ODIM.h:254
bool getTime(drain::Time &t) const
Retrieves the stored time. Returns true if successful. // consider: throws error if fail.
Definition: ODIM.h:229
virtual void setGeometry(size_t cols, size_t rows)
Sets number of columns (nbins) and number of rows (nrays). Does not change resolution.
Definition: ODIM.h:199
bool getStartTime(drain::Time &t) const
Retrieves the start time. Returns true if successful. // consider: throws error if fail.
Definition: ODIM.h:235
std::string object
Definition: ODIM.h:171
std::string date
Nominal time, in dateformat.
Definition: ODIM.h:175
static void updateH5AttributeGroups(const T &odim, Hi5Tree &dst)
Write ODIM metadata to WHAT, WHERE and HOW groups.
Definition: ODIM.h:286
bool distinguishNodata(const std::string &quantityPrefix="")
If nodata==undetect, set nodata=maxValue (hoping its not nodata...)
Definition: ODIM.cpp:97
static const std::string dateformat
Applied 8-digit date format, "%Y%m%d".
Definition: ODIM.h:162
std::string time
Nominal time, in timeformat.
Definition: ODIM.h:177
bool getEndTime(drain::Time &t) const
Retrieves the end time. Returns true if successful. // consider: throws error if fail.
Definition: ODIM.h:241
static const std::string timeformat
Applied 6-digit date format, "%H%M%S".
Definition: ODIM.h:166
bool setTime(const drain::Time &t)
Sets date and time . Returns true if successful, throws error if fail.
Definition: ODIM.cpp:231
std::string quantity
dataX/what (obligatory)
Definition: ODIM.h:181
Definition: DataSelector.cpp:44