libAtoms/extxyz

How to sort ase xyz file according to ascending order of energies

Amitcuhp opened this issue · 4 comments

How to sort ase xyz file in ascending order of energies

Very thankful to you in advance

Thanks Noam. I tried to edit out the bogus links above, but it seems email replies don't support Markdown. Here's a copy-pastable version

python -c 'import ase.io; ase.io.write("outfile.xyz", sorted(ase.io.read("infile.xyz", ":"), key=lambda at: at.info["energy"]))'

Thanks for your help. I am very thankful to you.

Can you tell me one think more please:

How to add values to all the energies .
in simple words , i want to add 200 to all energies values...can u help