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

r-values not returned in Python histograms() call. #1

Open
tcnicholas opened this issue Nov 19, 2021 · 0 comments
Open

r-values not returned in Python histograms() call. #1

tcnicholas opened this issue Nov 19, 2021 · 0 comments

Comments

@tcnicholas
Copy link

tcnicholas commented Nov 19, 2021

I am using the Python wrapper below to compute the histograms for sets of coordinates. The resultant array h is of the expected shape (1293, 4), however the first column is filled with zeros, rather than the expected r-values from the histogramming. Perhaps I am missing something obvious?

I am running cadishi version 1.1.4, with Python 3.9.7 [Clang 10.0.0 ], on macOS Monterey v12.0.1.

from cadishi.kernel.pydh import histograms
import numpy as np

# define periodic box.
box = np.array([60.4344, 62.7234, 51.7356])

# define number of bins and rmax.
bin_width = 0.02
rmax = 0.5 * box.min()
nbins = int(rmax // bin_width)

# gather together np.ndarrays of coordinates for Ca and O atoms.
coordinate_sets = [ca_pos, o_pos]

# compute histograms
h = histograms(coordinate_sets, rmax, nbins, box=box)

# remove self-distances.
h[0,:].fill(0)

print(h.shape)
print(h)

returns:

                       pydh box_type: orthorhombic
(1293, 4)

[[    0     0     0     0]
 [    0     0     0     0]
 [    0     0     0     0]
 ...
 [    0  2481 19511 40129]
 [    0  2467 19835 40162]
 [    0  2477 19647 40435]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant