Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/f4enix/output/rssa/rssa.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/f4enix/output/rssa/rssa_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down