Search This Blog

Friday, December 29, 2006

Geometries from Gaussian Scan

Reading geometries from Gaussian file storing information about Potential Energy Scan (PES) isn't easy. I was sure that there were some tools to do this, but I cannot find any yesterday, so I prepared my own. It is writing in python, of course ;). Right now have very basic features. It reads input file and created output xyz files (as many as stationary points was found). You are using it simply writing in command line:
scaner-0.1.py inputfile

Thursday, December 28, 2006

Greping excitation energy from Gaussian output

I've already written about CIS energies, but my suggestion is more general. You can use that command also for TDDFT calculations. But if you need energies from perturbative correction of CIS method (CIS(D) method) you have to use this:
 grep "CIS(D) Exc\. E" *.log

Thursday, December 14, 2006

'Symmetry' font in LaTeX

If you need nice font for symmetry group names use mathrsfs package and next (example for C2 group) $\mathscr{C}_2$ in the text. Of course you can use it for many other purpose.

Thursday, December 07, 2006

Hack a Rox

I like Rox, but it has some annoying small problems. One of them is that the program which open the file is running from home directory. Now I write short script which fix it for gvim and I'm thinking how to do global...
#!/bin/sh
cd `dirname "$@"`
gvim `basename "$@"`

Wednesday, December 06, 2006

Vim's colorscheme

I've found nice site with sample of Vim's colorschemse. I miss only python samples.

Sunday, December 03, 2006

XymTeX: example

I'm using XymTeX to creating chemical structures in PhD thesis. I'm not fully satisfe, but it create structures' counter , which can be use for numbering and refering to structures. Recently I created Reichardt Betaine subtituted by eter crown. The command which create this picture is below. Is nice, isn't it ;) \begin{XyMcompd}(800,2000)(,-1400){zw:korona}{}
\sixheterov[ace]{4==\upnobond{N}{$\oplus$}} %
{1==Ph;3==Ph;5==Ph; %
4==\cyclohexanev[ace %
{c\sixfusev[ %
{c\sixfusev[ %
{d\sixfusev{2==O;5==\null}{}{A}[ef]} %
]{1==\null;4==\null}{}{F}[de]} %
]{3==O}{}{F}[cde]} %
{d\sixfusev[ %
{d\sixfusev[ %
{c\sixfusev{3==O;6==O}{}{F}[ab]} %
]{1==\null;4==\null}{}{A}[bc]} %
]{5==O}{}{A}[bcd]} %
] %
{4D=={\hspace*{-1.5mm}$| \underline{\mathrm{O}}|^{\ominus}$};1==(yl)}}
\end{XyMcompd}
If you don't like XymTeX you can try konwerter very nice program by Piotr Wawrzyniak.

Monday, November 20, 2006

Energy converter v0.1

I've just created small Python/Tkinter program to convert values of energies. At the moment you can convert from (to) au, eV, nm and cm-1. Not much, but it is beginning :). Program can be download from mml website.

How to list files in subdirectories

I wrote a shell script which allow to list files and only files in all of subdirectiories of current directory. I don't know if it useful but it nice piece of shell code:
#!/bin/sh
for i in `find $PWD -maxdepth 1 -type d`
do
    (cd $i; echo $i; find -maxdepth 1 -type f| wc -l)
done

Saturday, November 18, 2006

The Python Challenge

I nearly become addicted. To what? To Python Challenge. It is a set of puzzle which can be resolved with Python (you can use other language, but it is design for Python). I don't remember when I have so much fun. It is great think if you what to learn Python or just test your skills. It is my 50th note and I started write this blog 1 year and 3 days ago!

Molekel 5.0 alpha

I wrote that Molekel was rebirth and version 4.6 was release. Recently, I found that the project has been moved and alpha version of Molekel 5.0 can be found hear. So, right now we have:
  1. 4.3. It is very old version and the sources are close. [website]
  2. 4.6. The whole project has been rewritten and it is alpha version, not all functions from 4.3 version are working [website]
  3. 5.0 New, not ready yet version with open source (GPL). [website].

Tuesday, November 14, 2006

Physics for 'normal'

I found another interesting blog related to science. This time some physics. You can find there a lot of interesting news: i.e. the info about physics of new NBA ball or fastest waves ever photographed.

Saturday, November 04, 2006

Loooong bash command

I like bash command. This one is quite long:
for ((i=1;i<36;i++)); do if [ $i -lt 10 ]; then j=0"$i" ; else j="$i" ; fi ; wget --no-check-certificate https://www.linux-magazine.pl/issue/$j/; done
It could be interesting for someone, because in one line there are loop (C-style) and if command. This command download the contents of all Polish LinuxMagazine issues. I have got most of LM issues, but searching some information thru them are quite boring. So I thinking about making some kind of 'searching machine' because one from LM website is weak. My command once more, but this in more readable form:
for ((i=1;i<36;i++)); \
do \
 if [ $i -lt 10 ]; \
    then j=0"$i"; \
    else j="$i" ; \
 fi; \ 
 wget --no-check-certificate https://www.linux-magazine.pl/issue/$j/; \
done

Wednesday, November 01, 2006

Mencoder (part II)

My second example of using mencoder: I had the problem with large avi file which didn't fit CD (it had 1.4 gb). I used mencoder to split this file(console rulez ;). Creating of the first part was quite easy (I found the advices here and here).
mencoder -ovc copy -oac copy -ss 0 -endpos 700mb -o movie_part1.avi movie.avi
But there were no info where I should start the second part. I watched the end of the part 1 and manually (eyelly ;) chose the best point to split the movie (for example 1:05:25). This time I could creat two parts.
mencoder -ovc copy -oac copy -endpos 01:05:25 -o movie_part1.avi movie.avi
mencoder -ovc copy -oac copy -ss 01:05:25 -o movie_part2.avi movie.avi

Mencoder (part I)

I like console. So I'm using it even to manipulate video files ;). My first example of using mencoder: I'm recoding files from my camera (Fuji FinePix 5600/5200). It use two passes technique (it should give smaller out file). I don't know if my options are optimal, I found it somewhere (I don't remember where). The input file is the first argument and output file is second argument of my script.
#!/bin/sh
mencoder $1 -ovc lavc -lavcopts \
vcodec=mpeg4:vpass=1:vbitrate=1000:vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01 \
-oac copy -o /dev/null
mencoder $1 -ovc lavc -lavcopts \
vcodec=mpeg4:mbd=2:trell:vpass=2:vbitrate=2000:vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01 \
-oac copy -o $2
Sailing through the net (I tried to find the place with mencoder option) I reached Mario Valle website. It seems very interesting. I have to read it careful and write more about it. Right now, I'm adding his blog to my list.

Thursday, October 19, 2006

SwapFile

Most of people (even Klauss Knopper [1]) think that swap partition has better performance compare to swapfile (Ok. Most of people don't know what is swap file or swap partition ;). However, it isn't true, at least for 2.6 linux kernel. Check thread at Linux-Kernel Mailing list [ 2]. I think the most important is the 3rd point
Does creating the swapfile on a journaled filesystem (e.g. ext3 or reiser) incur a significant performance hit?
and answer
None at all. The kernel generates a map of swap offset -> disk blocks at swapon time and from then on uses that map to perform swap I/O directly against the underlying disk queue, bypassing all caching, metadata and filesystem code.
[1] Klaus Knopper, "Questions and Answers", Linux Magazine Polish ed., 3(25) March 2006, pp 38-40.
[2] Andre Morton et al., "Swap partition vs swap file" thread Linux-Kernel Mailing List, July 2005.

Saturday, October 07, 2006

Camera.sh v2

I rewrite my script for converting raw format pictures. Now, it is converting files from raw to jpg in loop. Doing first convert of all raw files take a lot of space (ppm files are BIG). Right now I need space for one ppm file. Morover, ppm->jpg converting and resizing are made in one step. I found very nice perl program (ExifTool) to managing exif info.
#!/bin/sh

EXIFPATH=/opt/Image-ExifTool-6.36
for raf in *.raf
do 
        dcraw -w $raf
        name=`basename $raf .raf`
        jpg=`basename $name`.jpg
        ppm=`basename $name`.ppm
        echo $name
        convert -resize 800x600 $ppm $jpg
        $EXIFPATH/exiftool -TagsFromFile $raf $jpg
        rm $ppm $jpg"_original"
done

Tuesday, October 03, 2006

Overwriting a line in Vim

Finally, I've learn how to overwrite the whole line in Vim. First you have to yank the line you would like to copy (yy), next to mark the destination line (V) and paste the first line (P or p on it), what gives VP. I found it here.

Monday, September 18, 2006

Blog with many science video lectures

Sometime ago I found Free Science and Video Lectures Online!. It's the place where Peteris Krumins try to list video courses which are related to physics, mathematics, chemistry etc. from all over the world (MIT, Berkeley).

Wednesday, September 06, 2006

Fonts in Linux

There is great HowTo about fonts in Linux.

Tuesday, September 05, 2006

ls and find

I'm all the time learning new things about unix command. Recently, I found new feature of ls and find command.

ls -Ssh
-S lists files and directories in size order,
-s prints size,
-h does it in human readable way.

find -mtime -1
-mtime looks for files modificated later/earlier/exactly n days from now (in my example today and yesterday).

Saturday, September 02, 2006

Benchmarking Filesystems - part II

There is another article benchmarking Linux's filesystems. And the winner is XFS - again.

Tuesday, August 22, 2006

Mcabber

I've found very nice, small but powerful console jabber client. It's name is Mcabber. I also created its port for Crux.

Friday, August 18, 2006

My dalton's problems

I created a website, where I share some info about my problems with Dalton. At the moment there is only one point (problems with HF direct convergence).

Friday, August 11, 2006

Full info about your jobs in PBS

To get full info about job in PBS you have to use -f option, but it doesn't work with -u $USER option, so you get a list of all jobs, or you have to know yours job id. To get around this problem I created this one line 'script':
qstat -f `qstat -u $USER |grep $USER |awk {'print $1'} |sed 's/[a-z.]//g'`
  • qstat -u $USER - create the list of all user jobs,
  • grep $USER - cut lines with usernames,
  • awk {'print $1'} - prints only column with job id (first one),
  • sed 's/[a-z.]//g' - delete all letters and dots from it.
After that you have only id numbers which can be use with qstat -f. You can extent this command further, i.e. to get info about host where you job is running, by adding grep host (it can be very useful at a cluster).

Thursday, July 20, 2006

CCLib

The new version (0.5) of CCLib has been release. CCLib is an open source library, written in Python, for parsing and interpreting the results of computational chemistry packages. It currently parses output files from ADF, GAMESS (US), Gaussian, and PC GAMESS.

Wednesday, June 28, 2006

gaussfield.sh v0.1

It can be very useful to obtain value of some molecular properties in electric field. I.e. you can get dipole moment of excited states from energies in fields F and -F, hyperpolarizability from analytic polarizability etc. But it's quite annoying to create many very similar Gaussian input files, so I wrote short script to created this files:
#!/usr/bin/env bash
for i in $*
do
        name=`basename $i .com`
        sed -e '/^%/d; /^#/s/$/ Field=X-10/' $i > ${name}-x.com
        sed -e "/^%/d; /^#/s/$/ Field=X+10/" $i > ${name}+x.com
done

Monday, June 05, 2006

No CIS(D) in solvent [Gaussian]

I tried to calculate excitation energy with CIS(D) method in solvent (PCM method). I found that the CIS resalts from CIS and CIS(D) outout are different. I checked and CIS with Direct and without this option gave another results. I wrote to Gaussian Help and got replay: Yes, there are differences and the CIS=Direct results are correct.The non-direct methods, both CIS and CIS(D) use MO integrals where the solvent effects are not present and thus neither of them will give the correct results. Starting with G03 Rev. D the program correctly forces the use of CIS=Direct when combined with solvation. There is no option for doing CIS(D) with solvent and I don't expect this to change. Sorry for any confusion.

Thursday, May 25, 2006

Deleting needless pbs files

When PBS queue system's finished your calculation was leaving two info file: [name].o[number] and [name].e[number]. If results were correct you don't need them. To delete all pbs file (and only them*) use this command:
rm -f *.[eo]*
* Of course if you have file with e or o after dot it will be delete too. In this situation you can upgrade command to
rm -f *.[eo][0-9]*
. However, if can fail too if there is number after o or e letter ;). But It's rather unusual situation. You can add this line to your .bashrc file:
 alias pbsdel="rm -f *.[eo][0-9]"
. Now you can use pbsdel to deleting pbs file.

Thursday, May 18, 2006

Massive changes in input files

Imagine, you have to change basis set in 10 files. It is a lot of work. Not really, sed will be your friend. For example, I would like to change 6-31+G(d) into 6-311++G(2d,p) basis set in Gaussian, so I did:
sed -i.bak *.com -e " s/6-31+G(d)/6-311++G(2d,p)/"
. This command created backup of my file. If you would like to change the level of theory in gamess you should write:
sed scf.inp =e "s/scftyp=rhf/scftyp=rhf mplevl=2/" > mp2.inp
Of course you can change much more thinks in any of quantum chemical program.

Friday, May 05, 2006

FujiFilm S5600 digital camera and [not only] Crux

My FujiFilm S5600 (S5200 in US) works out of box with my Crux. The only inconvenience is that the mount point can depend on presences of other usb stuff. I read the udev rules manual and wrote this rule.
BUS=="scsi", KERNEL=="sd*", SYSFS{vendor}=="FUJIFILM",  NAME="%k",SYMLINK="fuji"
It makes the /dev/fuji link, which use as mount point:
/dev/fuji /media/aparat vfat  user,noauto   0    0
To edit pictures from raw format im using UFRaw. It can be GIMP plugin, what is it's big advantage. But when I have more photos I'm using this small bash script to prepare preview in jpg:
#!/bin/sh
dcraw -w *.raf
for i in *.ppm
do
    j=`basename $i .ppm`.jpg
    echo $j
    convert $i $j
    mogrify -resize 800x600 $j
done
rm *.ppm
I found that it is very important to use dcraw with -w option.

Sunday, April 30, 2006

NLO in Gaussian 98/03

Sometime ago Damian Gregory published very nice article about NonLinear Optical (NLO) properties in Gaussian. Later he moved his website into wordress and forgot to transfer this article. Right now "Gaussian98/03 Nonlinear Optical (NLO) Response" is back. BTW. Damian's blog is very nice place for all interesting in so called NanoThechnology. His Nanotechnology Gallery is beautiful.

Friday, April 28, 2006

Molekel

I've just check the website of Molekel one of the most interesting program to visualization Quantum Chemistry date. An there are good news. Yes, they are working on the new version. And Yes, it is GPL program now!

Wednesday, April 26, 2006

How to convert color pdf (ps) to b&w file

I have a pdf file, where foreground color is blue. It is very nice when you look at it at your monitor, but no so nice when you have to print it on b&w printer. Today I found the way how to convert a color pdf (or rather ps) into a b&w file. First you have to convert a pdf into a ps
pdf2ps file.ps
Printing into a file from Acrobat Reader doesn't work. Next you have to download this small perl script and use it
 bw_convert -b file.ps file-bw.ps
Now you have file ready to print on your b&w printer.
I found link to bw_convert script on this FAQu. There are more interesting advices.

Wednesday, April 12, 2006

Regular expression [βzzz from Dalton]

Very often you need only one number from whole output. Going through all the file is boring, especially if you have more then one file. In these situation regular expression are a great help. For example: I needed to find out the value of βzzz. I figured out from an output file that I needed lines with 3 ZDIPLEN words. I prepared the command which should work:
grep "Z.*Z.*Z" *.out
But I got more than I wanted:
betaccs_rhb-631+gd.out:  PUT TRIPLE: ZDIPLEN  ZDIPLEN  ZDIPLEN ON THE LIST. 
betaccs_rhb-631+gd.out: ZDIPLEN  (unrel.) 0.0000  ZDIPLEN (unrel.) 0.0000  ZDIPLEN (unrel.) 0.0000  -383.12517
So I modified my expression (brackets are only in wanted lines):
Z.*(.*Z.*Z" *.out
BTW. If you want to obtaine the correct value of β you'll have to multiply value from output file by -1.

rsp_zfs and gcc 3.4.x [Dalton]

In Dalton FAQ it is written that "g77-3.4.2 (Fedora Core 3) miscompiles DLAMC3 routine from gp_zlapack.F file leading to apparent hang in rsp_zfs test". I had the same problem (hangs of rsp_zfs) on my CRUX with gcc-3.4.4. Adding of -ffloat-store option helps. Moreover, after adding this option Dalton has been build without and failed tastes on Athlon.

Saturday, April 08, 2006

Points style in Gnuplot - part II

My friend Paweł Kędzierski showed me another (better?) way how to present points style in gnuplot. It is describe in docs. (Shame on me!) The ps_symbols.gpi script can be found in gnuplot docs directory or hear. Below you see output from it: BTW I would like to add link to another nice site with gnuplot images. It was created by Petr Mikulik.

Thursday, April 06, 2006

Points style in Gnuplot

It's quite annoying to find the best points styles for your postscript output from gnuplot. I tried to find the site with list of all points style, but I failed, so made my own:
set term postscript
set output "test.ps"
set xrange [0:30]
set yrange [0:30]
set key right bottom
plot   x+1   with linespoints pt 1 title "1",  
       x+2   with linespoints pt 2 title "2",
       x+3   with linespoints pt 3 title "3",
       x+4   with linespoints pt 4 title "4",
       x+5   with linespoints pt 5 title "5",
       x+6   with linespoints pt 6 title "6",
       x+7   with linespoints pt 7 title "7",
       x+8   with linespoints pt 8 title "8",
       x+9   with linespoints pt 9 title "9",
       x+10  with linespoints pt 10 title "10",
       x+11  with linespoints pt 11 title "11",
       x+12  with linespoints pt 12 title "12",
       x+13  with linespoints pt 13 title "13",
       x+14  with linespoints pt 14 title "14",
       x+15  with linespoints pt 15 title "15",
       x+16  with linespoints pt 16 title "16",
       x+17  with linespoints pt 17 title "17",
       x+18  with linespoints pt 18 title "18",
       x+19  with linespoints pt 19 title "19",
       x+20  with linespoints pt 20 title "20"
The result is below. It was obtained by: convert test.ps test.png (and next rotated):

Monday, April 03, 2006

Vim/Vi Cheat Sheet and Tutorial

Deelopers of ViEmu published very nice help for Vim. I've missed something like this.

Saturday, April 01, 2006

Medical Computing

Alex Amies is writing the blog about Medical Computing. It can be interesting for some people hitting my webpage.

Dipole moment in excited state [Gaussian]

To get values of dipole moment obtain with CIS method using Gaussian program you can use this bash command:
egrep "Tot*=|Population" *.log
From all of line you need only the line after Population analysis using the CI density. You can automate it. For example to get the total value of dipole moment use this script (you can write it in one line):
grep "Tot*=" *.log|
 gawk '  BEGIN { currline = 1 }
  {if (currline%3==0){print $9}
  currline = currline + 1}'

Wednesday, March 22, 2006

CESTC 2006

It's quite hard to find any info about Central European Symposium on Theoretical Chemistry 2006. So I'm adding link to the website: http://tiger.chem.uw.edu.pl/cestc/.

Monday, February 27, 2006

Great site about Gnuplot

Gnuplot is very good data and function plotting utility. There are a lot of demos what can you do with in at official website. But advises prepared by Toshihiko Kawano from Los Alamos National Laboratory are amazing. Check this link and learn what you can do with gnuplot!

Friday, February 24, 2006

exit code 139 [Dalton & Bash]

After building dalton program, you should test it. If something is going wrong you'll get Exit Codes. Quite often it is code 139, what means Invalid memory reference (signal SIGSEGV 11 = 139- 128 ).

Wednesday, February 15, 2006

Orbiton - gallery of orbitals

I've just found Orbitron . It is a gallery of atomic orbitals and molecular orbitals on the WWW. The pictures are really nice, but animation of creating of molecular orbitals are great.

New icons in OO2 [not only in Crux]

I was quite upset because standard Crux OpenOffice2 (and 1) port provide default, not so nice, icons. I prefer Ximian ones included i.e. in Debian and Ubuntu. Quite long I tried to find how to change my icons. Finally I did this! I took images_industrial.zip, from /usr/lib/openoffice/lib/config/ (from debian machine). Of course you can choose another one, there are images_crystal.zip (KDE) and images_hicolor.zip. Transfer into me Crux machine and copy on default OO icons set /usr/lib/openoffice/lib/config/images.zip.

Tuesday, January 24, 2006

Excited state parameters in Gaussian

You can get excited state parameters from gaussian log/out file using one bash command:
grep "Excited State *1" *.log
Of course you can change state number (1) and file(s) name (*.log).

Wednesday, January 11, 2006

Benchmarking Filesystems - part I

In the 122nd number of Linux Gazette Justin Piszcz presented second part of his article about Benchmarking Filesystems. Author suggested the XFS is the best choice, however, briefly analysis of results exhibited that JFS could be even better.

Monday, January 02, 2006

Another site about Free Chemistry Software

I found another interesting website about chemistry software. There is only disadvantage of Tom's Free Chemistry Software, it was stop to maintain some time ago... Anyway you can check it, there are still a lof of working links.