Added support for ID in ramses

This commit is contained in:
Guilhem Lavaux 2015-02-10 14:00:28 +01:00
parent 286d094dbb
commit ab36a5b24a

View File

@ -507,7 +507,7 @@ def writeGadget(str filename, object simulation):
cxx_writeGadget(filename, &simdata)
def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision = False, bool loadPosition = True, bool loadVelocity = False):
def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision = False, bool loadPosition = True, bool loadVelocity = False, bool loadId = False):
""" loadRamses(basepath, snapshot_id, cpu_id, doublePrecision = False, loadPosition = True, loadVelocity = False)
Loads the indicated snapshot based on the cpu id, snapshot id and basepath. It is important to specify the correct precision in doublePrecision otherwise the loading will fail. There is no way of auto-detecting properly the precision of the snapshot file.
@ -520,6 +520,7 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision =
doublePrecision (bool): By default it is False, thus singlePrecision
loadPosition (bool): Whether to load positions
loadVelocity (bool): Whether to load velocities
loadId (bol): Whether to load identifiers
Returns:
An object derived from PySimulationBase_.
@ -533,6 +534,8 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision =
flags |= NEED_POSITION
if loadVelocity:
flags |= NEED_VELOCITY
if loadId:
flags |= NEED_GADGET_ID
data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags)
if data == <SimuData*>0: