Utility Functions

radcomp.nuclei_to_activity(nuclei: T, trans_rate: float) T

Convert number of nuclei to activity (MBq).

Parameters:
  • nuclei (T) – Number of nuclei.

  • trans_rate (float) – Transition rate (h-1).

Returns:

Activity (MBq).

Return type:

T

radcomp.activity_to_nuclei(activity: T, trans_rate: float) T

Convert activity (MBq) to number of nuclei.

Parameters:
  • activity (T) – Activity (MBq).

  • trans_rate (float) – Transition rate (h-1).

Returns:

Number of nuclei.

Return type:

T

radcomp.read_arrays(filepath: str) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]

Read a model solution saved to npz file.

Parameters:

filepath (str) – Filepath to npz file.

Returns:

  • t_eval : Times (h). Sorted (ascending). 1D.

  • nuclei : Shape (num_layers, num_compartments, len(t_eval)). Element at index [i, j, k] is the number of nuclei in layer i, compartment j at element k of t_eval.

  • activity : Shape (num_layers, num_compartments, len(t_eval)). Element at index [i, j, k] is the activity (MBq) in layer i, compartment j at element k of t_eval.

Return type:

tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]