Forum Navigation
You need to log in to create posts and topics.

How to change dimensionality of dataset in Python script


I'm writing a script that takes in a .xyz formatted file but I want it to compute properties in 2D. In the GUI, there's an option under the simulation cell to change the dimensionality to 2D but I couldn't figure out how to do this in a script. Is this possible? If so, how would it be done?

Thanks for your help!


the SimulationCell Data object has a flag is2D which you should set to True, see

pipeline = import_file(<your-file>)

def my_modifier(frame, data):
    data.cell_.is2D = True

#Add more modifiers
result = pipeline.compute()

Let me know if you have further questions,

- Constanze

This helps a lot. Thank you!