plot_particle_tracking
Classes¤
ParticleTracking ¤
ParticleTracking(
run_number,
z_pos="end",
working_dir="",
distribution_file="generator.in",
run_file="photo_track.in",
log_dir="log",
log_file_name="plots_log.log",
console_log=True,
plots_dir="plots",
n_R_bins=4,
n_emittance_bins=4,
)
Bases: PlotPhaseSpace
Source code in plot_analysis/plot_particle_tracking.py
Functions¤
collect_zpos_data ¤
Collects the data for all zpos.
Returns:
Type | Description |
---|---|
DataFrame
|
pd.DataFrame: dataframe containing data from all the z positions. |
Source code in plot_analysis/plot_particle_tracking.py
get_step ¤
Rounds the absolute_step so it is easily readable in the legend. If absolute_step > 1, simply rounds it to an integer. Otherwise looks for the first significant digit and rounds to that.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
absolute_step |
float
|
the absolute value of the step |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
rounded step |
Source code in plot_analysis/plot_particle_tracking.py
plot ¤
Method to plot the positions and emittance. Main method to use.
Source code in plot_analysis/plot_particle_tracking.py
plot_emittance ¤
Runs the plot_emittance_at_zpos for each z position.
Source code in plot_analysis/plot_particle_tracking.py
plot_emittance_scatter_at_zpos ¤
Plots scatter of the ,,emittance" of each particle at given zpos.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zpos |
float
|
z position to be plotted |
required |
x_lim |
float
|
Force sets the x_lim of the plot. If set to None, it scales automatically. Defaults to None. |
None
|
px_lim |
float
|
Force sets the y_lim of the plot. If set to None, it scales automatically.. Defaults to None. |
None
|
plot_autoscale |
bool
|
If True, makes sure that the autoscale plots are saved as well even if plot_lim is specified (in that case, two plots with different limits are saved). Defaults to True. |
True
|
Source code in plot_analysis/plot_particle_tracking.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
plot_position_at_zpos ¤
Plots scatter of transversal particle position at givin zpos.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zpos |
float
|
z position, to be plotted |
required |
plot_lim |
float
|
Force set the limits of the plot, if set to None, it scales automatically. Defaults to None. |
None
|
plot_autoscale |
bool
|
If True, makes sure that the autoscale plots are saved as well even if plot_lim is specified (in that case, two plots with different limits are saved). Defaults to True. |
True
|
Source code in plot_analysis/plot_particle_tracking.py
plot_positions ¤
Runs the plot_position_at_zpos for each z position.
Source code in plot_analysis/plot_particle_tracking.py
plot_transverse_particle_density ¤
Runs the plot_transvese_particle_density_at_zpos for each z position.
Source code in plot_analysis/plot_particle_tracking.py
plot_transverse_particle_density_at_zpos ¤
Plots transverse particle density (heatmap) at given zpos.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zpos |
int
|
z position, at which to plot |
required |
x_lim |
float
|
Limit the x axis of the heatmap. If not specified (set to None) the x axis is autoscaled. Defaults to None. |
None
|
y_lim |
_type_
|
Limit the y axis of the heatmap. If not specified (set to None) the y axis is autoscaled.. Defaults to None. |
None
|
plot_autoscale |
bool
|
If True, makes sure that the autoscale plots are saved as well even if plot_lim is specified (in that case, two plots with different limits are saved). Defaults to True. |
True
|
Source code in plot_analysis/plot_particle_tracking.py
save_data ¤
Function to save the data to an excel file.
Source code in plot_analysis/plot_particle_tracking.py
Created: October 31, 2023