Skip to content

Instantly share code, notes, and snippets.

View plasmon360's full-sized avatar

Bala Juluri, PhD plasmon360

View GitHub Profile
@plasmon360
plasmon360 / weighing_scale_to_plotly.py
Created February 14, 2015 20:02
Python code to read and upload weight information form a weighing scale.
import pigpio
import time
import sys
from datetime import datetime
from collections import Counter
import numpy as np
import plotly.plotly as py
from plotly.graph_objs import *
#command 1 =[0, 0, 0, 0, 0, 0, 1, 1]='0x03'
@plasmon360
plasmon360 / Rigol_DP_832.py
Last active February 4, 2021 14:25
python Class for communicating Rigol Dp832 programmable power supply
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 21 13:57:32 2013
@author: bjuluri
Uses Pyvisa for commounication
"""
from visa import *
import time, sys
@plasmon360
plasmon360 / gist:ed5223a391370c61b4a3
Last active August 29, 2015 14:21
Airtel Tune on Arduino
/*
Melody
Plays a Airtel Melody
https://www.youtube.com/watch?v=SuAe2lziMqI
Notes taken from https://www.youtube.com/watch?v=3m5j5UIRqQc
Bala Krishna Juluri
http://juluribk.com
circuit:
@plasmon360
plasmon360 / mortgage.py
Created September 23, 2015 23:43
Calculates payments and amortization table.
home_price = 300000
down_payment = 20 # in percent
principal = home_price * (1 - down_payment / 100.0)
yearly_interest_rate = 3.710 # in percent
number_of_years = 30
pay_periods_per_year = 12
def remaining_at_end(monthly_payment, principal, number_of_years, pay_periods_per_year, yearly_interest_rate):
remaining = principal
@plasmon360
plasmon360 / gist:71d4f6fc559e71362e09bb64dd6a1fa3
Created April 14, 2016 05:13
Fitting Complex Metal Dielectric Functions with Differential Evolution Method
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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 model shown below. \n",
"\n",
"$$\\epsilon(\\omega)=1-\\frac{f_1\\omega_p^2}{(\\omega^2+i\\Gamma_1\\omega)}+\\sum_{j=2}^{n}\\frac{f_j\\omega_p^2}{(\\omega_{o,j}^2-\\omega^2-i\\Gamma_j\\omega)}$$\n",
"\n",
@plasmon360
plasmon360 / SP2150i.py
Created December 3, 2019 21:14
Python class to control SP2150i Monochromator pyvisa
"""
Created on Fri Sep 19 18:11:40 2014
@author: Bala Krishna Juluri
"""
from visa import *
import time
#assumes connected with USB. Drivers are installed. Needs pyvisa for communication.
# There is no need to use visa write command for SP2150. because all commands are ask type (you write something and get a confirmation back saying OK)