More doc
This commit is contained in:
parent
e6068c0aa0
commit
7a27dae025
@ -30,6 +30,11 @@ The simulation loaders
|
||||
.. autofunction:: loadGadget
|
||||
.. autofunction:: loadParallelGadget
|
||||
|
||||
Grafic Input and Output
|
||||
-----------------------
|
||||
|
||||
.. autofunction:: readGrafic
|
||||
|
||||
Timing
|
||||
------
|
||||
|
||||
|
@ -2,7 +2,20 @@ import struct
|
||||
import numpy as np
|
||||
|
||||
def readGrafic(filename):
|
||||
|
||||
"""This function reads a grafic file.
|
||||
|
||||
Arguments:
|
||||
filename (str): the path to the grafic file
|
||||
|
||||
Returns:
|
||||
a tuple containing:
|
||||
* the array held in the grafic file
|
||||
* the size of the box
|
||||
* the scale factor
|
||||
* the mean matter density :math:`\Omega_\mathrm{m}`
|
||||
* the dark energy density :math:`\Omega_\Lambda`
|
||||
* the hubble constant, relative to 100 km/s/Mpc
|
||||
"""
|
||||
with file(filename, mode="rb") as f:
|
||||
p = struct.unpack("IIIIffffffffI", f.read(4*11 + 2*4))
|
||||
checkPoint0, Nx, Ny, Nz, delta, _, _, _, scalefac, omega0, omegalambda0, h, checkPoint1 = p
|
||||
|
Loading…
Reference in New Issue
Block a user