diff --git a/python/cosmotool/simu.py b/python/cosmotool/simu.py index 8aa7722..3dd4cf6 100644 --- a/python/cosmotool/simu.py +++ b/python/cosmotool/simu.py @@ -1,3 +1,4 @@ +import warnings from _cosmotool import * class SimulationBare(PySimulationBase): @@ -18,6 +19,10 @@ class SimulationBare(PySimulationBase): self.Hubble = s.getHubble() self.Omega_M = s.getOmega_M() self.Omega_Lambda = s.getOmega_Lambda() + try: + self.masses = s.getMasses().copy() if s.getMasses() is not None else None + except Exception as e: + warnings.warn("Unexpected exception: " + repr(e)) def merge(self, other): @@ -48,6 +53,11 @@ class SimulationBare(PySimulationBase): self.positions = _safe_merge(self.positions, other.getPositions()) self.velocities = _safe_merge(self.velocities, other.getVelocities()) self.identifiers = _safe_merge0(self.identifiers, other.getIdentifiers()) + try: + self.masses = _safe_merge0(self.masses, other.getMasses()) + except Exception as e: + warnings.warn("Unexpected exception: " + repr(e)); + self.masses = None def getPositions(self): return self.positions @@ -58,6 +68,9 @@ class SimulationBare(PySimulationBase): def getIdentifiers(self): return self.identifiers + def getMasses(self): + return self.masses + def getTime(self): return self.time