1.1.1. 3.3.1 Changes
CHEAT SHEET | |
ITM | IMAS |
---|---|
#include "UALClasses.h" | #include "UALClasses.h" |
using namespace ItmNs; | using namespace IdsNs; |
ItmNs::Itm itm(shot,run,refshot,refrun); | IdsNs::IDS imas(shot,run,refshot,refrun); |
ItmNs::Itm::<cpo_name>Array cpoArray | IdsNs::IDS::<ids_name> ids |
ItmNs::Itm::<cpo_name> cpo | IdsNs::IDS::<ids_name> ids |
1.1.2. 3.3.2 CPO/IDS put
put() CPO vs IDS | |
---|---|
ITM #include "UALClasses.h" using namespace ItmNs; int main(int argc, char *argv[]) { int number = 10; //number of elements //Create a new instance of database Itm itm(123, 1, 123, 1); itm.create(); Itm::equilibriumArray cpoArray = itm._equilibriumArray; // allocate the CPO structures cpoArray.array.resize(number); //Fill CPO fields for(int k = 0; k < number; k++) { cpoArray(k).x.y = VALUE; // Do not forget time!! cpoArray(k).time = TIME; } // Save data in the database cpoArray.put(); // Close the pulse file itm.close(); } | IMAS #include "UALClasses.h" using namespace IdsNs; int main(int argc, char *argv[]) { int number = 10; //number of elements //Create a new instance of database IDS imas(123, 1, 123, 1); imas.create(); IDS::core_profiles ids = imas._core_profiles; // Mandatory to define this property ids.ids_properties.homogeneous_time = 1; // allocate the CPO structures ids.time.resize(number); ids.global_quantities.ip.resize(number); // Fill IDS time-independent fields ids.ids_properties.comment = "IDS created by C++ PUT"; // Fill IDS time-dependent fields for(int i=0; i < number; i++) { ids.x.y(i) = VALUE(i) ; // Do not forget time!! ids.time(i) = TIME; } // Save data in the database ids.put(); // Close the pulse file imas.close(); } |
1.1.3. 3.3.3 CPO/IDS putSlice
putSlice() CPO vs IDS | |
---|---|
ITM #include "UALClasses.h" using namespace ItmNs; int main(int argc, char *argv[]) { //Create a new instance of database Itm itm(12, 2, -1, -1); itm.create(); Itm::pfsystems cpo = itm._pfsystems // Fill IDS time-independent fields cpo.datainfo.dataprovider.assign("USER"); cpo.putNonTimed(); // Fill IDS time-dependent fields cpo.x.y = VALUE; //Do not forget time!! cpo.time = TIME; // Save data in the database cpo.putSlice(); // Close the pulse file itm.close(); } | IMAS #include "UALClasses.h" using namespace IdsNs; int main(int argc, char *argv[]) { //Create a new instance of database IDS imas(12, 2, -1, -1); imas.create(); IDS::core_profiles ids = imas._core_profiles; //! Mandatory to define this property ids.ids_properties.homogeneous_time = 1; // Fill IDS time-independent fields ids.ids_properties.comment = "IDS created by C++ PUT"; ids.putNonTimed(); // Fill IDS time-dependent fields ids.global_quantities.ip.resize(1); ids.global_quantities.ip(0) = VALUE; // Do not forget time!! ids.time.resize(1); ids.time(0) = TIME; // Save data in the database ids.putSlice(); // Close the pulse file imas.close(); } |
1.1.4. 3.3.4 CPO/IDS get
get() CPO vs IDS | |
---|---|
ITM #include "UALClasses.h" using namespace ItmNs; int main(int argc, char *argv[]) { int number; //Open the database ItmNs::Itm itm(12, 2, 12, 2); itm.open(); //Open the database ItmNs::Itm::pfsystemsArray cpoArray = itm._pfsystemsArray; cpoArray.get(); number = cpoArray.array.extent(0); for(int i = 0; i < number; i++) { printf("Time: %g",cpoArray(i).time); printf("Value: %g",cpoArray(i).x.y); } itm.close(); } | IMAS #include "UALClasses.h" using namespace IdsNs; int main(int argc, char *argv[]) { int number; //Open the database IdsNs::IDS imas(12, 2, -1, -1); imas.open(); //Open the database IdsNs::IDS::core_profiles ids = imas._core_profiles; ids.get(); number = ids.time.extent(0); for (int j=0; j< number; j++) { printf("Time: %g",ids.time(j)); printf("Value: %g",ids.x.y(j)); } // Close the pulse file imas.close(); } |
1.1.5. 3.3.5 CPO/IDS getSlice
getSlice() CPO vs IDS | |
---|---|
ITM #include "UALClasses.h" using namespace ItmNs; int main(int argc, char *argv[]) { //Open the database ItmNs::Itm itm(123,2,123,1); itm.open(); Itm::pfsystems cpo = itm._pfsystems; //Get the slice corresponding to the passed time cpo.getSlice(1.0, 2); printf("Time %g ",cpo.time); printf("Value %g",cpo.x.y); // Close the pulse file itm.close(); } | IMAS #include "UALClasses.h" using namespace IdsNs; int main(int argc, char *argv[]) { //Open the database IDS imas(12, 2, -1, -1); imas.open(); IDS::core_profiles ids = imas._core_profiles; //Get the slice corresponding to the passed time ids.getSlice(1.0, 2); printf("Time %g",ids.time(0)); printf("Value: %g",ids.x.y(0)); // Close the pulse file imas.close(); } |