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

Understanding Probability and Randomness using a coin

Posted on Sat 18 April 2020 in Python, Statistics

I was refreshing my understanding of probability and random chance. I think that a simple experiment of tossing a coin and observing the result is very useful in understanding these concepts.

As we know a coin when tossed/flipped will result either in a HEAD or TAIL. So a simple …


Continue reading

VIM for Python Development

Posted on Sun 19 January 2020 in Python, Vim

I have been using VIM lately for software development in Python. I gave a lightening talk on my experiences using VIM at San Diego monthly meetup.

You can see my presentation slides here

You can see my reveal-js source here


Improving code using getters and setters in Python

Posted on Wed 04 December 2019 in Electronics

As I was migrating blog posts from my wordpress website to pelican based static website, I noticed an old python code written for communicating and controlling a Princeton Instruments Acton SP2150i Monochromator.

As I looked at the code, I noticed methods in the class such as get_nm() and set_nm(). I …


Continue reading

Calculating molarity, weight concentration from absorbance value for plasmonic nanoparticles in solution

Posted on Wed 20 June 2018 in Plasmonics

It is common to measure the peak absorbance of the plasmonic nanoparticles in solution and then get the following:

  1. Molarity (moles/liter)
  2. Number of particles per ml
  3. Weight concentration (ug/ml)

I wrote a small python function to extract these parameters.  The following inputs are needed for the function

  1. d_nm …

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

Did I turn off the stove...ESP8266

Posted on Sat 08 October 2016 in Electronics • Tagged with ESP8266, IOT

My wife and I have a good meal and leave the house. After 20 minutes or so, we are in the car and I ask my wife, did we turn off the stove?

My wife answers…you were the last one to cook. What to do now? Go back home …


Continue reading

Fitting Complex Metal Dielectric Functions with Differential Evolution Method

Posted on Wed 13 April 2016 in Plasmonics

The real and imaginary part of dielectric permittivity of the metals is important to simulate the optical properties of metal films and nanoparticles. Permittivity data is obtained experimentally by ellipsometry and is fitted with analytical models. The most common model for fitting experimental data is with Drude-Lorentz …

Continue reading