Git Product home page Git Product logo

Comments (9)

zerothi avatar zerothi commented on July 28, 2024

You must have the sids package in your PYTHONPATH, i.e. if you do:

python setup.py install --prefix=~/SIDS_PATH

you must add this to your .bashrc or equivalent .profile:

export PYTHONPATH=$HOME/SIDS_PATH/lib/python2.7/site-packages:$PYTHONPATH

to enable the sids package.

from sisl.

jinxyu avatar jinxyu commented on July 28, 2024

Hi Nick, many thanks! I will try again! Cheers!

Jin

from sisl.

jinxyu avatar jinxyu commented on July 28, 2024

Hi Nick,

Although running "sgrid -h" displays all possible arguments, I am still a bit confused on how to use these parameters. Would you mind send me an example or a more detailed explanation document? Cheers!

Jin

from sisl.

zerothi avatar zerothi commented on July 28, 2024

Hi Jin,

I still need to finish the documentation for the executables.

However, here is a brief show of what you possibly need:

sgrid TotalPotential.grid.nc tp.cube

this will convert the grid in the potential file to a cube called tp.cube.
However, this will not automatically attach a geometry (atomic species and coordinates). To accomplish this, you need to use the -g or --geometry flag.
The argument of that flag may be any kind of siesta format for coordinates, fdf, xyz, XV etc.
Hence you can do:

sgrid -g RUN.fdf TotalPotential.grid.nc tp.cube

and the cube will also contain the corresponding atomic coordinates.

If you want the difference between two files, say TS=0V and TS=0.5V you can do this (assuming you are in the folder containing the grid file for TS=0.5V):

sgrid -g RUN.fdf -d ../TSrun_0/TotalPotential.grid.nc TotalPotential.grid.nc diff.cube

which then contains the difference cube. If you are using this for different spins, say with Rho.grid.nc, you can perform these:

sgrid -g RUN.fdf Rho.grid.nc[0] spin_up.cube
sgrid -g RUN.fdf Rho.grid.nc[1] spin_down.cube

where the square bracket denotes the spin-index in the NetCDF file. :)
I think this should cover the most basic need for now?

from sisl.

jinxyu avatar jinxyu commented on July 28, 2024

Hi Nick,

Many thanks for your kind instruction! I still encounter some difficulties.

When I ran the following command as you suggested,

sgrid -g 1Ben_free_0d00V.fdf TotalPotential.grid.nc ppp.cube
the system show
"
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 241, in
run()
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 168, in run
args.func(args)
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 218, in grid_action
g = sids.Grid.read(f, var, idx)
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/grid.py", line 424, in read
return get_sile(sile).read_grid(args,*kwargs)
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/io/siesta_grid.py", line 42, in read_grid
with self:
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/io/sile.py", line 237, in enter
import netCDF4
ImportError: No module named netCDF4
"
So I tried to load netCDF4.3.0 by using "module load netCDF 4.3.0" or write "export NETCDF_PREFIX=/apps/netcdf/4.3.0" in .bashrc. They don't fix the problem. Would you mind make your suggestions? Cheers!

Jin

from sisl.

zerothi avatar zerothi commented on July 28, 2024

You need to install the python package netcdf4-python, check the
requirements on the sids front page :)

Kind regards Nick Papior
On 2 Jan 2016 13:00, "jinxyu" [email protected] wrote:

Hi Nick,

Many thanks for your kind instruction! I still encounter some difficulties.

When I ran the following command as you suggested,

sgrid -g 1Ben_free_0d00V.fdf TotalPotential.grid.nc ppp.cube
the system show
"
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 241, in
run()
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 168, in run
args.func(args)
File "/home/566/jxy566/LOCAL_APPS/Python-2.7.6/bin/sgrid", line 218, in
grid_action
g = sids.Grid.read(f, var, idx)
File
"/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/grid.py",
line 424, in read
return get_sile(sile).read_grid(_args,_kwargs)
File
"/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/io/siesta_grid.py",
line 42, in read_grid
with self:
File
"/home/566/jxy566/LOCAL_APPS/Python-2.7.6/lib/python2.7/site-packages/sids/io/sile.py",
line 237, in *enter

import netCDF4
ImportError: No module named netCDF4
"
So I tried to load netCDF4.3.0 by using "module load netCDF 4.3.0" or
write "export NETCDF_PREFIX=/apps/netcdf/4.3.0" in .bashrc. They don't fix
the problem. Would you mind make your suggestions? Cheers!

Jin


Reply to this email directly or view it on GitHub
#2 (comment).

from sisl.

jinxyu avatar jinxyu commented on July 28, 2024

Hi Nick, many thanks!

Jin

from sisl.

zerothi avatar zerothi commented on July 28, 2024

I have updated the documentation for a small brief discussion of the sgrid command, if you have any questions or suggestions to the documentation, please let me know :)

http://zerothi.github.io/sids/bizstyle/scripts/sgrid.html

from sisl.

jinxyu avatar jinxyu commented on July 28, 2024

Dear Nick, many thanks!

Jin

On 04-Jan-16 9:28 AM, Nick R. Papior wrote:

I have updated the documentation for a small brief discussion of the
|sgrid| command, if you have any questions or suggestions to the
documentation, please let me know :)

http://zerothi.github.io/sids/bizstyle/scripts/sgrid.html


Reply to this email directly or view it on GitHub
#2 (comment).

from sisl.

Related Issues (20)

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.