Merge branch 'master' of bitbucket.org:glavaux/cosmotool
This commit is contained in:
commit
b2b5c93ad6
@ -507,7 +507,7 @@ def writeGadget(str filename, object simulation):
|
|||||||
|
|
||||||
cxx_writeGadget(filename, &simdata)
|
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)
|
""" 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.
|
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
|
doublePrecision (bool): By default it is False, thus singlePrecision
|
||||||
loadPosition (bool): Whether to load positions
|
loadPosition (bool): Whether to load positions
|
||||||
loadVelocity (bool): Whether to load velocities
|
loadVelocity (bool): Whether to load velocities
|
||||||
|
loadId (bol): Whether to load identifiers
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
An object derived from PySimulationBase_.
|
An object derived from PySimulationBase_.
|
||||||
@ -533,6 +534,8 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision =
|
|||||||
flags |= NEED_POSITION
|
flags |= NEED_POSITION
|
||||||
if loadVelocity:
|
if loadVelocity:
|
||||||
flags |= NEED_VELOCITY
|
flags |= NEED_VELOCITY
|
||||||
|
if loadId:
|
||||||
|
flags |= NEED_GADGET_ID
|
||||||
|
|
||||||
data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags)
|
data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags)
|
||||||
if data == <SimuData*>0:
|
if data == <SimuData*>0:
|
||||||
|
Loading…
Reference in New Issue
Block a user