Implemented correctly getMasses
This commit is contained in:
parent
38e3e61237
commit
bb94130bcd
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user