Added experimental documentation. Added a sphinx skeleton
This commit is contained in:
parent
00d8d619ef
commit
e5fbc1d62e
10 changed files with 696 additions and 4 deletions
|
@ -394,8 +394,21 @@ 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):
|
||||
""" 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.
|
||||
""" 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.
|
||||
|
||||
Args:
|
||||
basepath (str): the base directory of the snapshot
|
||||
snapshot_id (int): the snapshot id
|
||||
cpu_id (int): the cpu id of the file to load
|
||||
|
||||
Keyword args:
|
||||
doublePrecision (bool): By default it is False, thus singlePrecision
|
||||
loadPosition (bool): Whether to load positions
|
||||
loadVelocity (bool): Whether to load velocities
|
||||
|
||||
Returns:
|
||||
An object derived from PySimulationBase.
|
||||
"""
|
||||
cdef int flags
|
||||
cdef SimuData *data
|
||||
|
|
|
@ -99,7 +99,17 @@ def simpleWriteGadget(filename, positions, boxsize=1.0, Hubble=100, Omega_M=0.30
|
|||
writeGadget(filename, s)
|
||||
|
||||
def loadRamsesAll(basepath, snapshot_id, **kwargs):
|
||||
|
||||
"""This function loads an entire ramses snapshot in memory. The keyword arguments are the one accepted
|
||||
by cosmotool.loadRamses
|
||||
|
||||
Args:
|
||||
basepath (str): The base path of the snapshot (i.e. the directory holding the output_XXXXX directories)
|
||||
snapshot_id (int): The identifier of the snapshot to load.
|
||||
|
||||
See Also:
|
||||
cosmotool.loadRamses
|
||||
|
||||
"""
|
||||
cpu_id = 0
|
||||
output = None
|
||||
while True:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue