Skip to content

Commit 343a5da

Browse files
authored
Bug fix: Correctly stack weights for variants when propagating to multiple times (#24)
1 parent 3b36a9c commit 343a5da

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/adam_assist/propagator.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,21 @@ def _propagate_orbits_inner(
450450
orbits.object_id.to_numpy(zero_copy_only=False),
451451
len(integrator_times),
452452
)
453+
# Repeat variant weights across all output time steps
454+
num_steps = len(integrator_times)
455+
weights_out = np.tile(
456+
orbits.weights.to_numpy(zero_copy_only=False), num_steps
457+
)
458+
weights_cov_out = np.tile(
459+
orbits.weights_cov.to_numpy(zero_copy_only=False), num_steps
460+
)
453461

454462
results = VariantOrbits.from_kwargs(
455463
orbit_id=orbit_ids_out,
456464
variant_id=variant_ids_out,
457465
object_id=object_id_out,
458-
weights=orbits.weights,
459-
weights_cov=orbits.weights_cov,
466+
weights=weights_out,
467+
weights_cov=weights_cov_out,
460468
coordinates=CartesianCoordinates.from_kwargs(
461469
x=xyzvxvyvz[:, 0],
462470
y=xyzvxvyvz[:, 1],

0 commit comments

Comments
 (0)