Tab autocompletetion with python interpreter in bash terminal

I want to tab autocomplete commands in my python interpreter within bash terminal. This is very useful when I import a module and just want to browse through the methods and autocomplete. Found two ways to do it. Thanks to stack overflow posts. Method 1 (as mentioned here): This is easy. Install pyreadline (pip install pyreadline) and use ipython. This is a snapshot of it working. Method 2 ( as mentioned here): This is for standard  python interpreter in bash terminal (such as in Ubuntu). This method requires readline and rlcompeter modules. Install these modules if you do not have Read More …

Parallelization in Octave using parcellfun/pararrayfun

My computer has many processors and I would like to run some octave scripts so that all the processors are being used. One can use octave function called “pararrayfun” for this purpose. This function is part of “general” package on octave-forge. On my ubuntu 11.10, I used “sudo apt-get install octave-general” to install this package and ran the following script 1; # this is kept to Prevent Octave from thinking that this is a function file: close all; clear all; function y=test(a,b) y=sin(a)+cos(b) endfunction num_process=8 a_test_inputs=[0:3.14/20:3.14]; b_test_inputs=[0:3.14/20:3.14]*2; tic (); tt_par= pararrayfun(num_process,@test,(a_test_inputs),(b_test_inputs)); parallel_elapsed_time = toc () tic (); tt_ser= test((a_test_inputs),(b_test_inputs)); serial_elapsed_time Read More …

WINSPALL software for surface plasmon resonance experiments

One needs to fit the reflectivity curves obtained in surface plasmon resonance experiments with theoretical models. A free software (for non commercial use) called Winspall exactly does that. According to the developers, WINSPALL is a PC based software which computes the reflectivity of optical multilayer systems. It is based on the Fresnel equations and the matrix formalism. It can be used to analyze surface plasmon experiments. WINSPALL was developed in the Knoll group. WINSPALL is available for use without charge. It may not be reused for commercial purposes. It is available for download here. you can download the software from Read More …

My list of most used packages for ubuntu

To install octave, gnuplot,numpy,scipy,matplotlib,gcc-4.2-base, gfortran sudo apt-get install octave gnuplot \ ipython python-numpy python-scipy \ python-matplotlib wine gcc-4.2-base gfortran-4.2 To install graphics programs: gimp, imagmagick and inkscape sudo apt-get install inkscape gimp imagemagick To install most of the multimedia requirements  sudo apt-get install vlc mozilla-plugin-vlc gstreamer0.10-ffmpeg \ gstreamer0.10-fluendo-mp3 gstreamer0.10-fluendo-mpegdemux \ gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse \ gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse w32codecs To install Microsoft fonts sudo apt-get install msttcorefonts To install latex relates stuff, kile sudo apt-get install texlive kile texlive-latex-extra texlive-xetex lmodern To install utilities: sudo apt-get install subversion unrar kdiff3

Radiation from an oscillating dipole

The electric field from an oscillating dipole is given by:, where is the position vector, is the frequency of dipole oscillation, is the dipole moment. The two terms in the electric field consists of 1) near field (area near to the dipole) and 2) far field (area far from the dipole) contributions. Far field falls of as and the near field falls of by . A beautiful simulation showing the electric field radiation from a dipole is shown below. This simulation is part of Sophocles J. Orfanidis book on electromagnetic waves and antennas.  For more details on 1) how the Read More …

Surface Plasmons (SP’s)

Surface plasmons (SP’s) are electromagnetic waves that propagate at the interface between metals (such as Ag, Au ) and dielectric material. Here I have simulated the propagation of surface plasmons on Ag-air interface, the color indicates the magnitude of electric field (blue for positive and red for negative).  I have used MEEP  (a FDTD program that solves for Maxwells equations on numerical grid) to simulate these electric field distribution of these special waves. The source for SP’s is a point dipole and is placed at the center. It is easier to excite SP’s in numerical simulation, however to excite them Read More …

Plasmonic coupling of electromagnetic energy in hexagonal array of silver nanorods

A cool animation which I reproduced from W.M Saj, Optics Express, Vol 13, 13, 2005 using freely obtained FDTD software (MEEP). It demonstrates the propagation of electromagnetic energy in hexagonal array of silver nanorods due to plasmonic coupling. The source is offset from the center and the energy is propagated in an interesting snake like pattern. For more details about this kind of propagation,  look at the article (W.M Saj, Optics Express, Vol 13, 13, 2005).

Split, collate, watermark and password protect PDF documents using portable pdftk

To split, collate, watermark and password protect pdf documents, I use pdftk portable app. pdftk is one of numerous applications that come with  PortableApps.com free software. This platform can be installed on any portable USB drive and can be run on any computer without administrative privileges. More information can be found here and here. A screen shots of portable apps and pdftk are shown below: [nggallery id=1]