Visualization of Covid 19 cases in San Diego with Bokeh

Posted on Tue 21 April 2020 in Python • Tagged with Python, Visualization

Visualizing Covid-19 cases in San Diego by zip code using Bokeh

Continue reading

Fitting Complex Metal Dielectric Functions with Differential Evolution Method

Posted on Thu 19 April 2018 in plasmonics • Tagged with plasmonics, python

I use differential evolution method to fit the dielectric functions of metals using Differential Evolution method.

Continue reading

Creating Energy Band Diagrams for Solar cells and LED

Posted on Mon 11 September 2017 in Misc • Tagged with Python

Energy band diagrams are used to visulize the electron and hole transport in Solar cells and LED research. I want to quickly draw them and came up with a python module.

Here's an example on how to use this code.

from Band_diagram import metal, semiconductor, plot

# Define the metals and …

Continue reading

Tab autocompletetion with python interpreter in bash terminal

Posted on Sat 29 October 2016 in Misc • Tagged with Linux, python

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 …

Continue reading

Dealing with plotting negative, zero and positive values in log scale

Posted on Wed 30 March 2016 in Misc • Tagged with Python

Sometimes you have to show positive, zero and negative number in log scale. However you cannot take log of negative numbers and zero. But one could approximate it with a log transform modulus as stated here.

In Python with numpy:

from numpy import sign, abs, log10  
import matplotlib.pyplot as …

Continue reading

Generating plasmonic metal dielectric functions in Python

Posted on Thu 10 September 2015 in Plasmonics • Tagged with Python

I keep needing a python code to generate the dielectric functions of plasmonic materials such as Au, Ag, Pd, and Pt. So I wrote a python version of LD.m.

LD.m is a matlab file written by Bora Ung …

Continue reading

Controlling Rigol Dp832 with python

Posted on Fri 08 May 2015 in Electronics • Tagged with Instrumentation, python

DC power supplies are very handy for electronic projects. They help to apply bias/voltage to a device. Controlling it by a computer by a program is helpful in advanced projects where timing and accurate control is an issue.

I got my hands on a RIGOL DP832 which is three …

Continue reading

Hacking Weighing Scale to Upload Weight to Plotly using Raspberry Pi

Posted on Sat 11 April 2015 in Electronics • Tagged with python

I have been interested in monitoring and keep track of my weight. In the past, I have used different phone apps to track my weight. They work reasonably well, but I was thinking of reading weight data directly from my weighing scale and upload the data to an online database …

Continue reading


Posted on Sun 17 January 2010 in Misc • Tagged with Python

I am playing with Python for the first time. The syntax seems to be so natural. So many modules (numpy, scipy and matplotlib) for researchers/scientists. Cannot see any shortcoming at this point. Perhaps need more testing and implementation.