Classes
Gadget1File (path[, columndefs, hdtype, ptype]) |
Read snapshot binary files from Volkers Gadget 1/2/3 simulations. |
nbodykit.io.gadget.
Gadget1File
(path, columndefs=[('Position', ('auto', 3), 'all'), ('GadgetVelocity', ('auto', 3), 'all'), ('ID', 'auto', 'all'), ('Mass', 'auto', None), ('InternalEnergy', 'auto', (0,)), ('Density', 'auto', (0,)), ('SmoothingLength', 'auto', (0,))], hdtype=[('Npart', ('u4', 6)), ('Massarr', ('f8', 6)), ('Time', 'f8'), ('Redshift', 'f8'), ('FlagSfr', 'i4'), ('FlagFeedback', 'i4'), ('Nall', ('u4', 6)), ('FlagCooling', 'i4'), ('NumFiles', 'i4'), ('BoxSize', 'f8'), ('Omega0', 'f8'), ('OmegaLambda', 'f8'), ('HubbleParam', 'f8'), ('FlagAge', 'i4'), ('FlagMetals', 'i4'), ('NallHW', ('u4', 6)), ('flag_entr_ics', 'i4')], ptype=1)[source]¶Read snapshot binary files from Volkers Gadget 1/2/3 simulations.
These files are stored column-wise with a format, with a header of size 28 bytes to begin the file.
The columns are:
Parameters: |
---|
References
https://wwwmpa.mpa-garching.mpg.de/gadget/users-guide.pdf
Attributes
columns |
A list of the names of the columns in the file. |
dtype |
A numpy.dtype object holding the data types of each column in the file. |
ncol |
The number of data columns in the file. |
shape |
The shape of the file, which defaults to (size, ) |
size |
The size of the file, i.e., number of rows |
Methods
asarray () |
Return a view of the file, where the fields of the |
get_dask (column[, blocksize]) |
Return the specified column as a dask array, which |
keys () |
Aliased function to return columns |
read (columns, start, stop[, step]) |
Read the specified column(s) over the given range |
read
(columns, start, stop, step=1)[source]¶Read the specified column(s) over the given range
‘start’ and ‘stop’ should be between 0 and size
,
which is the total size of the binary file (in particles)
Parameters: | |
---|---|
Returns: | structured array holding the requested columns over the specified range of rows |
Return type: |