f4enix.output.rssa.rssa_plotting.RSSAPlot#

class f4enix.output.rssa.rssa_plotting.RSSAPlot(tracks: DataFrame, rssa_parameters: FileParameters, x_col: str = 'x', y_col: str = 'y')#

Bases: PlottingFunctions

Methods

__init__(tracks, rssa_parameters[, x_col, y_col])

apply_source_intensity(source_intensity)

Apply a source intensity to the weights of the tracks.

calculate_bins([bin_width])

Automatically calculate the bins for the x and y coordinates of the plot by giving a bin width in cm.

calculate_perimeter_positions()

It adds a new column to the tracks DataFrame called 'perimeter_pos' that takes the X and Y coordinates and calculates the position as a perimeter coordinate.

divide_by_nps()

Divide the weights by the number of histories.

get_particle_current(source_intensity)

Calculate the particle current from the tracks.

get_particle_current_errors()

Calculate the particle current errors from the tracks as the square root of the number of tracks in each bin.

get_plot()

Returns the Matplotlib figure and axes of the plot for further manual customization.

get_ratio_to(other)

Calculate the ratio of the current to another RSSAPlot instance in % difference.

save_figure(out_path)

Save the figure to the specified path.

set_bins(x_bins, y_bins)

Set the x and y bins for the plot.

set_particle(particle_type)

Set the particle type to filter the tracks.

set_perimeter_limits(vmin, vmax)

Set the limits for the perimeter positions.

set_plot_parameters(plot_parameters)

Set the plot parameters for the plot.

set_surface_ids(surface_ids)

Set the surface IDs to filter the tracks.

set_z_limits(vmin, vmax)

Set the z limits for the plot.

show()

Show the plot.

Attributes

x_bins

Returns the x bins for the plot.

y_bins

Returns the y bins for the plot.

tracks

rssa_parameters

apply_source_intensity(source_intensity: float) RSSAPlot#

Apply a source intensity to the weights of the tracks.

calculate_bins(bin_width: float = 10.0) RSSAPlot#

Automatically calculate the bins for the x and y coordinates of the plot by giving a bin width in cm. Instead use set_bins() to apply custom bins.

calculate_perimeter_positions() None#

It adds a new column to the tracks DataFrame called ‘perimeter_pos’ that takes the X and Y coordinates and calculates the position as a perimeter coordinate. The perimeter position is calculated as theta * r, where theta is the angle in radians and r is the radius of each track.

The theta is calculated using the arctan2 function, which gives the angle between the positive X-axis and the point (x, y). In that calculation, the X coordinate is multiplied by -1 to “flip” the plot, this way it looks as a cylinder observed from the inside.

divide_by_nps() RSSAPlot#

Divide the weights by the number of histories. The nps value used is the one read in the header abs(np1).

get_particle_current(source_intensity: float) RSSAPlot#

Calculate the particle current from the tracks. It automatically divides the weight by the nps value.

get_particle_current_errors() RSSAPlot#

Calculate the particle current errors from the tracks as the square root of the number of tracks in each bin.

get_plot() tuple[Figure, Axes]#

Returns the Matplotlib figure and axes of the plot for further manual customization.

get_ratio_to(other: RSSAPlot) RSSAPlot#

Calculate the ratio of the current to another RSSAPlot instance in % difference. Calculated as (other - self) / self * 100. The other RSSAPlot instance should have undergone the same processing as the current one.

save_figure(out_path: Path | str) RSSAPlot#

Save the figure to the specified path.

set_bins(x_bins: Sequence[float], y_bins: Sequence[float]) RSSAPlot#

Set the x and y bins for the plot.

set_particle(particle_type: Literal['n', 'p']) RSSAPlot#

Set the particle type to filter the tracks.

set_perimeter_limits(vmin: float, vmax: float) RSSAPlot#

Set the limits for the perimeter positions.

set_plot_parameters(plot_parameters: PlotParameters) RSSAPlot#

Set the plot parameters for the plot.

set_surface_ids(surface_ids: list[int]) RSSAPlot#

Set the surface IDs to filter the tracks.

set_z_limits(vmin: float, vmax: float) RSSAPlot#

Set the z limits for the plot.

show() RSSAPlot#

Show the plot.

property x_bins: Series#

Returns the x bins for the plot.

property y_bins: Series#

Returns the y bins for the plot.