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.3.2.tar.gz
(182.3 kB
view hashes)
Built Distributions
gsd-3.3.2-cp313-cp313-win_amd64.whl
(251.6 kB
view hashes)
gsd-3.3.2-cp312-cp312-win_amd64.whl
(252.4 kB
view hashes)
gsd-3.3.2-cp311-cp311-win_amd64.whl
(254.4 kB
view hashes)
gsd-3.3.2-cp310-cp310-win_amd64.whl
(254.3 kB
view hashes)
Close
Hashes for gsd-3.3.2-cp313-cp313-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1898ec1dd2fcc4e65c9c50c38920c054319246606cbd6aa984682102ee49f4d4 |
|
MD5 | 5ef4fa7e0d28902c408f37473c1c28ce |
|
BLAKE2b-256 | 1c33c11703800f8c2850c111e619387c32d745e5f28ebd5e740f291af7b5f856 |
Close
Hashes for gsd-3.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2e30e1dfa1bb88f42647987bba463a50aa32fdd785ac175ae1f02516b50172 |
|
MD5 | ca22cb1a5239b9302e9eb5ee119b616c |
|
BLAKE2b-256 | bfa1ce7cdc6283e6b3f235eecd3cf9937388ff2a00ef88b7dcd4058513da98ca |
Close
Hashes for gsd-3.3.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07aca3cf710b3be358bb087e285cbf684655dd3a76db95e8732f3be95437eaaa |
|
MD5 | 266f3c19b11f34a1a5a2f143bd7480bf |
|
BLAKE2b-256 | 98fe5a2e63c3fa5c54115c96ef4088803a6568e4c2d4800d6bb07805fae7cd2c |
Close
Hashes for gsd-3.3.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2111d4478f48f988664e2349c9fd8cc1008ac9af8cc72c418557efaa33477e2b |
|
MD5 | 84e76e62d6acbd0de9359b172cc9fde2 |
|
BLAKE2b-256 | 05df881ca68bfffaaa5fb7c6b33b868455d441396035deb5a4369daccc3d1257 |
Close
Hashes for gsd-3.3.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e4166bdacb6c706d1c9e5b0195d22a5e3cc4e6b11cc285783a19f101d0206da |
|
MD5 | 9b6c69ca44ed927a6fe76048a198d89d |
|
BLAKE2b-256 | 4c64ea9b329a45a0a9ae14502eae84137fb4e2d36e057c4a40dc0ce0106058ed |
Close
Hashes for gsd-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96052b774e3d9c4ce6ae28b639e9e847fe1a104064d4a88d6d078c3e1b525eb1 |
|
MD5 | 9b4bfa823dbf6546c14ed3176e317688 |
|
BLAKE2b-256 | e8466ac391f03ab4cad9708311b6e529e424b4dd883f2fe1c0da309e335bce93 |
Close
Hashes for gsd-3.3.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64c9f83d4411ad0f484f201195e44cda399d2ce6b8c7be4f33faa3c08d874983 |
|
MD5 | 01088985633db3f603462c5de8bbdcb3 |
|
BLAKE2b-256 | 9d56e093ab105ddc39f8f4ac103cea4b2cf9094d275b12f190584af420d43a15 |
Close
Hashes for gsd-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8505c999cef33d3676ac6833b577a646b94647555f5dda1a416ef50b7007d391 |
|
MD5 | c0cc6176ee9d767276b469638a3b55f2 |
|
BLAKE2b-256 | bf60f7745a1cb4091bc89d674ba819f5e8b09068408a51788788ca5f9ba078da |
Close
Hashes for gsd-3.3.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70fb424b6e670966ccc4844648567479f8c0483c2b318d1db486107a7982bf64 |
|
MD5 | 6c182ef390d626c01763e3d13c9a1bf2 |
|
BLAKE2b-256 | 7f49868783a15aa0990f272ce29c4c06567ee1e090f922a8b4cd2c3096e62f86 |
Close
Hashes for gsd-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c80a58242f9003f5d8c5166513e9bced4eb126920a4ed9c386ac2967222327d0 |
|
MD5 | 8e800976516610e422e2cc49ba785da2 |
|
BLAKE2b-256 | bbd1a6290f812821b3eab351710eeb53a03301a3f6ff0b5827bf7c14c9bdec0f |
Close
Hashes for gsd-3.3.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a403a848f343bff44b348ed9fb6ac61b6ab9da5cd609518bc909a5afba594c6 |
|
MD5 | 5606334687db70e38d0bd7836adbd6c6 |
|
BLAKE2b-256 | d18124790dd104115e64d775f0680343448d388fbf84b533137be83952e2306b |
Close
Hashes for gsd-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0377cd01fba50ae5048281d754bf272a035ef17da3cbb596006ffdd71b72d00 |
|
MD5 | 55ca429395995faaedadcceeb70e5499 |
|
BLAKE2b-256 | 69f0b25fe2400f55a89c5d8c624e1427ba5e26eacf2e191093439afdeccbf4e2 |
Close
Hashes for gsd-3.3.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e9150e0cf5a3dd91462be92738f94c239b769ee0f8e3b8ed56609fc4a83e7a |
|
MD5 | 98d9ad82ea63cc500426deebe798a0b5 |
|
BLAKE2b-256 | 3385b192274839475f70e4c2eff0d66bd07e2ecc4f154e013f1574aea3afa930 |
Close
Hashes for gsd-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3867bff00276005a7837b93450b9004fac7a476d0c042fc4f27c3c5d73cb18d2 |
|
MD5 | c0ba571264957e5da0b263abdd254711 |
|
BLAKE2b-256 | 5322780871e9e974c9c0f0afff0e6aaa523b669e59b6f9d55a6361f5aef80b46 |
Close
Hashes for gsd-3.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3221c63da6f84cac5126a8e525e9d0f1cbed9d4d3d8c1bb286bf7c6e5d928de2 |
|
MD5 | cfc90a1cbeab4e52969dfcc8d05b06f6 |
|
BLAKE2b-256 | 949a3b325479af2bc58438935b144075106dd6e06e24f86a681bc3f7c80d8111 |
Close
Hashes for gsd-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f4c7f3be20abe59825131b695a30994332520b6dcbcb8cde8b9229fe8bcb46 |
|
MD5 | 728fd4b90e2c6d4bcd862de5ad00931a |
|
BLAKE2b-256 | a835877700dc3521abe6d17d938043ca51cf0a774538def607a31e591187b1da |