meteo-vm2  2.0.11
VM2 value file

Format of a VM2 file and how to read it

A VM2 file contains a list of values in CSV format with the following columns:

  • REFTIME: reference time (YYYYmmddHHMM or YYYYmmddHHMMSS) in UTC
  • STATION ID: integer
  • VARIABLE ID id: integer
  • VALUE 1: double (empty if missing)
  • VALUE 2: double (empty if missing)
  • VALUE 3: string (without comma)
  • FLAGS: string (without comma)

E.g.

201201010000,1,2,4.56,7.8,X,000000000
201201010030,1,2,12.0,9.4,X,000000000
20120101003045,1,2,12.0,9.4,X,000000000

Read VM2 values from stdin

meteo::vm2::Parser parser(std::cin);
while (parser.next(value)) {
// ...
}

Serialize a VM2 file

// Populate the value
value.year = 2012;
value.month = 1;
// ...
value.station_id = 123;
// ...
// Serialize
static void serialize(std::ostream &out, const Value &value)
Serialize a value.
Definition: parser.cc:151