From 3d14149a77607ba7274f90da2eea70d25dc61b17 Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi <m.chraibi@fz-juelich.de> Date: Fri, 29 Sep 2017 16:08:51 +0200 Subject: [PATCH] Use python3 --- Analysis.cpp | 4 ++-- general/ArgumentParser.cpp | 2 +- methods/Method_B.cpp | 4 +++- scripts/_Plot_timeseries_rho_v.py | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Analysis.cpp b/Analysis.cpp index f1b31b15..47c1dbac 100644 --- a/Analysis.cpp +++ b/Analysis.cpp @@ -375,7 +375,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path) Log->Write("INFO:\tSuccess with Method C using measurement area id %d!\n",_areaForMethod_C[i]->_id); if(_plotTimeseriesC[i]) { - string parameters_Timeseries="python \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+ + string parameters_Timeseries="python3 \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+ " -f "+boost::lexical_cast<std::string>(data.GetFps()); int res=system(parameters_Timeseries.c_str()); Log->Write("INFO:\t time series result: %d ",res); @@ -417,7 +417,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path) Log->Write("INFO:\tSuccess with Method D using measurement area id %d!\n",_areaForMethod_D[i]->_id); if(_plotTimeseriesD[i]) { - string parameters_Timeseries="python \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+ + string parameters_Timeseries="python3 \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+ " -f "+boost::lexical_cast<std::string>(data.GetFps()); int res=system(parameters_Timeseries.c_str()); Log->Write("INFO:\t time series result: %d ",res); diff --git a/general/ArgumentParser.cpp b/general/ArgumentParser.cpp index c4c872b1..f88102af 100644 --- a/general/ArgumentParser.cpp +++ b/general/ArgumentParser.cpp @@ -528,7 +528,7 @@ bool ArgumentParser::ParseIniFile(const string& inifile) else { _vComponent = MovementDirection; - Log->Write("INFO: \tThe instantaneous velocity in the direction of "+MovementDirection+"degree will be calculated over <"+FrameSteps+" frames>" ); + Log->Write("INFO: \tThe instantaneous velocity in the direction of <"+MovementDirection+"> will be calculated over <"+FrameSteps+" frames>" ); } } diff --git a/methods/Method_B.cpp b/methods/Method_B.cpp index 42508af6..5cb04410 100644 --- a/methods/Method_B.cpp +++ b/methods/Method_B.cpp @@ -107,10 +107,12 @@ void Method_B::GetTinTout(int numFrames) if(within(make<point_2d>( (x), (y)), _areaForMethod_B->_poly)&&!(IsinMeasurezone[ID])) { _tIn[ID]=frameNr; IsinMeasurezone[ID] = true; + std::cout << "IN x: " << x*CMtoM << " y: " << y*CMtoM<< std::endl; } if((!within(make<point_2d>( (x), (y)), _areaForMethod_B->_poly))&&IsinMeasurezone[ID]) { _tOut[ID]=frameNr; IsinMeasurezone[ID] = false; + std::cout << "OUT x: " << x*CMtoM << " y: " << y*CMtoM << std::endl; } } _DensityPerFrame[frameNr] = pedsinMeasureArea/(area(_areaForMethod_B->_poly)*CMtoM*CMtoM); @@ -131,7 +133,7 @@ void Method_B::GetFundamentalTinTout(double *DensityPerFrame,double LengthMeasur } fprintf(fFD_TinTout,"#person Index\t density_i(m^(-2))\t velocity_i(m/s)\n"); for(int i=0; i<_NumPeds; i++) - { + {std::cout << "i: "<< i << ", Tin: " << _tIn[i] << ", Tout: " << _tOut[i] << ", fps: " << _fps << ", L: "<< LengthMeasurementarea<< std::endl; double velocity_temp=_fps*LengthMeasurementarea/(_tOut[i]-_tIn[i]); double density_temp=0; for(int j=_tIn[i]; j<_tOut[i]; j++) diff --git a/scripts/_Plot_timeseries_rho_v.py b/scripts/_Plot_timeseries_rho_v.py index b296123e..d89b21bd 100644 --- a/scripts/_Plot_timeseries_rho_v.py +++ b/scripts/_Plot_timeseries_rho_v.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 from numpy import * import matplotlib import matplotlib.pyplot as plt -- GitLab