From ab36a5b24a3cf6de061364e8938903dcdf363994 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 10 Feb 2015 14:00:28 +0100 Subject: [PATCH] Added support for ID in ramses --- python/_cosmotool.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/_cosmotool.pyx b/python/_cosmotool.pyx index f6dce91..cb1e4b0 100644 --- a/python/_cosmotool.pyx +++ b/python/_cosmotool.pyx @@ -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 == 0: