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

Question about whether it is possible to load a diffsims.simulations.simulation2d.Simulation2D object? #223

Open
OverEthanol opened this issue Jul 24, 2024 · 1 comment

Comments

@OverEthanol
Copy link

Hi,

I am currently trying to learn how to do spot pattern indexing using the kinematic diffraction from diffsims.

However, depending how finely I want to discretize the reduced fundamental orientation sector, the computation time for running

diffsims.generators.simulation_generator.SimulationGenerator().calculate_diffraction2d()

can take up a lot of memories and time (especially when the laptop is poor). Hence, I would like to run this simulation process on a cluster instead and then load the simulated results into the Jupyter notebook for indexing. Is such a thing possible to do? If so, how should I save the output object which seems to be

diffsims.simulations.simulation2d.Simulation2D

and how should I load it again?

@pc494
Copy link
Member

pc494 commented Aug 15, 2024

So the crudest way of doing this (although it should still work) is by using pickle. This is fairly well documented see e.g. this. I wouldn't recommend sending pickles around though, if you need to do that you might want to write your own save/load methods. If that's the route you take, we would be happy to review/support and then merge in such methods.

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

2 participants