update tests to follow new architecture

This commit is contained in:
Pim Nelissen
2026-02-25 15:05:22 +01:00
parent 5c9841190f
commit 9a169da520
3 changed files with 44 additions and 25 deletions

View File

@ -42,7 +42,7 @@ def phi(
return phi_r
def calculate_fluence_at(landscape: "Landscape", pos: np.ndarray):
def calculate_fluence_at(landscape: "Landscape", pos: np.ndarray, scaling=1E6):
"""Compute fluence at an arbitrary position in the landscape.
Args:
@ -52,15 +52,16 @@ def calculate_fluence_at(landscape: "Landscape", pos: np.ndarray):
Returns:
total_phi (np.ndarray): (N,) array of fluences.
"""
pos = np.atleast_2d(pos)
total_phi = np.zeros(pos.shape[0])
for source in landscape.point_sources:
r = np.linalg.norm(pos - np.array(source.pos), axis=1)
r = np.maximum(r, 1e-3) # enforce minimum distance of 1cm
r = np.maximum(r, 1E-3) # enforce minimum distance of 1cm
phi_source = phi(
r=r,
activity=source.activity,
activity=source.activity * scaling,
branching_ratio=source.isotope.b,
mu_mass_air=source.isotope.mu_mass_air,
air_density=landscape.air_density