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.1.tar.gz
(185.3 kB
view hashes)
Built Distributions
gsd-3.4.1-cp313-cp313-win_amd64.whl
(257.0 kB
view hashes)
gsd-3.4.1-cp312-cp312-win_amd64.whl
(257.7 kB
view hashes)
gsd-3.4.1-cp311-cp311-win_amd64.whl
(259.9 kB
view hashes)
gsd-3.4.1-cp310-cp310-win_amd64.whl
(259.8 kB
view hashes)
Close
Hashes for gsd-3.4.1-cp313-cp313-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0758195efb2952e383201477edf056e7fb0996da94f213d181f1fce682d79da8 |
|
MD5 | 140353fe4df4aa26ba725ce93b16894f |
|
BLAKE2b-256 | 5cdc395a82e7b0d56e6c614d3a716470853ffabb31d761e53ecffbb077ec260e |
Close
Hashes for gsd-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1dd3d56ca1de14d10fc229f54d2d0b7bde6f2bc94207964a715e4d4fa2e57d |
|
MD5 | aa3c170943df7f71fc0d1c1a01e907bc |
|
BLAKE2b-256 | 7cd9f5842768f78209cef3626528abb21bf96cac4713b1455bb5479560537c43 |
Close
Hashes for gsd-3.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b35d2730e97afd6273a887e4e334242c52706af49b171642b3e52339feea88 |
|
MD5 | 720774f163a71c1ee611dab92f517806 |
|
BLAKE2b-256 | 1b373a4f1443d16ba5bbacbca250485a4f35cae34f0744ac3edcc6d99840357f |
Close
Hashes for gsd-3.4.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2be477717066fcac861778c6887e6f2a0a28f69e96797aad51884579b2b99a9 |
|
MD5 | a935ff6a83230347c23b2bf6883c5b96 |
|
BLAKE2b-256 | ae2d0892aa8c9f911f01c934bc5540692070eb356cb4adda7149b19ade4c7ff3 |
Close
Hashes for gsd-3.4.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b98b8323c5c5f3512ccdc0f47e138dbf04a35fe509b33a95303c6c6ac895c6c |
|
MD5 | 3451a580bcab13f625e5bf9b66a48900 |
|
BLAKE2b-256 | 863bf1507ff1eff77505e9bbb64c1e52e406e35bf3fb9d27fd3d81bd00241f6d |
Close
Hashes for gsd-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd36c0ae2656f4471ef7ce8d30584f8b5676c275085f23fc128896191fd21f79 |
|
MD5 | 73ac58d202ccd3c6f80e41ea0ddba782 |
|
BLAKE2b-256 | 8ae56987321a69729e0682949ee65bda12d74a3ed7ef4d80a206886a0dc560f0 |
Close
Hashes for gsd-3.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5f87c77e245f335fe9cd0f190fe8a5ae71c4a4b8221892aeb9898c79df27ce |
|
MD5 | 9c80d984bb230ed51dfbe3aebc91ea8e |
|
BLAKE2b-256 | 0e0ec6571825ae307a7003f5c4f96bc112f866986405970aa0f833ac1dd53a7b |
Close
Hashes for gsd-3.4.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 912e52ea7f120f62cc9d01894ad4f999c74368450a405ec13d7dc73f7942b72e |
|
MD5 | e9e41118e26e00fe31f802fa71ef6720 |
|
BLAKE2b-256 | 09baa5c37bbba419c8ada9c2eccca68a56c5afd66423a25656ab5682b251d74d |
Close
Hashes for gsd-3.4.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e6a99922823144be44042d715ed5650b9e81dfae8068ef1205e40a5bb172418 |
|
MD5 | f851c37335e8a210365413ff304089b5 |
|
BLAKE2b-256 | dfaf180e1d59f414e99d8e1530c8b7a6299c017f2eebe88cab91bf85233316ee |
Close
Hashes for gsd-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a175c441c34cc9a52c07ef69ec7d589c535bc18a8d72caf6769695ff8707ae |
|
MD5 | 6fa9bcde152b0f85186c658c9fc96519 |
|
BLAKE2b-256 | fe34fce489233167c4f8152591a1895e96adababd1f4e83608ae2565c5f7ad89 |
Close
Hashes for gsd-3.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97b6337e3fde3955ea2290c411a26c2e35d1208f8ca90b8e3b223ecd606d56ca |
|
MD5 | 58fb7e1f1b1e219a4a29aa8a903806da |
|
BLAKE2b-256 | bdd3a12230c8b0c4ce3e98b292d3f41e3d17e4dd9e0b258944b9ec1593c51f26 |
Close
Hashes for gsd-3.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f281e7f76e8a6d50cfc30d4899e65d7fa4b71ea99e91c5f614d4ff5497f27f9b |
|
MD5 | dcafdca9245b9e573c338829a1d07eab |
|
BLAKE2b-256 | 99032e6a28fe16fa7a91085af31305e72c6b235d8455dd8229f7e039f7db70f0 |
Close
Hashes for gsd-3.4.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1cb7ab1b096343b78ab8eceaa92479f6b55be711291bc12b183c49e4c881a97 |
|
MD5 | ad1a7cabcdcc807ce7c99fafc4d51b0c |
|
BLAKE2b-256 | 11359a0f3d126b4c1d14b8ccd0939425cfa9f74d72308d330aeca6818510a866 |
Close
Hashes for gsd-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b152614e12f2c0db3784a5c8191c3d8b94742e18131813a0ade50f6f4913a9 |
|
MD5 | 9ec445cc96b2b4fce6673314f52025d2 |
|
BLAKE2b-256 | 93c24e67c334130d3fe837c140dbd8eeb70f730023bf9d529c2be7a9eaab820c |
Close
Hashes for gsd-3.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f878d6668621bb0b5e95ea6c317eeabfc8edb55b5dbe650c500c8c80c93ab40 |
|
MD5 | fbdb18fdc8abfcaee8cffb56ade3c85b |
|
BLAKE2b-256 | 73fe2f69acd6251790314053127f7dc9b476ab6796e4940636467c7be984b2f3 |
Close
Hashes for gsd-3.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b799fb5266ab4a353b2040957ee2940c2909b8a2fa1a5474437675988eef82af |
|
MD5 | 0eb5ea83dcaac313ac7a454d65ba6032 |
|
BLAKE2b-256 | 295afb67963f6796c2282f5a82651d1578c6a1e9cd748cf8ab70eefa866aa83e |