diff --git a/src/f4enix/output/rssa/rssa.py b/src/f4enix/output/rssa/rssa.py index 7954ec8..b6415e7 100644 --- a/src/f4enix/output/rssa/rssa.py +++ b/src/f4enix/output/rssa/rssa.py @@ -1,6 +1,4 @@ """This module is related to the parsing of D1S-UNED meshinfo files.""" - -from collections.abc import Sequence from pathlib import Path import polars as pl @@ -140,9 +138,6 @@ def histories(self) -> pl.Series: """Returns the history numbers of the tracks.""" return self.tracks["a"] - def get_energy_spectra(self, energy_bins: Sequence[float]) -> pl.DataFrame: - raise NotImplementedError() - def plot_plane(self) -> RSSAPlot: """Returns an instance of RSSAPlot to plot data assuming an XY plane.""" return RSSAPlot(self.tracks, self.parameters) diff --git a/src/f4enix/output/rssa/rssa_plotting.py b/src/f4enix/output/rssa/rssa_plotting.py index e658f86..dd83cce 100644 --- a/src/f4enix/output/rssa/rssa_plotting.py +++ b/src/f4enix/output/rssa/rssa_plotting.py @@ -80,9 +80,14 @@ def calculate_perimeter_positions(self) -> None: 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. """ radius = (pl.col("x").pow(2) + pl.col("y").pow(2)).sqrt() - thetas = pl.arctan2(pl.col("y"), pl.col("x")) + thetas = pl.arctan2(pl.col("y"), -1 * pl.col("x")) perimeter_pos = (thetas * radius).alias("perimeter_pos") self.tracks = self.tracks.with_columns(perimeter_pos)