Skip to content

distance.distance_array() produces wrong results #4

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

 import MDAnalysis,MDAnalysis.distances
 universe = MDAnalysis.Universe('x.psf','x.dcd')

 solvent = universe.selectAtoms('name OH2')
 protein = universe.selectAtoms('protein and not name H*')

 s_coor = solvent.coordinates()
 p_coor = protein.coordinates()

 d = MDAnalysis.distances.distance_array(s_coor,p_coor)

The distance matrix is wrong (compared to, say, what one sees in VMD).

If one uses the workaround of copying the arrays then the results make sense:

 s_coor = solvent.coordinates().copy()
 p_coor = protein.coordinates().copy()

According to Naveen the problem was that the distance_array() C function
assumes contiguous arrays. However, until rev 74, AtomGroups.coordinates()
would return an non-contigious array. This was fixed in rev 75. See
http://code.google.com/p/mdanalysis/source/diff?old=63&r=75&format=unidiff&path=
%2Ftrunk%2Fpython%2FAtomGroup.py

However, it's not clear if this really solved the problem. Some evidence
says this is not so.

We need a decent test case and then look at this carefully again.





What is the expected output? What do you see instead?


Please use labels and text to provide additional information.



Original issue reported on code.google.com by orbeckst on 31 Jan 2008 at 3:42

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions