Tuesday, October 2, 2012

Xcrysden attributes

XCRYSDEN, the favorite visualization tool of all Quantum Espresso users..
OK maybe not that much favorite but you all use it from time to time. It is very handy that it reads and interprets QE input and outputs automagically.
========
It really requires a sort of magic to keep up with the ouput format of QE, that is why it is generally wiser to draw your structures from input files.

You already know this but let me rewrite the command line options regarding pw.x input and outputs :

xcrysden --pwi your_pw_input.in
xcrysden --pwo your_pw_output.in
========
Attributes: Colors and R a d i u s

one thing that might come handy to you all is to use attributes file for the color and radius of elements, so that you wont have to change it manually each time you open a new structure.

an attribute file looks like the following:

cat > attributes.dat << EOF
ELEMENTCOLOR
atomic_no_1 1_red 1_green 1_blue
....
atomic_no_n  n_red n_green n_blue
ELEMENTRADIUS
atomic_no_1 1_radius
....
atomic_no_n n_radius
EOF

atomic no refers to atomic numbers of the atoms you want to change the attributes of.
red, green, blue is to define the new color in rgb setting, scaled within 0-1
radius is the new radius you want to have, obviously.

For making all hydrogens a bit bigger and in  cute pink :)

cat > attributes_file << EOF
ELEMENTCOLOR
1  0.88 0.00 0.42
ELEMENTRADIUS
1 0.9EOF

and then run xcrysden like this

xcrysden -a attributes_file --pwi your_pw_input.in
============
Other attributes

So you can use the above attributes file to change color and radius for each calculation. But that wouldnt be very practical if this was the setting you always want to keep. Also, using an attribute file you can only change the color and the radius. For other properties we have to edit the following file:

~/.xcrysden/custom_definitions 

This is where bunch of settings can be redefined, from printing settings to fonts.
Lets take a quick look at some definitions that can be rewritten in this file and that I actually needed to change on some occasions:
  • set select(dist_precision/angl_precision) n  Precision that the distance/angle etc measurer reports
  • set atmRad(atomic_number) radius Atomic dispay radius
  • set atmCol(atomic_number) {red green blue} color, like in attributes file above
  • set myParam(BALLF) ball_factor Ball-Factor
  • set myParam(RODF) rod_factor Rod-Factor
  • set myParam(FRAMELINEWIDTH) n Crystal cell frame width
  • set myParam(FRAMECOL) {red green blue} Color of the crystal frame
  • set myParam(BACKGROUND) {red green blue} Background color, currently {0 0 0}, I always do white {1 1 1} for papers
  • set myParam(ATOMIC_LABEL_FONT) -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1 This is the current font of atomic labels, in X11 XLFD format. Where the font family, size of the font, italic or upright, bold or medium, spacing etc. can be defined. Play around.
For more, you can take a look at the ~/.xcrysden/custom_definitions file yourself and experiment.

No comments:

Post a Comment