Skip to content

Instantly share code, notes, and snippets.

@tobin
tobin / ezcaswitchreport.m
Created August 9, 2011 21:32
Decode LIGO filter bank status from _SW1R and _SW2R EPICS channels
function varargout = ezcaswitchreport(varargin)
% ezcaswitchreport(sw1r, sw2r)
%
% This function decodes the _SW1R and _SW2R filter bank status readbacks
% in the LIGO realtime control system.
%
% Use EPICS functions to get the values, for instance:
%
% caget L1:ASC-WFS1_PIT_SW1R L1:ASC-WFS1_PIT_SW2R
% L1:ASC-WFS1_PIT_SW1R 61685
@nicolassmith
nicolassmith / gist:2052384
Created March 16, 2012 20:18
DCC Bibtex Bookmarklet source.
(function(){
var basicdiv = document.getElementById('BasicDocInfo');
var dccnum = basicdiv.childNodes[1].childNodes[2].childNodes[0].innerHTML.split('-')[1];
var numauthors = document.getElementById('Authors').childNodes[1].childNodes.length;
var authors = new Array();
for(var j=0;j<numauthors;j++){
authors[j] = document.getElementById('Authors').childNodes[1].childNodes[j].childNodes[0].innerHTML;
};
var title = document.getElementById('DocTitle').childNodes[1].innerHTML;
var dateels = basicdiv.childNodes[1].childNodes[17].innerHTML.split('%20');
@tobin
tobin / example1.m
Last active December 14, 2015 07:19
Experimenting with Numerical Python
% Matlab code to plot a cavity resonance
F = 10; % Finesse
f = linspace(-0.5, 1.5, 201);
P = 1./(1 + (2/pi) * F^2 * sin(pi*f).^2);
plot(f, P);
xlabel('free spectral ranges');
ylabel('power buildup');