General simulation data file format.
Project description
GSD
The GSD file format is the native file format for HOOMD-blue. GSD files store trajectories of the HOOMD-blue system state in a binary file with efficient random access to frames. GSD allows all particle and topology properties to vary from one frame to the next. Use the GSD Python API to specify the initial condition for a HOOMD-blue simulation or analyze trajectory output with a script. Read a GSD trajectory with a visualization tool to explore the behavior of the simulation.
Resources
- GSD documentation: Tutorials, Python API, C API, usage information, and format specification.
- Installation Guide: Instructions for installing and compiling GSD.
- HOOMD-blue: Simulation engine that reads and writes GSD files.
- GSD discussion board: Ask the GSD community for help.
- freud: A powerful set of tools for analyzing trajectories.
- OVITO: The Open Visualization Tool works with GSD files.
- gsd-vmd plugin: VMD plugin to support GSD files.
HOOMD examples
Create a hoomd gsd file.
>>> s = gsd.hoomd.Frame()
>>> s.particles.N = 4
>>> s.particles.types = ['A', 'B']
>>> s.particles.typeid = [0,0,1,1]
>>> s.particles.position = [[0,0,0],[1,1,1], [-1,-1,-1], [1,-1,-1]]
>>> s.configuration.box = [3, 3, 3, 0, 0, 0]
>>> traj = gsd.hoomd.open(name='test.gsd', mode='w')
>>> traj.append(s)
Append frames to a gsd file:
>>> def create_frame(i):
... s = gsd.hoomd.Frame();
... s.configuration.step = i;
... s.particles.N = 4+i;
... s.particles.position = numpy.random.random(size=(4+i,3))
... return s;
>>> with gsd.hoomd.open('test.gsd', 'a') as t:
... t.extend( (create_frame(i) for i in range(10)) )
... print(len(t))
11
Randomly index frames:
>>> with gsd.hoomd.open('test.gsd', 'r') as t:
... frame = t[5]
... print(frame.configuration.step)
4
... print(frame.particles.N)
8
... print(frame.particles.position)
[[ 0.56993282 0.42243481 0.5502916 ]
[ 0.36892486 0.38167036 0.27310368]
[ 0.04739023 0.13603486 0.196539 ]
[ 0.120232 0.91591144 0.99463677]
[ 0.79806316 0.16991436 0.15228257]
[ 0.13724308 0.14253527 0.02505 ]
[ 0.39287439 0.82519054 0.01613089]
[ 0.23150323 0.95167434 0.7715748 ]]
Slice frames:
>>> with gsd.hoomd.open('test.gsd', 'r') as t:
... for s in t[5:-2]:
... print(s.configuration.step, end=' ')
4 5 6 7
File layer examples
with gsd.fl.open(name='file.gsd', mode='w') as f:
f.write_chunk(name='position', data=numpy.array([[1,2,3],[4,5,6]], dtype=numpy.float32));
f.write_chunk(name='angle', data=numpy.array([0, 1], dtype=numpy.float32));
f.write_chunk(name='box', data=numpy.array([10, 10, 10], dtype=numpy.float32));
f.end_frame()
with gsd.fl.open(name='file.gsd', mode='r') as f:
for i in range(1,f.nframes):
position = f.read_chunk(frame=i, name='position');
do_something(position);
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gsd-3.4.0.tar.gz
(185.3 kB
view hashes)
Built Distributions
gsd-3.4.0-cp313-cp313-win_amd64.whl
(257.0 kB
view hashes)
gsd-3.4.0-cp312-cp312-win_amd64.whl
(257.7 kB
view hashes)
gsd-3.4.0-cp311-cp311-win_amd64.whl
(259.9 kB
view hashes)
gsd-3.4.0-cp310-cp310-win_amd64.whl
(259.8 kB
view hashes)
Close
Hashes for gsd-3.4.0-cp313-cp313-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3409ec80787f2aff30254b66aaa505a90b7c89492c88870e909bd54a2b40d086 |
|
MD5 | 272420e0c3bbf98fcbf47f39b68c48e1 |
|
BLAKE2b-256 | 23197cc86dd24f2dd248132fb9474511ce26df40877f55c7fde7c782ab99ef1e |
Close
Hashes for gsd-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f68df11884d6863841d8f605419a21cb4c0d753ec87645bae1a2b5e1da3f885 |
|
MD5 | 88c6917518b943aa214f7220593731c8 |
|
BLAKE2b-256 | 1284362cd54ffe855c16ea17b1b83723479348b071632225730b273821ed9e80 |
Close
Hashes for gsd-3.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bbaa4e660bee124a5de00ea6c5e1a1c718920c10a89efda466d046aa6e1568d |
|
MD5 | 94e778a2db3dcdc889e849d85381e73c |
|
BLAKE2b-256 | 99d9c8939cafd6db63b83dd097a033429a35210c20ce649ed43c043620349f99 |
Close
Hashes for gsd-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c4ac029e5270f5265dc8faae1cd66952716290440a8b5dc3fd00916e7b41010 |
|
MD5 | d26392e50e0ed047628f1874e334f14e |
|
BLAKE2b-256 | 5d80f3d23d05f71cf44b5a2c8519a8b4eb0952c64eb089134dd943b0aab5435a |
Close
Hashes for gsd-3.4.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52b972cf18a10ad61018f80888809fdcbc5ca86efc00c86099de326ad90acd1d |
|
MD5 | 41779adf89a9f9a95425d9474954e177 |
|
BLAKE2b-256 | 2b73b571cd053ffdd32b1577adb0bcfc472a8d2e478fc0f364ddfe3dc9c17653 |
Close
Hashes for gsd-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4d17decdb803b6d7f1cfe419696966636e5c58680db3e85b137ac357feee12 |
|
MD5 | 032a7d606640efb09b50952b54f77307 |
|
BLAKE2b-256 | f29c9691c49bb7d756209d94befc9cc45094e2b420f7cff198dddcf7b19d4ee2 |
Close
Hashes for gsd-3.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6aea2acbcbeda15f4f44a977bb1bef334cf8a82915227bed2923e40babefe057 |
|
MD5 | 0bcf7504a2cc63d9debea96d0dcadd73 |
|
BLAKE2b-256 | dd62c821e7430318fcbaa901f13c7fd2b9d12a4d789ab13078c8ecc4342ea54e |
Close
Hashes for gsd-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03971d0dc121a1b2845984f246dd5c3ab95cad40786fe2f6c89159583d547300 |
|
MD5 | 325c191cda68ea27b43921f3f7372ff3 |
|
BLAKE2b-256 | 1d5a173fa1ac4c2b9fbe158fef602c368baa2d360660aec03384fca1724d8ebe |
Close
Hashes for gsd-3.4.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af327337316420f7f11472635e2bb0ff902db4758cf142e10edf5fb57f35afb |
|
MD5 | 3b3f4b84de2f324d51af938134810742 |
|
BLAKE2b-256 | 2e460a07a53c58259306be2b5a60b1999d29ae6038306504b713360c8f4fc670 |
Close
Hashes for gsd-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f429ed483ac76d30af74ebdaf0a46e607f53bb74f5f5801161306992477efdc |
|
MD5 | cfb740fb6d4e54e8ab8cf629215d5994 |
|
BLAKE2b-256 | 312a2f29f00bc6deb1fb7e13e6fd4d926739b114782afbfd51feaab646782e27 |
Close
Hashes for gsd-3.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e519ace9e5d835730f0a32e22fb225c3810db4aef056e1fc3f6a0b00b6b95a5d |
|
MD5 | 450cd1f9be3bb639a47bc36974612c2d |
|
BLAKE2b-256 | 56a72ea0a9feda66020c678ccdc3af2ffebf96e3412a7ec58058a7e13893e764 |
Close
Hashes for gsd-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba145c43ebbcea4dee3c3903eb9945794af97abda5a64ec223cb66d38ca85d1 |
|
MD5 | c2c0e642f1726cc71ecda57d63f087ae |
|
BLAKE2b-256 | 428583131415f4830cf446a38868d1dac5ff5004bca27643bd41fc17c1333bb4 |
Close
Hashes for gsd-3.4.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2063bda1849ea86a5fb142a13079d2881a1d16c56b05f43b3114bd7b72355b53 |
|
MD5 | ae32ff129f5a5a0433b0ec66889ab084 |
|
BLAKE2b-256 | 7c7a1741b13a5974dbc6796271c1f085dbb61474877bebf58a59400257f0cfc7 |
Close
Hashes for gsd-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3412e6aa6359dcf5a31e7aa379d524362c91a048bb9494f4c656105d95fa30dd |
|
MD5 | fad972aae135823905f7dabe84f92fa2 |
|
BLAKE2b-256 | a104c974893fa116a071571202f61c858d2f9f8faf201254a5e3407bc74151f8 |
Close
Hashes for gsd-3.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11fb612e8aa4706e747aa0a610f4c515e422f6911e349386b02e0220aaecfd3f |
|
MD5 | 86d39c8d1480e7d4ee14489bfa2bf079 |
|
BLAKE2b-256 | e994ba73a14b3e869175752c5dcfcbe39dff643f921520fbda3c157979af293e |
Close
Hashes for gsd-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 051c444f92a31fc566488a9800bcd7eaf5a9c5cb6defa4aabc1778acbad33c6d |
|
MD5 | 7402894f51b6cdc30dc7c909dd584832 |
|
BLAKE2b-256 | 4e4bf23b6fac0d7363b599bf4478b3372061d35e949234a4d99a372a7c07f5c6 |