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

Python Script to Turn a PDIS into a plot #13

Open
ajm143 opened this issue Sep 12, 2019 · 2 comments
Open

Python Script to Turn a PDIS into a plot #13

ajm143 opened this issue Sep 12, 2019 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ajm143
Copy link
Contributor

ajm143 commented Sep 12, 2019

Write a python script to turn pdis into a plot (the input to this program will be a file with the structure of a 'bands' file)

@ajm143 ajm143 added the enhancement New feature or request label Sep 12, 2019
@ajm143 ajm143 added this to the v2.0 milestone Sep 12, 2019
@ajm143 ajm143 added the help wanted Extra attention is needed label Sep 12, 2019
@ml-evs
Copy link
Contributor

ml-evs commented Sep 12, 2019

I've already implemented this as part of matador (in spectral_plotting submodule), see example below. We discussed extracting the relevant plotting functions from matador to do arbitrary projected bandstructure plots in this manner (for e.g. contributions to EELS); this will require a fair bit of extra work as the matador dispersion script depends on all of the matador scraper functions and data classes. If you wanted to depend on matador directly it'd spur me to register a package on PyPi, though I will only support Python 3.

LCO

The core plotting routine is _ordered_scatter which ensures the smallest contribution is always plotted on top and interpolates the bands for smoothness.

Happy to help out, whatever you decide.

@ml-evs
Copy link
Contributor

ml-evs commented Oct 4, 2019

After a quick discussion with @ajm143 we have a few options:

i) I try to extract the relevant parts of matador into a standalone Python 3 script that only depends on matplotlib and numpy (which I think is a reasonable expectation). This will obviously have to be maintained somehow...

ii) Depend on matador as a git submodule only with a simple entry point Python script from inside OptaDOS (linked at compile time) that provides the same functionality as (i), but hopefully maintenance will carry on at the matador end (and I'd be happy to include any other projections that get introduced to OptaDOS).

iii) Write a script that somehow generates Python code that will make the plot in a customisable way (a la current xmgrace solution). This will be tricky, and any editing of the script will probably require Python knowledge...

The main problem here is the lack of customisability compared to the xmgrace plot. In matador I adhere to the user's matplotlib style sheet (examples) so perhaps writing a script that also does this with e.g. a user-defined map between projection labels->colours is the most useful thing to do, with either (i) or (ii) above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants