#include <iostream>
#include "UALClasses.h"
using namespace IdsNs;
int main(int argc, char *argv[])
{
//Open the database
IDS imas(12, 2 IDS::core_profiles ids; // <= IDS object
const char* treename = "ids";
const char* database = "test";
int shot = 13;
int run = 22;
char* userName;
char* imasVersion;
// Gets user name and data version
userName = getenv("USER");
imasVersion = getenv("IMAS_VERSION");
//Open database
IdsNs::IDS imas(shot, run, -1, -1);
imas.open(openEnv(userName, database, imasVersion);
IDS::core_profiles ids = imas._core_profiles;
//Get the slice corresponding to the passed time
ids.getSlice(12.0, 2);
printf("Time %g",ids.time(0));
printf("Value: %g",ids.x.y(0));
cout << "Time: " << ids.time << endl;
cout << "Value: " << ids.global_quantities.ip << endl;
// Close the pulse file
imas.close();
} |