{{ message }}

Instantly share code, notes, and snippets.

# Bala Juluri, PhD plasmon360

Created Dec 3, 2019
Python class to control SP2150i Monochromator pyvisa
View SP2150i.py
 """ 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)
Created Apr 14, 2016
Fitting Complex Metal Dielectric Functions with Differential Evolution Method
View gist:71d4f6fc559e71362e09bb64dd6a1fa3
 { "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",
Created Sep 23, 2015
Calculates payments and amortization table.
View mortgage.py
 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
Last active Aug 29, 2015
Airtel Tune on Arduino
View gist:ed5223a391370c61b4a3
 /* 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:
Last active Feb 4, 2021
python Class for communicating Rigol Dp832 programmable power supply
View Rigol_DP_832.py
 # -*- coding: utf-8 -*- """ Created on Sat Dec 21 13:57:32 2013 @author: bjuluri Uses Pyvisa for commounication """ from visa import * import time, sys
Created Feb 14, 2015
Python code to read and upload weight information form a weighing scale.
View weighing_scale_to_plotly.py
 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'