Giter Site home page Giter Site logo

galore's People

Contributors

ajjackson avatar crypticboar avatar kavanase avatar utf avatar yaxuan-lii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

galore's Issues

`--no-total` and `--legend-cutoff` options like `sumo`

I think CLI options --no-total (to hide the solid black line of the total XPS spectrum) and --legend-cutoff options as available with sumo-dosplot would be nice additions to the functionality of Galore.

They would be useful options to improve the clarity of output XPS plots, as often the orbital character of the XPS peaks are hidden by the solid black line (if only a single orbital contribution dominates at a given energy range, as is typical) and also the legend often includes many orbital contributions that have negligible contributions to the XPS spectrum.

For example:
image

`--fill-between` option

Similar to issue #42, I think a --fill-between CLI option would be a nice addition to the functionality of Galore, where this gives an output XPS plot with a semi-transparent fill for each orbital contribution (as with sumo-dosplot) which would aid the clarity of the output plots.

I'll try implement this in my local version of galore and make a PR soon.

Separate modes for spikes and distributions

When a (P)DOS is plotted with no broadening specified from the command line, the plot appears to be filled due to zig-zagging of the resampled line. A small amount of broadening, comparable to the sampling width, would be much less "surprising". If the raw unbroadened output is desired, the user could always set -g=0, say.

Galore does not handle comments in KPOINTS files

Describe the bug

If the KPOINTS file from a vasp calculation exists and has #ed comments in it, Galore throws the following error:

  File "/usr/local/bin/galore", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/galore/cli/galore.py", line 56, in main
    run(**args)
  File "/usr/local/lib/python3.6/site-packages/galore/cli/galore.py", line 74, in run
    simple_dos_from_files(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/galore/cli/galore.py", line 144, in simple_dos_from_files
    x_values, broadened_data = galore.process_1d_data(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/galore/__init__.py", line 91, in process_1d_data
    xy_data = galore.formats.read_vasprun_totaldos(input)
  File "/usr/local/lib/python3.6/site-packages/galore/formats.py", line 446, in read_vasprun_totaldos
    dos = read_vasprun(filename)
  File "/usr/local/lib/python3.6/site-packages/galore/formats.py", line 321, in read_vasprun
    band = vr.get_band_structure()
  File "/usr/local/lib/python3.6/site-packages/pymatgen/io/vasp/outputs.py", line 757, in get_band_structure
    kpoint_file = Kpoints.from_file(kpoints_filename)
  File "/usr/local/lib/python3.6/site-packages/pymatgen/io/vasp/inputs.py", line 1186, in from_file
    return Kpoints.from_string(f.read())
  File "/usr/local/lib/python3.6/site-packages/pymatgen/io/vasp/inputs.py", line 1214, in from_string
    kpts = [int(i) for i in lines[3].split()]
  File "/usr/local/lib/python3.6/site-packages/pymatgen/io/vasp/inputs.py", line 1214, in <listcomp>
    kpts = [int(i) for i in lines[3].split()]
ValueError: invalid literal for int() with base 10: '#'

To Reproduce

Using the data in the file attached below, run:

Archive.zip

galore vasprun.xml

Expected behavior

You should get the error message described above.

Images

System information:

  • OS distribution: OSX High Sierra
  • Python version: Brew 3.6
  • Matplotlib version: n/a

Additional context

The problem can be circumvented by removing the KPOINTS file entirely, but this does not seem satisfactory and I can certainly imagine that some users may not easily diagnose the cause of this error in the future.

Broadening width definitions - FWHM?

At the moment the width of the Gaussian and Lorentzian functions are the direct values (γ, c) from the functions:

g(x) = exp(-(x-x˳)² / (2 c² ))
l(x) = 0.5 γ / (π (x-x˳)² + (0.5 γ)²)

Would it be better to convert from a specified full-width-half-maximum FWHM value?
From wikipedia:

I think the γ for that Lorentzian form is already equal to the FWHM, but will check that.

Add Community Guidelines

As per the JOSS Review guidelines, it would be good if you added some info on community guidelines on contribution, posting issues, and seeking support. Doesn't have to be complicated, but always good to be succinct.

It's also a good guide to customize the issue template.

ENH: Interactive tools for fitting

It would be pleasant to have an interactive tool for adjusting the broadening and energy offset of ab initio data and overlaid experimental data.

@utf has done some prototyping with Matplotlib widgets already. Javascript-based plots could be a little bit prettier and more responsive, but would require the broadening functions to be re-implemented.

Bug plotting PDOS

Describe the bug
Plotting PDOS is broken on master (1270488) with error message

    tdos = np.zeros(len(next(pdos_data.values())['energy']))
TypeError: 'ValuesView' object is not an iterator

To Reproduce
galore vasprun.xml --pdos -p

Expected behavior
Generate a plot and not an error message

To fix

  • Fix the error. This is pretty easy, just need to change the way this list is accessed. tdos = np.zeros(len(next(pdos_data.items()[1])['energy'])) should work.
  • Add a test This problem should have been caught by unit testing. We need to check this code runs without raising errors, even if inspecting the plotted output is hard.

MP API and a bug

Thanks for the great package. I have been using it to plot XPS and I would like to suggest a few things:

  1. Allow direct analysis from a CompleteDOS from the Materials Project API (this can be obtained via the pymatgen.ext.matproj.MPRester). I did try using the CompleteDOS object as an input to process_pdos (which the Documentation indicated as being supported), but I think the code logic is wrong because the code expects a string. I think analysis from a pymatgen CompleteDOS is probably the most robust way to code the whole thing because you can then get the CompleteDOS from any source, including LOBSTER (which is another feature request).
  2. offset in plot_pdos does nothing as far as I can tell. This is actually needed because otherwise the binding energies are wrong.

Make project publicly-viewable

I initially made the project private as we hadn't discussed it yet. Everyone seems fairly relaxed about making this generally available; are there any key milestones we should be trying to hit before public release or can we follow the "release early, release often" philosophy and open it up now? @scanlond @utf @badw @cnsavory

Not specifying -p outputs nothing

Would it be possible to write out a .dat file of the output convoluted spectrum? Would be handy to be able to have option to plot output in own graph plotting tool/plot with experiment.

Ability to load VASP files directly

Although I've already written the code to load a DOS from the DOSCAR and POSCAR files, it probably makes sense to write a quick vasprun.xml parser instead. That way only one file is needed for analysis.

The main caveat is that the vasprun.xml file is generally at least an order of magnitude larger than the DOSCAR file. Also, the DOS is given to a greater precision in the DOSCAR file. What do people think?

Input text files for spin-polarised calculations

Is your feature request related to a problem? Please describe.

The output of spin-polarised DOS from sumo doesn't play nicely with the galore lookup for cross-sections.

Example, the O_dos file :
O_dos.dat.gz

If I run galore O_dos.dat --plot --pdos --weighting alka

I get Could not find cross-section data for element O, orbital sup. Skipping this orbital.

Describe the solution you'd like

I would like a solution whereby galore would seamlessly take spin-polarised output from sumo as input. In the way that it can read the vasprun.xml.

Describe alternatives you've considered

I can alter the header of the sumo generated file, but this raises some other probems. E.g. if I change the header to: # energy s s p p d d

The code runs and plots, but I do get the following output, which seems like something has gone wrong:

  Orbital cross-section weights per electron:
   O s: 9.500e-04
Could not find cross-section data for element O, orbital s_1. Skipping this orbital.
   O p: 6.000e-05
Could not find cross-section data for element O, orbital p_1. Skipping this orbital.
Could not find cross-section data for element O, orbital d_1. Skipping this orbital.

Additional context

n/a

automatic latex symbols with Matplotlib

would it be possible for galore to automatically default to truetype font so the figure can be edited easily later? I know you can put this in the matplotlibrc file as pdf.fonttype = 42 but I have been spoilt by sumo which has it by default. ;)

apologies for my laziness!
merci,
Ben

ENH: Colours

An entirely reasonable feature request from @cnsavory .

There should be a way for users to specify a preferred colour palette. Some kind of config file would be more practical than endless command-line strings. I suggest a heirarchy of something like: [file specified as arg] > ./galore.conf > ~/.galore.conf > [defaults]

The absolute worst-case for number of lines would be something like a quaternary system with lots of f-orbitals. In this case the automatic palette should do something clever with line styles and markers.

Consider interface with LOBSTER

Currently Galore relies on the inbuilt orbital assignment of supported DFT codes, which may not be the best approach. The LOBSTER code can also be used to generate an alternative PDOS assignment; it would be worth evaluating if this is helpful for PES simulation.

ENH: Overlay experimental data

As a precursor to interactive cleverness (Issue #7) we should get a basic overlay up-and-running. My initial scope for this is:

  • work with both TDOS and PDOS modes
  • enable with extra flag --overlay FILENAME
  • Allow data in same CSV and space-separated formats as TDOS (re-using infrastructure for these)
  • Add flags --overlay_offset and --overlay_scale for basic alignment tweaks

Working out the appropriate y scale for overlay data is probably going to be a pain. Maybe have a message reporting the automatically estimated value, which makes the maxima the same?

The test case will be rutile SnO2 for comparison with Farahani et al. (2014) https://doi.org/10.1103/PhysRevB.90.155413 - I have a nice DOS calculated with PBE0 which we can use to try and reproduce the plot in the paper.

Option to save galore-plot-cs output as a .csv file

Hello,

Currently galore has the option to provide a plot of the photoionisation cross sections for a specific range of elements using the galore-plot-cs function. However, the output is only provided as a .png file and the format appears to be Matplotlib.

Would it be possible to save the plot as a .csv, .xlsx or .txt file? This would be very useful so that I could plot the graph in a different plotting software (i.e. Origin).

Thanks!

ability to input and scale experiment xps data

don't know how easy it is to implement this, but could be quite handy to scale and match the simulated XPS to the experimental xps data in a plot i.e.

  • flipping the valence band xps data so the x axis goes negative
  • matching the peak intensities of the VB-XPS to the weighted DOS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.