-
Notifications
You must be signed in to change notification settings - Fork 78
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
Getting data #159
Comments
Hey, so this is similar to another issue. Another user wanted the density of states values so they could plot the values using another software. Getting the exact data from the matplotlib.axes object can be a little confusing. Looking at your code, I can't see why this is happening. The solution to this was to collect all the data before plotting and export it to a desired format (json,txt,json,dat). I can't get to this right now, but I will try to in the next couple days. I will update you if I have made some progress. Logan Lang |
Thank you so much for your quick help. I downloaded pyprocar using the command: But I’m encountering the following error: What could I be doing wrong? |
That looks correct. Without more details I have no idea what is wrong. Here are the commands I would use. I make sure pyprocar is uninstall from pip uninstall pyprocar
git clone git@github.com:romerogroup/pyprocar.git
cd pyprocar
pip install -e . Let me know if this works. Logan Lang |
I followed your instructions, but I'm still facing the issue. When I run the following code:
I get the output: However, when I run the same code after installing pyprocar with It seems like something isn't being installed correctly. Heeju |
Ummm it is hard to follow what you have done but you have to check your installation. It is not a problem of PyProcar.
Check if you do not have different python installations or packages with different versions… that happens if you install python using different sources (conda, miniconda, etc). With the lines you wrote, I was able to install it (for two different machines) with no problem raised. Sorry we cannot help much if your python installation has a problem.
…______________________________________::::__________________________________________
Prof. Aldo Humberto Romero
Director Research Computing, West Virginia University
Eberly Family Distinguished Professor
Fellow American Physical Society
Editor Physica B, Assistant Editor EPJB, Editor Frontiers in Physics
Section Editor Papers in Physics
Member of the Editorial Board of “Materials” and “Symmetry Physics”
https://scholar.google.com/citations?user=pwte-hQAAAAJ&hl=en
Physics and Astronomy Department
West Virginia University
135 Willey Street, PO Box 6315
111 White Hall
Morgantown, WV 26506
Phone: 304-293-6317
Fax: 304-293-5732
email: ***@***.***
From: HeejuKim95 ***@***.***>
Date: Thursday, August 15, 2024 at 10:16 AM
To: romerogroup/pyprocar ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [romerogroup/pyprocar] Getting data (Issue #159)
I followed your instructions, but I'm still facing the issue.
When I run the following code:
import pyprocar
import os
print(dir(pyprocar))
I get the output:
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
However, when I run the same code after installing pyprocar with pip install pyprocar, I get:
['BandStructure2DHandler', 'FermiHandler', 'Parser', 'ProcarParser', 'Settings', '__author__', '__builtins__', '__cached__', '__copyright__', '__date__', '__doc__', '__email__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__status__', '__version__', 'abinit', 'autobandsplot', 'bandgap', 'bandsdosplot', 'bandsplot', 'bxsf', 'cat', 'cfg', 'core', 'dftbplus', 'dosplot', 'download_dev_data', 'download_example', 'download_examples', 'elk', 'fermi2D', 'filter', 'frmsf', 'generate2dkmesh', 'io', 'kpath', 'lobster', 'parser', 'plotter', 'procarparser', 'pyposcar', 'qe', 'repair', 'scriptAutoBandsplot', 'scriptBandGap', 'scriptBandStructure2DHandler', 'scriptBandsDosplot', 'scriptBandsplot', 'scriptCat', 'scriptDosplot', 'scriptFermi2D', 'scriptFermiHandler', 'scriptFilter', 'scriptKmesh2D', 'scriptKpath', 'scriptRepair', 'scriptSpin_asymmetry', 'scriptUnfold', 'scripts', 'siesta', 'spin_asymmetry', 'unfold', 'utils', 'vasp', 'version', 'welcome']
It seems like something isn't being installed correctly.
Heeju
—
Reply to this email directly, view it on GitHub<#159 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB24DTPOHBQ73I3FMD36T2TZRSZ25AVCNFSM6AAAAABMKUXXBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGM2DSMZUGY>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Yes, follow what ahromero, by checking the installations and pacakges. I would advise to do a fresh install. Here, I create a virtual environment to make sure python isn't using the default interpreter, which might have the error. conda create -n pyporcar python==3.9
conda activate pyprocar
git clone [email protected]:romerogroup/pyprocar.git
cd pyprocar
pip install -e . I just did this, and it is working for me. Best, Logan Lang |
Thanks! I think the problem was that I kept installing and uninstalling, leaving behind some cache or remnants. I tried again in a new environment, and it worked! I'm already very pleased with the export_data_file option you provided. However, I think it could be improved if the output format were slightly different. Since gnuplot, a widely used visualization tool, plots graphs based on columns, it would be more convenient for more people if the data were organized with the kpath values in the first column, band energy in the second column, and weight in the third column. Anyway, I've solved all my problems, so thank you very much! Heeju |
Thanks for your suggestion… I think you can easily generate a script to modify the output to the most convenient form for you…
…______________________________________::::__________________________________________
Prof. Aldo Humberto Romero
Director Research Computing, West Virginia University
Eberly Family Distinguished Professor
Fellow American Physical Society
Editor Physica B, Assistant Editor EPJB, Editor Frontiers in Physics
Section Editor Papers in Physics
Member of the Editorial Board of “Materials” and “Symmetry Physics”
https://scholar.google.com/citations?user=pwte-hQAAAAJ&hl=en
Physics and Astronomy Department
West Virginia University
135 Willey Street, PO Box 6315
111 White Hall
Morgantown, WV 26506
Phone: 304-293-6317
Fax: 304-293-5732
email: ***@***.***
From: HeejuKim95 ***@***.***>
Date: Thursday, August 15, 2024 at 12:04 PM
To: romerogroup/pyprocar ***@***.***>
Cc: Aldo Romero ***@***.***>, Comment ***@***.***>
Subject: Re: [romerogroup/pyprocar] Getting data (Issue #159)
Thanks! I think the problem was that I kept installing and uninstalling, leaving behind some cache or remnants. I tried again in a new environment, and it worked!
I'm already very pleased with the export_data_file option you provided. However, I think it could be improved if the output format were slightly different. Since gnuplot, a widely used visualization tool, plots graphs based on columns, it would be more convenient for more people if the data were organized with the kpath values in the first column, band energy in the second column, and weight in the third column.
Anyway, I've solved all my problems, so thank you very much!
Heeju
—
Reply to this email directly, view it on GitHub<#159 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB24DTMCNXUCATVOPVM3OUDZRTGRRAVCNFSM6AAAAABMKUXXBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGYYDOOBZGE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Hey Cardenas97, Apologies for the delayed response—my graduate school workload has been ramping up. Just to confirm, you're asking for the data in a similar format to what is discussed earlier, correct? For the plots, we first identify the contours and then interpolate the projection values onto the surface. When plotting, we use I can provide you with the points that define the contours along with the interpolated projection values. Would this format work for you? I can deliver the data in CSV, JSON, or DAT format. For example, in CSV, the columns would represent the points per band contour, followed by the projection values per band. If this doesn't meet your needs, you would have to extract the data directly from the Best regards, |
Dear Logan, Thank you for your response. Yes, I would appreciate it if you could provide the interpolated points in a .csv or .dat file, with each column representing an orbital. That way, I can plot the data myself using scatter points, as you suggested. I also wanted to take the opportunity to ask you something about my current project. I am trying to plot the 2D projected orbitals onto the 2D Fermi surface of a tetragonal system (a = b ≠ c) at k_z = 0 . However, when I attempt to rotate the system using the command rotation = [90, 1, 1, 0], it does not work, and I receive an interpolation error: '''' precision problems (corrected unless 'Q0' or an error) The input to qhull appears to be less than 3 dimensional, or a Qhull could not construct a clearly convex simplex from points:
Best, |
I will work on this.
I am able to reproduce this error, this issue is being cause by degenerate points in the x,y plane. In our code we create a mesh grid for the x and y directions because we assume these are in-plane. x, y = self.kpoints[:, 0], self.kpoints[:, 1]
# and new, interpolated component
xmax, xmin = x.max(), x.min()
ymax, ymin = y.max(), y.min()
self.log.debug("xlim = " + str([xmin, xmax]) + " ylim = " + str([ymin, ymax]))
xnew, ynew = np.mgrid[
xmin : xmax : interpolation * 1j, ymin : ymax : interpolation * 1j
] The reason why this happens is due to the system being tetragonal (no orthogonal axes) and the rotation. Currently, I do not know how to solve this issue. I will have to talk to some of the other developers on this. Another possible solution is to use the Fermi3D implementation and use the cross section slicer. The reason for the rough surface is due to the lack of points. This is solvable by increasing the kmesh and/or use the fermiHandler = pyprocar.FermiHandler(
code="vasp",
dirname=data_dir,
apply_symmetry=True)
fermiHandler.plot_fermi_cross_section(
slice_normal=(1,1,0),
slice_origin=(0,0,0),
cross_section_slice_linewidth=5.0,
mode="parametric",
orbitals=orbitals,
interpolation_factor=1,
save_2d_slice=f'{data_dir}/image.png',
atoms=atoms,
show=True,) You will need to download the main branch from git for this. pip uninstall pyprocar
git clone [email protected]:romerogroup/pyprocar.git
cd pyprocar
pip install -e . Best, Logan Lang |
Dear Logan, Thank you for your suggestions. They worked very well and matched the expected results from other studies. I hope I can also extract the orbital projections as suggested in our previous messages. Best, |
Hello, developers,
I want to extract data using pyprocar and then use another visualization tool (such as gnuplot) to plot the graph.
So, I coded as below to extract the data and create a new file with x, y, colorweight, and other necessary data.
However, the third column (probably the color weights) keeps getting rounded to two decimal places.
I need it to be rounded to three decimal places.
How can I adjust this to get three decimal places?
Also, why does the third column show all zeros when I use the parametric method?
Thank you in advance,
Heeju
The text was updated successfully, but these errors were encountered: