What information would you like to access specifically?
Analogous to what you would see in the OVITO desktop application, the Construct Surface Mesh modifier adds a new particle property Selection to the data collection, with values of 1 for the surface particles and values of 0 for all other particles.
You can use this information to index into other particle property arrays, e.g., the particle identifiers or particle types:
Also, please set the periodic boundary conditions of the simulation cell within the scope of a Python modifier function that is inserted into the pipeline. See 2nd Attenion Box here for a detailed explanation.
Thank you so much for your message. I have attached a snapshot to show what information I am looking for.
As I explained before, I have a system of particles with a hole in the middle. I invoke the ConstructSurfaceModifier.Method.AlphaShape to identify the surface between the two phases. Then, I would like to extract the IDs regarding particles on the surface (in the snapshot, these particles are represented in red; I removed the other particles in the solid phase were removed to clarify). I do not know how to extract this information by combining Python and Ovito.
I have tried with print(data.particles.identifiers[data.particles.selection == 1]), but the IDs provided do not correspond with the particles on the surface.
That sounds like you might confuse the unique particle identifiers with the particle indices. The latter of course shift when you delete particles from the scene. Please read the Note boxhere.
My apologies. You were right, and I made a mistake reading the array where I store the IDs from data.particles.identifiers[data.particles.selection == 1]. Your solution is correct, and I got the particle IDs on the surface.