Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for reading and writing 3D (grid) data sets #624

Merged
merged 28 commits into from Jul 27, 2018

Conversation

drroe
Copy link
Contributor

@drroe drroe commented Jul 26, 2018

Addresses #623 and adds some enhancements for reading/writing 3D data.

  • 3D data sets written in "standard" format can now be read back into cpptraj in either floating point or double precision.
  • 3D data sets written in "standard" format now contain dimension, origin, and spacing information.
  • Bin (voxel) X Y Z coordinates are now always correct - previously did not correctly take into account origin or step, and were completely wrong for non-orthogonal grids.
  • Bin coordinates for non-orthogonal grids are now correctly adjusted when origin is not 0,0,0.
  • 3D data sets written in "standard" format can now be written as "sparse" (i.e. empty voxels are not written) - this can provide significant size savings.

Adds the following syntax for 3D "standard" reads:

read3d:      Read data as 3D grid. If no dimension data in file must also
             specify 'dims'; can also specify 'origin' and 'delta'.
	dims <nx>,<ny>,<nz>   : Grid dimensions.
	origin <ox>,<oy>,<oz> : Grid origins (0,0,0).
	delta <dx>,<dy>,<dz>  : Grid spacing (1,1,1).
	prec {dbl|flt*}       : Grid precision; double or float (default float).
	bin {center|corner*}  : Coords specify bin centers or corners (default corners).

Adds the following syntax for 3D "standard" writes:

nosparse   : Write all 3D grid voxels (default).
sparse     : Only write 3D grid voxels with value > cutoff (default 0).
	cut : Cutoff for 'sparse'; default 0.

Also adds several tests.

drroe and others added 26 commits July 25, 2018 09:27
…coordinates since this is not c

orrect for non-orthogonal grids; use DataSet_3D::Bin() instead. Will need to eventually rework the w
hole dim_/Coord() framework.
…culating bin corner/center for nonorthogonal grids
…Amber ascii restart, avoids major precision loss.
… now contain dimension information. Also the bin coordinates that are written out are now always correct.
…s have the same return value from a command.
@drroe drroe merged commit 1811cfb into Amber-MD:master Jul 27, 2018
@drroe drroe deleted the data_3d_read branch July 27, 2018 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant