diff --git a/Bin.py/makeRequest.py b/Bin.py/makeRequest.py
index bb50d72..126f458 100644
--- a/Bin.py/makeRequest.py
+++ b/Bin.py/makeRequest.py
@@ -64,9 +64,9 @@ def writeXMLMission(XMLfilename,startTime,stopTime,plasmaVI,tgtVI,tgtRParam,tgtL
xml.write('\t'+startTime+'\n')
xml.write('\t'+stopTime+'\n')
xml.write('\t'+plasmaVI+'\n')
- xml.write('\tearth_orb_all\n')
- xml.write('\tR\n')
- xml.write('\tLON_HCI\n')
+ xml.write('\t'+srcVI+'\n')
+ xml.write('\t'+srcRParam+'\n')
+ xml.write('\t'+srcLonParam+'\n')
xml.write('\t'+tgtVI+'\n')
xml.write('\t'+tgtRParam+'\n')
xml.write('\t'+tgtLonParam+'\n')
@@ -75,12 +75,18 @@ def writeXMLMission(XMLfilename,startTime,stopTime,plasmaVI,tgtVI,tgtRParam,tgtL
# In[8]:
-
-tgtRParam = 'R_HCI'
-if tgtVI == 'p67_orb_all':
- tgtRParam = 'R'
+if plasmaVI == 'sta_l2_pla' :
+ srcVI = 'sta_l2_orb'
+elif plasmaVI == 'stb_l2_pla' :
+ srcVI = 'stb_l2_orb'
+else :
+ srcVI = 'earth_orb_all'
+srcRParam = 'R_HCI'
+srcLonParam = 'LON_HCI'
+tgtRParam = 'R_HCI'
tgtLonParam = 'LON_HCI'
+
newMissionStart = missionStopTime
newMissionStop = omniStopTime
print "New mission start : " + newMissionStart.isoformat()
@@ -93,7 +99,7 @@ else:
print "Database has to be updated"
if newMissionStart.year != newMissionStop.year and plasmaVI != 'ace_swepam_real':
- print "2 files will be producted"
+ print "2 files will be produced"
newMissionxml1Start = datetime(newMissionStart.year,1,1,0,0)
newMissionxml1Stop = datetime(newMissionStop.year,1,1,0,0)
newMissionxml2Start = datetime(newMissionStop.year,1,1,0,0)
@@ -102,12 +108,12 @@ if newMissionStart.year != newMissionStop.year and plasmaVI != 'ace_swepam_real'
print 'XML 1 Stop : ' + newMissionxml1Stop.isoformat()
print 'XML 2 Start : ' + newMissionxml2Start.isoformat()
print 'XML 2 Stop : ' + newMissionxml2Stop.isoformat()
- XMLfilename = prefix+'_'+str(newMissionxml1Start.year)+'.xml'
+ XMLfilename = prefix + '_' + str(newMissionxml1Start.year) + '.xml'
writeXMLMission(XMLfilename,newMissionxml1Start.isoformat(),newMissionxml1Stop.isoformat(),plasmaVI,tgtVI,tgtRParam,tgtLonParam)
- XMLfilename = prefix+'_'+str(newMissionxml2Start.year)+'.xml'
+ XMLfilename = prefix + '_' + str(newMissionxml2Start.year) + '.xml'
writeXMLMission(XMLfilename,newMissionxml2Start.isoformat(),newMissionxml2Stop.isoformat(),plasmaVI,tgtVI,tgtRParam,tgtLonParam)
else:
- print "1 file will be producted"
+ print "1 file will be produced"
if plasmaVI == "ace_swepam_real":
newMissionxmlStart = datetime(newMissionStart.year,newMissionStart.month,newMissionStart.day,0,0)
# Future !!!
@@ -119,5 +125,5 @@ else:
print 'XML Start : ' + newMissionxmlStart.isoformat()
print 'XML Stop : ' + newMissionxmlStop.isoformat()
- XMLfilename = prefix+'_'+str(newMissionxmlStart.year)+'.xml'
+ XMLfilename = prefix + '_' + str(newMissionxmlStart.year) + '.xml'
writeXMLMission(XMLfilename,newMissionxmlStart.isoformat(),newMissionxmlStop.isoformat(),plasmaVI,tgtVI,tgtRParam,tgtLonParam)
diff --git a/Bin.py/run.py b/Bin.py/run.py
index 0a53726..d65409f 100755
--- a/Bin.py/run.py
+++ b/Bin.py/run.py
@@ -74,6 +74,8 @@ def main():
# if run run.py 'alone' - for previous years
#plasmaStop = shiftedDate(stop, days=marginPlasma)
#plasmaStop = shiftedDate(swStop)
+ print plasmaStop
+
plasmaDDStop = time2ddtime(plasmaStop)
ddTimeDeltaPlasma = DDTimeDelta(plasmaStart, plasmaStop)
@@ -85,10 +87,16 @@ def main():
# GET DATA FROM DD BASE DEPENDING ON SW INPUT
if plasmaVi == 'omni_hour_all':
- plasmaCmd = ['get_OMNI_1H',MYDIR+'/plasma.csv',plasmaDDStart,ddTimeDeltaPlasma]
+ plasmaCmd = ['get_OMNI_1H',MYDIR + '/plasma.csv',plasmaDDStart,ddTimeDeltaPlasma]
elif plasmaVi == 'ace_swepam_real':
- plasmaCmd = ['get_ACE_RT',MYDIR+'/plasma.csv',MYDIR+'/mag.csv',plasmaDDStart,ddTimeDeltaPlasma]
-
+ plasmaCmd = ['get_ACE_RT',MYDIR + '/plasma.csv',MYDIR + '/mag.csv',plasmaDDStart,ddTimeDeltaPlasma]
+ elif plasmaVi == 'sta_l2_pla':
+ plasmaCmd = ['get_STEREO','a',MYDIR + '/plasma.csv',MYDIR + '/mag.csv',plasmaDDStart,ddTimeDeltaPlasma]
+ elif plasmaVi == 'stb_l2_pla':
+ plasmaCmd = ['get_STEREO','b',MYDIR + '/plasma.csv',MYDIR + '/mag.csv',plasmaDDStart,ddTimeDeltaPlasma]
+ elif plasmaVi == 'dsc_fc_1m':
+ plasmaCmd = ['get_DSCOVR', MYDIR + '/plasma.csv',MYDIR + '/mag.csv',plasmaDDStart,ddTimeDeltaPlasma]
+
print plasmaCmd
srcCmd = ['get_R_LON_HCI',MYDIR+'/source.csv',srcVi,srcR,srcLon,orbitsDDStart,ddTimeDeltaOrbit]
tgtCmd = ['get_R_LON_HCI',MYDIR+'/target.csv',tgtVi,tgtR,tgtLon,orbitsDDStart,ddTimeDeltaOrbit]
@@ -108,7 +116,7 @@ def main():
# PLASMA DATAFRAME
if plasmaVi == 'omni_hour_all':
- plasma = pd.read_csv(MYDIR+'/plasma.csv', dtype='S16,f4,f4,f4,f4,f4,f4,f4,f4')
+ plasma = pd.read_csv(MYDIR + '/plasma.csv', dtype='S16,f4,f4,f4,f4,f4,f4,f4,f4')
elif plasmaVi == 'ace_swepam_real':
if os.path.getsize(MYDIR+'/mag.csv') == 0:
logger.error('Failed to load mag data')
@@ -116,11 +124,17 @@ def main():
sw = pd.read_csv(MYDIR+'/plasma.csv', dtype='S16,f4,f4,f4')
mag = pd.read_csv(MYDIR+'/mag.csv', dtype='S16,f4,f4,f4')
plasma = sw.merge(mag, on='Time')
+ elif plasmaVi == 'sta_l2_pla' or plasmaVi == 'stb_l2_pla' or plasmaVi == 'dsc_fc_1m':
+ if os.path.getsize(MYDIR+'/mag.csv') == 0:
+ logger.error('Failed to load mag data')
+ sys.exit(2)
+ sw = pd.read_csv(MYDIR+'/plasma.csv', dtype='S16,f4,f4,f4,f4,f4')
+ mag = pd.read_csv(MYDIR+'/mag.csv', dtype='S16,f4,f4,f4')
+ plasma = sw.merge(mag, on='Time')
plasma['Time'] = ddTime2Datetime(plasma['Time'])
plasma = plasma.set_index('Time')
-
-
+
logger.info('Number of NaNs for plasma data before cleaning : %d' % plasma.isnull().sum().sum())
plasma = plasma.interpolate().fillna(method='bfill')
logger.info('Number of NaNs for plasma data after cleaning : %d' % plasma.isnull().sum().sum())
@@ -157,18 +171,31 @@ def main():
target = pd.DataFrame(data=targetData,columns=targetColumns)
target = target.set_index('Time')
-
- # SPHERICAL TO CARTESIAN COORDS
- if plasmaVi == 'omni_hour_all':
- vlon = np.radians(plasma['Vlon'])
- vlat = np.radians(plasma['Vlat'])
- elif plasmaVi == 'ace_swepam_real':
- vlon = np.radians(-2.0)
- vlat = np.radians(1.0)
+ # TAO frame : RTN with t=-t
+ if plasmaVi == 'sta_l2_pla' or plasmaVi == 'stb_l2_pla' :
+ vx = plasma['Vr']
+ vy = -plasma['Vt']
+ vz = plasma['Vn']
+ temperature = plasma['Vth']*plasma['Vth']*60.6 # v=sqrt(2kT/m)
+ elif plasmaVi == 'dsc_fc_1m':
+ vx = -plasma['Vx']
+ vy = -plasma['Vy']
+ vz = plasma['Vz']
+ temperature = plasma.Temperature
+ else :
+ # SPHERICAL TO CARTESIAN COORDS
+ if plasmaVi == 'omni_hour_all':
+ vlon = np.radians(plasma['Vlon'])
+ vlat = np.radians(plasma['Vlat'])
+ elif plasmaVi == 'ace_swepam_real':
+ vlon = np.radians(-2.0)
+ vlat = np.radians(1.0)
+
+ vx = plasma['V']*np.cos(vlat)*np.cos(vlon)
+ vy = -plasma['V']*np.cos(vlat)*np.sin(vlon)
+ vz = plasma['V']*np.sin(vlat)
- vx = plasma['V']*np.cos(vlat)*np.cos(vlon)
- vy = -plasma['V']*np.cos(vlat)*np.sin(vlon)
- vz = plasma['V']*np.sin(vlat)
+ temperature = plasma.Temperature
# ROTATION
bx = -np.array(plasma['Bx'])
@@ -176,7 +203,7 @@ def main():
bz = np.array(plasma['Bz'])
# FINAL PLASMA DATAFRAME
- plasmaData = np.array([plasma.index,plasma.Density,plasma.Temperature,vx,vy,vz,bx,by,bz])
+ plasmaData = np.array([plasma.index,plasma.Density,temperature,vx,vy,vz,bx,by,bz])
plasmaColumns = ['Time','Density','Temperature','Vx','Vy','Vz','Bx','By','Bz']
plasma = pd.DataFrame(data=plasmaData.T,columns=plasmaColumns)
plasma = plasma.set_index('Time')
diff --git a/Sources/Makefile b/Sources/Makefile
index 2772ffd..9c3f27b 100755
--- a/Sources/Makefile
+++ b/Sources/Makefile
@@ -9,7 +9,7 @@ INCLUDE = -I${DD_DIR}/include/DDClientLibC -I${TINYDIR}/include
LIB = -L${DD_DIR}/lib -L${TINYDIR}/lib
LKLIBS = -lDDClientLibC -ltinyxml -lnetcdf -lm
LDFLAGS = -fPIC
-EXE = get_Orbit get_OMNI_1H get_ACE_RT get_R_LON_HCI
+EXE = get_Orbit get_OMNI_1H get_ACE_RT get_STEREO get_DSCOVR get_R_LON_HCI
# ********************* END OF COMPILER SETTINGS *****************************
# ******************************** LINKING *********************************
@@ -26,6 +26,12 @@ get_OMNI_1H: get_OMNI_1H.o
get_ACE_RT: get_ACE_RT.o
${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
+get_STEREO: get_STEREO.o
+ ${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
+
+get_DSCOVR: get_DSCOVR.o
+ ${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
+
get_R_LON_HCI: get_R_LON_HCI.o
${CXX} -o $@ $^ ${LDFLAGS} ${LIB} ${LKLIBS}
# ************************** END OF LINKING *********************************
@@ -38,8 +44,14 @@ get_OMNI_1H.o: get_OMNI_1H.cpp
${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
get_ACE_RT.o: get_ACE_RT.cpp
- ${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
-
+ ${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
+
+get_STEREO.o: get_STEREO.cpp
+ ${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
+
+get_DSCOVR.o: get_DSCOVR.cpp
+ ${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
+
get_R_LON_HCI.o: get_R_LON_HCI.cpp
${CXX} -c $< -o $@ ${INCLUDE} ${CXXFLAGS}
# ************************* END OF COMPILING ********************************
diff --git a/Sources/get_ACE_RT.cpp b/Sources/get_ACE_RT.cpp
index 21140c4..d06a0a6 100644
--- a/Sources/get_ACE_RT.cpp
+++ b/Sources/get_ACE_RT.cpp
@@ -15,12 +15,12 @@
///////////////
using namespace std;
-int main(int argc, char const *argv[])
+int main (int argc, char const *argv[]) throw(std::string)
{
if (argc != 5)
{
- cout << "[ERROR] Usage : ./get_ACE_RT (plasma filename) (mag filename) (ddStart) (ddInterval)" << endl;
- exit(EXIT_FAILURE);
+ cout << "[ERROR] Usage : ./get_ACE_RT (plasma filename) (mag filename) (ddStart) (ddInterval)" << endl;
+ exit(EXIT_FAILURE);
}
string dataFilename = argv[1];
@@ -50,14 +50,16 @@ int main(int argc, char const *argv[])
if (error < 0)
{
std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime SW -> err value : " + error;
- throw std::string(ddSetTimeErr);
+ printf(" bad time pointer plasma %d %d\n", id_sw, error);
+ throw ddSetTimeErr;
}
error = DD_SetTime(id_mag, st);
if (error < 0)
{
std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime Mag -> err value : " + error;
- throw std::string(ddSetTimeErr);
+ printf(" bad time pointer mag %d\n", error);
+ throw ddSetTimeErr;
}
// GET DATA
char *params[4];
@@ -76,7 +78,7 @@ int main(int argc, char const *argv[])
DD_data_t *data;
int status = 0;
-
+
plasmaFile << "Time,Density,Temperature,V" << endl;
do {
diff --git a/Sources/get_DSCOVR.cpp b/Sources/get_DSCOVR.cpp
new file mode 100644
index 0000000..e424695
--- /dev/null
+++ b/Sources/get_DSCOVR.cpp
@@ -0,0 +1,155 @@
+/////////////////
+// CPP HEADERS //
+/////////////////
+#include
+#include
+#include
+
+////////////
+/// DDLIB //
+////////////
+#include "DD.h"
+
+#define NAN (0.0/0.0)
+////////////////
+// NAMESPACES //
+///////////////
+using namespace std;
+
+int main (int argc, char const *argv[]) throw(std::string)
+{
+ if (argc != 5)
+ {
+ cout << "[ERROR] Usage : ./get_DSCOVR (plasma filename) (mag filename) (ddStart) (ddInterval)" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ string dataFilename = argv[1];
+ string dataFilename1 = argv[2];
+ string ddStart = argv[3];
+ string ddInterval = argv[4];
+ string plasmaVi = "dsc_fc_1m";
+ string timeParameter = "Time";
+ string DensParameter = "proton_density";
+ string TempParameter = "proton_temperature";
+ string VNormParameter = "vp_gse";
+ string magVi = "dsc_mag_1m";
+ string magParameter = "b_gse";
+
+ ofstream plasmaFile(dataFilename.c_str(), ios::out);
+ ofstream magFile(dataFilename1.c_str(), ios::out);
+
+ int id_sw = DD_SetVariable( const_cast( plasmaVi.c_str() ) );
+ int id_mag = DD_SetVariable( const_cast( magVi.c_str() ) );
+
+ char *st = const_cast( ddStart.c_str() );
+
+ int error = DD_SetTime(id_sw, st);
+
+ if (error < 0)
+ {
+ std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime SW -> err value : " + error;
+ printf(" bad time pointer plasma %d %d\n", id_sw, error);
+ throw ddSetTimeErr;
+ }
+ error = DD_SetTime(id_mag, st);
+
+ if (error < 0)
+ {
+ std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime Mag -> err value : " + error;
+ printf(" bad time pointer mag %d\n", error);
+ throw ddSetTimeErr;
+ }
+ // GET DATA
+ char *params[4];
+
+ params[0] = const_cast( timeParameter.c_str() );
+ params[1] = const_cast( DensParameter.c_str() );
+ params[2] = const_cast( TempParameter.c_str() );
+ params[3] = const_cast( VNormParameter.c_str() );
+
+ char *params_mag[2];
+ params_mag[0] = const_cast( timeParameter.c_str() );
+ params_mag[1] = const_cast( magParameter.c_str() );
+
+ char *timeIntervall = const_cast( ddInterval.c_str() );
+
+ DD_data_t *data;
+
+ int status = 0;
+
+ plasmaFile << "Time,Density,Temperature,Vx,Vy,Vz" << endl;
+
+ do {
+
+ status = DD_GetMultiData(id_sw, 4, static_cast(params), timeIntervall, &data, 1);
+
+ if (status < 0)
+ {
+ std::string ddGetDataErr = "[ERROR] Failed to get SW data -> status : " + status;
+ throw std::string(ddGetDataErr);
+ }
+
+ for (int j = 0; j < data->VarNumber; ++j)
+ {
+ float density = *(static_cast(data[1].Variables[j]));
+ if (density < -1000.) density = NAN;
+ float temperature = *(static_cast(data[2].Variables[j]));
+ if (temperature < -1000.) temperature = NAN;
+ float vx = static_cast(data[3].Variables[j])[0];
+ float vy = static_cast(data[3].Variables[j])[1];
+ float vz = static_cast(data[3].Variables[j])[2];
+ if (vx < -9000.) {
+ vx = NAN; vy = NAN; vz = NAN;
+ }
+ plasmaFile << static_cast(data[0].Variables[j]) << ","
+ << density << ","
+ << temperature << ","
+ << vx << ","
+ << vy << ","
+ << vz << endl;
+ }
+
+ } while (status == MOREDATA);
+
+ DD_Close(id_sw);
+
+ status = 0;
+
+ magFile << "Time,Bx,By,Bz" << endl;
+
+ do {
+
+ status = DD_GetMultiData(id_mag, 2, static_cast(params_mag), timeIntervall, &data, 1);
+
+ if (status < 0)
+ {
+ std::string ddGetDataErr = "[ERROR] Failed to get MAG data -> status : " + status;
+ throw std::string(ddGetDataErr);
+ }
+
+ for (int j = 0; j < data->VarNumber; ++j)
+ {
+ float bx = static_cast(data[1].Variables[j])[0];
+ float by = static_cast(data[1].Variables[j])[1];
+ float bz = static_cast(data[1].Variables[j])[2];
+ if (bx < -9000.) {
+ bx = NAN; by = NAN; bz = NAN;
+ }
+ magFile << static_cast(data[0].Variables[j]) << ","
+ << bx << ","
+ << by << ","
+ << bz << endl;
+ }
+
+ } while (status == MOREDATA);
+
+
+ DD_Close(id_mag);
+
+ plasmaFile.close();
+
+ magFile.close();
+
+ return 0;
+}
\ No newline at end of file
diff --git a/Sources/get_STEREO.cpp b/Sources/get_STEREO.cpp
new file mode 100644
index 0000000..b38c6d1
--- /dev/null
+++ b/Sources/get_STEREO.cpp
@@ -0,0 +1,145 @@
+/////////////////
+// CPP HEADERS //
+/////////////////
+#include
+#include
+#include
+#include
+
+////////////
+/// DDLIB //
+////////////
+#include "DD.h"
+
+////////////////
+// NAMESPACES //
+///////////////
+using namespace std;
+
+int main (int argc, char const *argv[]) throw(std::string)
+{
+ if (argc != 6)
+ {
+ cout << "[ERROR] Usage : ./get_STEREO [a,b] (plasma filename) (mag filename) (ddStart) (ddInterval)" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ string stereo = argv[1];
+ string dataFilename = argv[2];
+ string dataFilename1 = argv[3];
+ string ddStart = argv[4];
+ string ddInterval = argv[5];
+
+ string plasmaVi = "sta_l2_pla";
+ string timeParameter = "Time";
+ string DensParameter = "Np";
+ string TempParameter = "Vth";
+ string VNormParameter = "Vrtn";
+ string magVi = "sta_mag_mag";
+ string magParameter = "B";
+
+ ofstream plasmaFile(dataFilename.c_str(), ios::out);
+ ofstream magFile(dataFilename1.c_str(), ios::out);
+
+ memcpy(&(plasmaVi[2]),argv[1],1);
+ memcpy(&(magVi[2]),argv[1],1);
+
+ printf("PlasmaVi %s\n", plasmaVi.c_str());
+ int id_sw = DD_SetVariable( const_cast( plasmaVi.c_str() ) );
+ int id_mag = DD_SetVariable( const_cast( magVi.c_str() ) );
+
+ char *st = const_cast( ddStart.c_str() );
+
+ int error = DD_SetTime(id_sw, st);
+
+ if (error < 0)
+ {
+ std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime SW -> err value : " + error;
+ printf(" bad time pointer plasma %d %d\n", id_sw, error);
+ throw ddSetTimeErr;
+ }
+ error = DD_SetTime(id_mag, st);
+
+ if (error < 0)
+ {
+ std::string ddSetTimeErr = "[ERROR] Bad time pointer init in DD_SetTime Mag -> err value : " + error;
+ printf(" bad time pointer mag %d\n", error);
+ throw ddSetTimeErr;
+ }
+ // GET DATA
+ char *params[4];
+
+ params[0] = const_cast( timeParameter.c_str() );
+ params[1] = const_cast( DensParameter.c_str() );
+ params[2] = const_cast( TempParameter.c_str() );
+ params[3] = const_cast( VNormParameter.c_str() );
+
+ char *params_mag[2];
+ params_mag[0] = const_cast( timeParameter.c_str() );
+ params_mag[1] = const_cast( magParameter.c_str() );
+
+ char *timeIntervall = const_cast( ddInterval.c_str() );
+
+ DD_data_t *data;
+
+ int status = 0;
+
+ plasmaFile << "Time,Density,Vth,Vr,Vt,Vn" << endl;
+
+ do {
+
+ status = DD_GetMultiData(id_sw, 4, static_cast(params), timeIntervall, &data, 1);
+
+ if (status < 0)
+ {
+ std::string ddGetDataErr = "[ERROR] Failed to get SW data -> status : " + status;
+ throw std::string(ddGetDataErr);
+ }
+
+ for (int j = 0; j < data->VarNumber; ++j)
+ {
+ plasmaFile << static_cast(data[0].Variables[j]) << ","
+ << *(static_cast(data[1].Variables[j])) << ","
+ << *(static_cast(data[2].Variables[j])) << ","
+ << static_cast(data[3].Variables[j])[0] << ","
+ << static_cast(data[3].Variables[j])[1] << ","
+ << static_cast(data[3].Variables[j])[2] << endl;
+ }
+
+ } while (status == MOREDATA);
+
+ DD_Close(id_sw);
+
+ status = 0;
+
+ magFile << "Time,Bx,By,Bz" << endl;
+
+ do {
+
+ status = DD_GetMultiData(id_mag, 2, static_cast(params_mag), timeIntervall, &data, 1);
+
+ if (status < 0)
+ {
+ std::string ddGetDataErr = "[ERROR] Failed to get MAG data -> status : " + status;
+ throw std::string(ddGetDataErr);
+ }
+
+ for (int j = 0; j < data->VarNumber; ++j)
+ {
+ magFile << static_cast(data[0].Variables[j]) << ","
+ << static_cast(data[1].Variables[j])[0] << ","
+ << static_cast(data[1].Variables[j])[1] << ","
+ << static_cast(data[1].Variables[j])[2] << endl;
+ }
+
+ } while (status == MOREDATA);
+
+
+ DD_Close(id_mag);
+
+ plasmaFile.close();
+
+ magFile.close();
+
+ return 0;
+}
\ No newline at end of file
--
libgit2 0.21.2