Commit a8a1414c authored by Mohcine Chraibi's avatar Mohcine Chraibi

Fixes for profile script

parent e13c3e27
Pipeline #5905 passed with stages
in 1 minute and 17 seconds
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- trajectories file and format --> <!-- trajectories file and format -->
<!-- either a file name or a path location. In the latter case all files in the directory will be used--> <!-- either a file name or a path location. In the latter case all files in the directory will be used-->
<trajectories format="txt" unit="m"> <trajectories format="txt" unit="m">
<file name="traj_KO_240_050_240_x.txt" /> <file name="traj_KO_240_050_240.txt" />
<path location="./" /> <path location="./" />
</trajectories> </trajectories>
<!-- give relative path based on the location inifile or give the absolute path- --> <!-- give relative path based on the location inifile or give the absolute path- -->
...@@ -37,14 +37,14 @@ ...@@ -37,14 +37,14 @@
</area_L> </area_L>
</measurement_areas> </measurement_areas>
<!-- <velocity> <velocity>
<use_x_component>true</use_x_component> <use_x_component>true</use_x_component>
<use_y_component>true</use_y_component> <use_y_component>true</use_y_component>
<!-- The time interval that used to calculate instantaneous velocity <!-- The time interval that used to calculate instantaneous velocity
of ped i [fr] here v_i = (X(t+frame_step/2) - X(t+frame_step/2))/frame_step. X is location. of ped i [fr] here v_i = (X(t+frame_step/2) - X(t+frame_step/2))/frame_step. X is location. -->
<frame_step>10</frame_step> <frame_step>10</frame_step>
</velocity> </velocity>
-->
<velocity frame_step="10" set_movement_direction="None" ignore_backward_movement="false"/> <velocity frame_step="10" set_movement_direction="None" ignore_backward_movement="false"/>
<!-- frame_step is the time interval that used to calculate instantaneous velocity <!-- frame_step is the time interval that used to calculate instantaneous velocity
of ped i [fr] here v_i = (X(t+frame_step/2) - X(t+frame_step/2))/frame_step. X is location. --> of ped i [fr] here v_i = (X(t+frame_step/2) - X(t+frame_step/2))/frame_step. X is location. -->
...@@ -62,19 +62,18 @@ ...@@ -62,19 +62,18 @@
</method_B> </method_B>
<!-- Method C (Zhang2011a) Classical density and Vel --> <!-- Method C (Zhang2011a) Classical density and Vel -->
<method_C enabled="true"> <method_C enabled="false">
<measurement_area id="1" plot_time_series="true"/> <measurement_area id="1" plot_time_series="true"/>
<measurement_area id="2" plot_time_series="true"/> <measurement_area id="2" plot_time_series="true"/>
</method_C> </method_C>
<!-- Method D (Zhang2011a) Voronoi density and Vel --> <!-- Method D (Zhang2011a) Voronoi density and Vel -->
<method_D enabled="true"> <method_D enabled="true">
<measurement_area id="1" start_frame="None" stop_frame="None" get_individual_FD="false" plot_time_series="true"/> <measurement_area id="1" start_frame="500" stop_frame="800" get_individual_FD="false" plot_time_series="true"/>
<measurement_area id="2" start_frame="500" stop_frame="800" get_individual_FD="false" plot_time_series="true"/>
<one_dimensional enabled="false"/> <one_dimensional enabled="false"/>
<cut_by_circle enabled="false" radius="1.0" edges="10"/> <cut_by_circle enabled="false" radius="1.0" edges="10"/>
<output_voronoi_cells enabled="false" plot_graphs="false"/> <output_voronoi_cells enabled="false" plot_graphs="false"/>
<profiles enabled="false" grid_size_x="0.20" grid_size_y="0.20"/> <profiles enabled="true" grid_size_x="0.20" grid_size_y="0.20"/>
</method_D> </method_D>
</JPSreport> </JPSreport>
...@@ -22,10 +22,10 @@ def get_parser_args(): ...@@ -22,10 +22,10 @@ def get_parser_args():
'steady state') 'steady state')
parser.add_argument("-e", "--endsteady", type=int, required=True, help='the frame for the ending of ' parser.add_argument("-e", "--endsteady", type=int, required=True, help='the frame for the ending of '
'steady state') 'steady state')
parser.add_argument("-x1", "--geominx", type=float, required=True, help='the minmum x of the geometry') parser.add_argument("-x1", "--geominx", type=float, required=True, help='the minimum x of the geometry')
parser.add_argument("-x2", "--geomaxx", type=float, required=True, help='the maxmum x of the geometry') parser.add_argument("-x2", "--geomaxx", type=float, required=True, help='the maximum x of the geometry')
parser.add_argument("-y1", "--geominy", type=float, required=True, help='the minmum y of the geometry') parser.add_argument("-y1", "--geominy", type=float, required=True, help='the minimum y of the geometry')
parser.add_argument("-y2", "--geomaxy", type=float, required=True, help='the maxmum y of the geometry') parser.add_argument("-y2", "--geomaxy", type=float, required=True, help='the maximum y of the geometry')
arguments = parser.parse_args() arguments = parser.parse_args()
return arguments return arguments
...@@ -66,11 +66,14 @@ if __name__ == '__main__': ...@@ -66,11 +66,14 @@ if __name__ == '__main__':
ax1 = fig.add_subplot(111, aspect='1') ax1 = fig.add_subplot(111, aspect='1')
plt.rc("font", size=40) plt.rc("font", size=40)
for j in range(beginsteady, endsteady): for j in range(beginsteady, endsteady):
density_file = os.path.join( density_file = os.path.join(pathfile, "density", "Prf_d_%s_id_1_%.5d.dat" %(nametraj, j))
pathfile, "density", "Prf_d_%s if os.path.exists(density_file):
_id_1_%.5d.dat" % (nametraj, j)) print("loading: %s" % density_file)
print("loading: %s" % density_file) density += np.loadtxt(density_file)
density += np.loadtxt(density_file)
else:
print("WARNING: file not found %s"%density_file)
density = density / (endsteady - beginsteady) density = density / (endsteady - beginsteady)
...@@ -97,9 +100,11 @@ _id_1_%.5d.dat" % (nametraj, j)) ...@@ -97,9 +100,11 @@ _id_1_%.5d.dat" % (nametraj, j))
for j in range(beginsteady, endsteady): for j in range(beginsteady, endsteady):
velocity_file = os.path.join( velocity_file = os.path.join(
pathfile, "velocity", "Prf_v_%s_id_1_%.5d.dat" % (nametraj, j)) pathfile, "velocity", "Prf_v_%s_id_1_%.5d.dat" % (nametraj, j))
print("loading: %s" % velocity_file) if os.path.exists(velocity_file):
velocity += np.loadtxt(velocity_file) print("loading: %s" % velocity_file)
velocity += np.loadtxt(velocity_file)
else:
print("WARNING: file not found %s"%velocity_file)
velocity = velocity / (endsteady - beginsteady) velocity = velocity / (endsteady - beginsteady)
im = plt.imshow(velocity, im = plt.imshow(velocity,
cmap=cm.jet, cmap=cm.jet,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment