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

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10 …

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

Coupled Dipole Approximation in Python

Posted on Wed 20 July 2016 in Plasmonics • Tagged with electromagnetism, Plasmonics, python

Coupled dipole approximation (CDA) method is a numerical method to calculate the optical properties (scattering and absorption) of interacting dipoles. This method is used in discrete dipole approximation method (like in DDSCAT software), where a big particle (also known as target) is broken into lot of interacting dipoles arranged in …


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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10 …

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 that produces dielectric functions of metals either for Lortenz and …


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

Python

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.