Plotting¶
Visualization utilities for HYRR results.
plotting ¶
Plotting utilities for HYRR results.
Energy scans, depth profiles, cooling curves, purity plots. Supports matplotlib (publication) and plotly (interactive).
plot_depth_profile ¶
plot_depth_profile(layer_result: LayerResult, quantity: Literal['heat', 'energy', 'dedx'] = 'heat', backend: Backend = 'plotly', **kwargs: Any) -> Any
Plot depth profile for a single layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_result
|
LayerResult
|
Results for one layer. |
required |
quantity
|
Literal['heat', 'energy', 'dedx']
|
What to plot on y-axis. |
'heat'
|
backend
|
Backend
|
"matplotlib" or "plotly". |
'plotly'
|
**kwargs
|
Any
|
Additional arguments passed to plotting function. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
matplotlib Figure or plotly Figure. |
plot_activity_vs_time ¶
plot_activity_vs_time(isotope_results: dict[str, IsotopeResult] | list[IsotopeResult], top_n: int | None = 10, min_activity_Bq: float = 0.0, backend: Backend = 'plotly', **kwargs: Any) -> Any
Plot activity vs time for multiple isotopes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isotope_results
|
dict[str, IsotopeResult] | list[IsotopeResult]
|
Dict or list of IsotopeResult. |
required |
top_n
|
int | None
|
Show only the top N isotopes by peak activity (None = all). |
10
|
min_activity_Bq
|
float
|
Filter isotopes below this threshold. |
0.0
|
backend
|
Backend
|
"matplotlib" or "plotly". |
'plotly'
|
**kwargs
|
Any
|
Additional arguments forwarded to the backend. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
matplotlib Figure or plotly Figure. |
plot_cooling_curve ¶
plot_cooling_curve(isotope_results: dict[str, IsotopeResult] | list[IsotopeResult], irradiation_time_s: float, top_n: int | None = 10, backend: Backend = 'plotly', **kwargs: Any) -> Any
Plot activity during cooling phase only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isotope_results
|
dict[str, IsotopeResult] | list[IsotopeResult]
|
Dict or list of IsotopeResult. |
required |
irradiation_time_s
|
float
|
Irradiation time to identify cooling start. |
required |
top_n
|
int | None
|
Show only top N isotopes. |
10
|
backend
|
Backend
|
"matplotlib" or "plotly". |
'plotly'
|
**kwargs
|
Any
|
Additional arguments forwarded to the backend. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Figure object. |
plot_purity_vs_cooling ¶
plot_purity_vs_cooling(isotope_results: dict[str, IsotopeResult], target_isotope: str, irradiation_time_s: float, backend: Backend = 'plotly', **kwargs: Any) -> Any
Plot radionuclidic purity of target isotope vs cooling time.
Purity = A_target / A_total at each cooling time point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isotope_results
|
dict[str, IsotopeResult]
|
Dict of isotope name to IsotopeResult. |
required |
target_isotope
|
str
|
Name of the desired isotope (e.g., "Tc-99m"). |
required |
irradiation_time_s
|
float
|
Irradiation time in seconds. |
required |
backend
|
Backend
|
"matplotlib" or "plotly". |
'plotly'
|
**kwargs
|
Any
|
Additional arguments forwarded to the backend. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Figure object. |
plot_energy_scan ¶
plot_energy_scan(energies_MeV: list[float], activities: dict[str, list[float]], backend: Backend = 'plotly', **kwargs: Any) -> Any
Plot activity vs beam energy for multiple isotopes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
energies_MeV
|
list[float]
|
List of beam energies scanned. |
required |
activities
|
dict[str, list[float]]
|
Dict of isotope name to list of activities [GBq] at each energy. |
required |
backend
|
Backend
|
"matplotlib" or "plotly". |
'plotly'
|
**kwargs
|
Any
|
Additional arguments forwarded to the backend. |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
Figure object. |