Skip to content

Instantly share code, notes, and snippets.

@sauravrt
sauravrt / twosigma.py
Created March 27, 2022 15:23
Plot 2-sigma ellipse
def plot_twosigma(pos, S, ax, color='g'):
"""Plot 2-sigma ellipse
Parameters
----------
pos : tuple of length 2
Center of the 2-sigma ellipse
S : numpy.ndarray of size 2x2
Position covariance
ax : matplotlib.axes
@sauravrt
sauravrt / read_binarylog.py
Created August 17, 2017 14:16
Read binary data file
import struct
import numpy as np
if __name__ == '__main__':
'''
# Data format: "%1B(Hours)%1B(Minutes)%4F(Seconds)%4U(ChipTimeUS)
%4F(RawAccelX)%4F(RawAccelY)%4F(RawAccelZ)"
The header string is 108 bytes long + CRLF\r\n (2bytes)
Each valid data record is 22 bytes
# Script to find raspberry pi ip on your local network
sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@sauravrt
sauravrt / mrp-kathmandu.md
Created October 10, 2014 15:28
MRP application process at Kathmandu

MRP application process at Kathmandu

@sauravrt
sauravrt / skeleton.m
Created February 22, 2014 17:20
Script to open editor with skeleton code structure in MATLAB
function skeleton
% Script to open editor with skeleton code structure
% Skeleton taken from
% http://www.cs.utah.edu/~germain/PPS/Topics/Matlab/function_design_pattern.html
content = sprintf(strcat('function return_value = name_of_function( parameters ) \n', ...
'%% Author: \n', ...
'%% Date: ', date, '\n', ...
'%% Partner: \n', ...
'%% Function : Name of Function \n', ...
@sauravrt
sauravrt / rmtintro.ipynb
Created December 2, 2012 22:28
RandomMatrixTheoryIntro
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sauravrt
sauravrt / wishart.ipynp
Created November 22, 2012 05:04
WishartMatrix
{
"metadata": {
"name": "WishartMatrix"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{