pace-neutrons / Euphonic

Euphonic is a Python package for efficient simulation of phonon bandstructures, density of states and inelastic neutron scattering intensities from force constants.
GNU General Public License v3.0
30 stars 11 forks source link

-reorder flag will not correctly reorder phonon bands incorrect with -grace flag #19

Closed durhamb-york closed 4 years ago

durhamb-york commented 4 years ago

When I run dispersion.py to generate a phonon band structure using the following command: $ dispersion.py -reorder -grace Si_wall.phonon This will generate a different band structure from the band structure generated for matplot when dispersion.py is run without -grace flag: $ dispersion.py -reorder -grace Si_wall.phonon Resulting in following two dispersion plots. Reordered_correctly_matlab 'Reordered'_incorrectly_grace Looking at the range of 0.8-1.0 eV it can be seen there are some bands which are reordered in the matplot image and not reordered in the grace plot.

It is possible this is related to other warning message the code prints out:

UserWarning: PyGrace is not installed, attempting to write .agr Grace file anyway. If using Python 2, you can install PyGrace from https://github.com/pygrace/pygrace
  output_grace(data, seedname, up=args.up, down=args.down)
rebeccafair commented 4 years ago

Thanks for bringing this to my attention! Originally, the support from Grace output was added to enable the same functionality as CASTEP's dispersion.pl and dos.pl scripts, however as the project has progressed keeping this functionality may no longer be appropriate, as it adds additional maintenance overhead (especially as I don't use Grace myself) and we should be encouraging users to use Matplotlib. As a result, I was considering removing the Grace functionality completely in a future release.

Is the Grace output something that you need? Or would you be able to just use Matplotlib? If lots of users require Grace output maybe it's something we could reconsider.

rebeccafair commented 4 years ago

It has been decided to implement Grace plotting (and other CASTEP-specific functionality) in a separate project at https://bitbucket.org/castep/dispersiondos at some point in the future. So I'll close this issue.