This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def exact_sqrt(x): | |
"""Calculate the square root of an arbitrarily large integer. | |
The result of exact_sqrt(x) is a tuple (a, r) such that a**2 + r = x, where | |
a is the largest integer such that a**2 <= x, and r is the "remainder". If | |
x is a perfect square, then r will be zero. | |
The algorithm used is the "long-hand square root" algorithm, as described at | |
http://mathforum.org/library/drmath/view/52656.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Phasor demo | |
% | |
% Tobin Fricke <tobin.fricke@ligo.org> 2011-06-08 | |
% modulation depth | |
m = pi/4; | |
% vector of (normalized) frequencies to include | |
freqs = [0 1 -1 2 -2 3 -3 4 -4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function opt = my_configuration | |
% RF component vector | |
Pin = 100; | |
%vMod = (-1:1)'; | |
fMod = 10e+6; | |
%vFrf = fMod * vMod; | |
% create model - give vector of RF field frequencies | |
opt = Optickle([-fMod,0,fMod]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
class drawable { | |
public: | |
virtual float getHeight() = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filename = '/cvs/cds/llo/chans/L1LSC.txt'; | |
% read the filter file | |
pfilt = readFilterFile(filename); % this is from mDV | |
% identify the filter modules we want | |
bank_name = 'DARM'; % filter bank name | |
modules = [1:5,9]; % FM1,2,3,4,5,9 are enabled in low-noise mode | |
% Extract the right SOSes and convert to digital ZPK: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function H = sos2freqresp(sos, omega, fs) | |
%SOS2FREQRESP Frequency response of SOS filters. | |
% | |
% H = SOS2FREQRESP(SOS,W,FS) computes the frequency response H of the | |
% matrix of second order section coefficients at the frequencies | |
% specified by the vector W. These frequencies should be real and in | |
% radians/second. FS is the sample rate in samples per second. | |
% | |
% Example usage: | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Technical radiation pressure noise budget | |
% | |
% Produce a noise budget showing shot noise, quantum radiation pressure | |
% noise, and technical radiation pressure noise in a FP Michelson IFO. | |
% | |
% Reference: Chaibi and Bondu pre-print | |
% | |
% Tobin Fricke | |
% August 27, 2011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download from my GPS from these two trips. Part of the first leg of the airplane trip | |
is missing. | |
For a quick visualization, extract the coordinates: | |
> grep '^T' trackOct2011.txt | awk '{print $5 " " $4}' > foo.txt | |
Then you can open up gnuplot and simply do: | |
> plot "foo.txt" |
OlderNewer