Selection of trajectories for each frame for Z<a

7 views
Skip to first unread message

Otakandza Glenn

unread,
Nov 2, 2021, 10:47:50 PM11/2/21
to mdnalysis-...@googlegroups.com
Hello everyone,

I am a new user of Mdanalysis,
I have a system with 2 types of atoms and I would like to make a selection according to the z coordinate, that is to say a sorting according to the z axis, for each frame.

By the way I want for each frame a numpy array or a Dataframe with the selection on the condition given at z.

I have read the documentation, I have tried many things, I can't find any solution.

Is there a possibility to filter the coordinate data with MDAnalysis?

Thank you very much for your help

Lily Wang

unread,
Nov 3, 2021, 11:26:26 AM11/3/21
to mdnalysis-...@googlegroups.com
Hi Otakandza,

Welcome to MDAnalysis!

Have you tried the `prop` keyword? For example, the below selection selects all atoms with an x coordinate under 5 A, y coordinate under 5, and z coordinate under Z, and updates over each frame.

u.select_atoms("prop x < 5 and prop y < 5 and prop z < 5", updating=True)

There is more about the selection language in the user guide: https://userguide.mdanalysis.org/stable/selections.html

Hope that helps!

Cheers,
Lily

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/CA%2BX%2B9EXEi%3D-tu8U1XfMdtobPvZdUA_tiA%3DrBgwjcFq0fZkKt%2Bw%40mail.gmail.com.

Otakandza Glenn

unread,
Nov 3, 2021, 11:39:15 AM11/3/21
to mdnalysis-...@googlegroups.com
Hi Lily Wang,
Yes, I have seen and tried this syntax but I can not read all frames and all atoms of my file as mentioned in my post from a few minutes ago.

thanks a lot ,

Sincerely,





Reply all
Reply to author
Forward
0 new messages