#include <iostream>
int main(int argc, char* argv[])
{
if (argc != 2)
{
std::cout << "Usage: " << argv[0] << " <odimh5file>" << std::endl;
return -1;
}
std::set<std::string> quantities;
try
{
volume->
getHow()->
set(
"attributo intero inventato", (
int)100);
volume->
getHow()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int s=0; s<10; s++)
{
const int NUMBINS = 1;
const int NUMRAYS = 1;
scan->
getWhat()->
set(
"attributo intero inventato", (
int)100);
scan->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (std::set<std::string>::iterator i=quantities.begin(); i!=quantities.end(); i++)
{
std::string quantityName = *i;
data->
getWhat()->
set(
"attributo intero inventato", (
int)100);
data->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int i=0; i<NUMRAYS; i++)
for (int j=0; j<NUMBINS; j++)
matrixW.
elem(i,j) = 65 + ((i * j) % 120);
delete data;
double offset = 123.456;
double gain = (NUMRAYS * NUMBINS * 0.5 - offset) / 256.;
data2->
getWhat()->
set(
"attributo intero inventato", (
int)100);
data2->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int i=0; i<NUMRAYS; i++)
for (int j=0; j<NUMBINS; j++)
matrixV.
elem(i,j) = (float)(i * j * 0.5 + offset);
data2->
writeAndTranslate(matrixV, (
float)offset, (float)gain, H5::PredType::NATIVE_UINT8);
delete data2;
}
delete scan;
}
std::cout << "Esecuzione terminata" << std::endl;
}
catch (std::exception& stde)
{
std::cerr << "Errore di esecuzione: " << stde.what() << std::endl;
}
catch (...)
{
std::cerr << "Errore sconociuto" << std::endl;
}
delete dumper;
delete volume;
delete factory;
return 0;
}
T & elem(const int r, const int b)
Reference to the element (r,b)
Definition odimh5v20_support.hpp:573
virtual MetadataGroup * getWhat()
Get the WHAT attributes group.
Definition odimh5v20_classes.cpp:480
virtual void writeData(const void *buff, int width, int height, const H5::DataType &elemtype)
Write data to the matrix associated to this 'data' group.
Definition odimh5v20_classes.cpp:584
virtual MetadataGroup * getWhat()
Get the WHAT attributes group.
Definition odimh5v20_classes.cpp:347
OdimH5 objects factory.
Definition odimh5v20_factory.hpp:50
virtual PolarVolume * createPolarVolume(const std::string &path)
Create a new OdimH5 PVOL object and the associated file.
Definition odimh5v20_factory.cpp:165
OdimH5 object dumper.
Definition odimh5v20_dump.hpp:52
virtual void setDateTime(const time_t val)
Set the value of 'date' and 'time' attributes.
Definition odimh5v20_classes.cpp:297
virtual MetadataGroup * getHow()
Get the HOW attributes group.
Definition odimh5v20_classes.cpp:186
virtual void setSource(const SourceInfo &val)
Set the value of 'source' attribute.
Definition odimh5v20_classes.cpp:299
OdimH5 v2.0 SCAN quantity data.
Definition odimh5v20_classes.hpp:1272
virtual void setNodata(double val)
Set the value of 'nodata' attribute.
Definition odimh5v20_classes.cpp:1798
virtual void writeAndTranslate(RayMatrix< float > &matrix, float offset, float gain, H5::DataType type)
Write the given matrix of data into the quantity matrix.
Definition odimh5v20_classes.cpp:1903
virtual void setGain(double val)
Set the value of 'gain' attribute.
Definition odimh5v20_classes.cpp:1794
virtual void setOffset(double val)
Set the value of 'offset' attribute.
Definition odimh5v20_classes.cpp:1796
virtual void setUndetect(double val)
Set the value of 'undetect' attribute.
Definition odimh5v20_classes.cpp:1800
OdimH5 v2.0 Polar Volume SCAN.
Definition odimh5v20_classes.hpp:989
virtual PolarScanData * createQuantityData(const char *name)
Create a new group for a quantity in the scan.
Definition odimh5v20_classes.cpp:1621
virtual void setRangeStart(double val)
Set the 'rstart' attribute value.
Definition odimh5v20_classes.cpp:1380
virtual void setBeamWidth(double val)
Set the 'beamwidth' attribute value.
Definition odimh5v20_classes.cpp:1417
virtual void setEndDateTime(time_t val)
Set the value of 'enddate' and 'endtime' attributes.
Definition odimh5v20_classes.cpp:1354
virtual void setRangeScale(double val)
Set the 'rscale' attribute value.
Definition odimh5v20_classes.cpp:1382
virtual void setRPM(double val)
Get the 'rpm' attribute value.
Definition odimh5v20_classes.cpp:1423
virtual void setRadarHorizon(double val)
Set the 'radhoriz' attribute value.
Definition odimh5v20_classes.cpp:1555
virtual void setStartDateTime(time_t val)
Set the value of 'startdate' and 'starttime' attributes.
Definition odimh5v20_classes.cpp:1352
virtual void setLowPRF(int val)
Get the 'lowprf' attribute value.
Definition odimh5v20_classes.cpp:1429
virtual void setHighPRF(int val)
Get the 'highprf' attribute value.
Definition odimh5v20_classes.cpp:1432
virtual void setNumRays(int val)
Set the 'numrays' attribute value.
Definition odimh5v20_classes.cpp:1384
virtual void setWaveLength(double val)
Get the 'wavelength' attribute value.
Definition odimh5v20_classes.cpp:1420
virtual void setA1Gate(int val)
Set the 'a1gate' attribute value.
Definition odimh5v20_classes.cpp:1386
virtual void setEAngle(double val)
Set the 'elangle' attribute value.
Definition odimh5v20_classes.cpp:1376
virtual void setNumBins(int val)
Set the 'numbins' attribute value.
Definition odimh5v20_classes.cpp:1378
OdimH5 v2.0 Polar Volume.
Definition odimh5v20_classes.hpp:846
virtual void setStartEpochs(time_t val)
Set the 'startepochs' attribute value.
Definition odimh5v20_classes.cpp:1025
virtual void setSoftwareVer(const std::string &val)
Set the 'sw_version' attribute value.
Definition odimh5v20_classes.cpp:1033
virtual void setSimulated(bool val)
Set the 'simulated' attribute value.
Definition odimh5v20_classes.cpp:1043
virtual void setSystem(const std::string &val)
Set the 'system' attribute value.
Definition odimh5v20_classes.cpp:1029
virtual void setKR_B(double val)
Set the 'kr_b' attribute value.
Definition odimh5v20_classes.cpp:1041
virtual void setKR_A(double val)
Set the 'kr_a' attribute value.
Definition odimh5v20_classes.cpp:1039
virtual void setSoftware(const std::string &val)
Set the 'software' attribute value.
Definition odimh5v20_classes.cpp:1031
virtual void setLongitude(double val)
Set the value of 'longitude' attribute.
Definition odimh5v20_classes.cpp:1016
virtual void setTaskOrProdGen(const std::string &val)
Set the 'task' attribute value.
Definition odimh5v20_classes.cpp:1023
virtual PolarScan * createScan()
Create a new scan in this volume.
Definition odimh5v20_classes.cpp:1080
virtual void setAltitude(double val)
Set the value of 'altitude' attribute.
Definition odimh5v20_classes.cpp:1020
virtual void setLatitude(double val)
Set the value of 'latitude' attribute.
Definition odimh5v20_classes.cpp:1018
virtual void setZR_B(double val)
Set the 'zr_b' attribute value.
Definition odimh5v20_classes.cpp:1037
virtual void setEndEpochs(time_t val)
Set the 'endepochs' attribute value.
Definition odimh5v20_classes.cpp:1027
virtual void setZR_A(double val)
Set the 'zr_a' attribute value.
Definition odimh5v20_classes.cpp:1035
OdimH5 rays matrix.
Definition odimh5v20_support.hpp:616
OdimH5 object source informations.
Definition odimh5v20_support.hpp:111
SourceInfo & setPlace(const std::string &value)
Set Place value and return a reference to this object.
Definition odimh5v20_support.hpp:199
SourceInfo & setWMO(const std::string &value)
Set WMO value and return a reference to this object.
Definition odimh5v20_support.hpp:172
SourceInfo & setCountry(int value)
Set Country value and return a reference to this object.
Definition odimh5v20_support.hpp:208
SourceInfo & setOperaRadarSite(const std::string &value)
Set OperaRadarSite value and return a reference to this object.
Definition odimh5v20_support.hpp:181
SourceInfo & setOriginatingCenter(int value)
Set OriginatingCenter value and return a reference to this object.
Definition odimh5v20_support.hpp:190
SourceInfo & setComment(const std::string &value)
Set Comment value and return a reference to this object.
Definition odimh5v20_support.hpp:217
static void getStandardQuantities(std::set< std::string > &names)
Gets the names of standard quantities.
Definition odimh5v20_const.cpp:479
static void checkVersion()
Check the library version.
Definition lib.hpp:76
Namespace related to ODIMH5 version 2.0.
Definition odimh5v20.hpp:46
time_t mktime(int year, int month, int day)
Create a time from a date.
Definition time.cpp:110
Main header file of the library.