- Take raw data records of fixed length and noise. Return basis for analyzing that data, and future data.
- Requires cuts to select down to clean pulses from which to make the basis. This suggests a sort of self consistent cut procedure. Luckily Alpert et all describe such a procedure https://link.springer.com/article/10.1007/s10909-015-1402-y
- Take raw data records. Return subspace representation + residual std deviation.
- Take subspace representation and spectral information. Return rough calibration. J?
- Take J and ??. Return various corrected Js.
- Baseline-J Correlation Correction
- Subsample arrival time Correction
- Time Drift Correction
This file contains hidden or 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
### A Pluto.jl notebook ### | |
# v0.19.32 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ a353c1f3-0921-4c9b-ab1d-a34cb262b3d9 | |
# following docs at https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects-1 | |
# lets make a functor |
This file contains hidden or 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
# written in Julia just because its easier and more compact to annotate the code with types (mainly vector vs scalar) | |
# and group the data into structs.... we will write everything in python | |
# the goal is just to get a sense of what functions we need from the abaco hardware side (abaco_*) | |
# and what functions we want to expose from some analysis package, and what data all of those will want | |
const Vec = Vector{Float64} | |
struct S21 | |
frequency::Vec | |
transmission::Vec | |
phase::Vec # future |
This file contains hidden or 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
const NEIG_py = [[1, 4, 5], [0, 2, 4, 5, 6], [1, 3, 5, 6, 7], [2, 6, 7], [0, 1, 5, 8, 9], [0, 1, 2, 4, 6, 8, 9, 10], [1, 2, 3, 5, 7, 9, 10, 11], [2, 3, 6, 10, 11], [4, 5, 9, 12, 13], [4, 5, 6, 8, 10, 12, 13, 14], [5, 6, 7, 9, 11, 13, 14, 15], [6, 7, 10, 14, 15], [8, 9, 13], [8, 9, 10, 12, 14], [9, 10, 11, 13, 15], [10, 11, 14]]; | |
const NEIG = [n.+1 for n in NEIG_py] | |
function enlarge(path::Vector{Int}) | |
(push!(copy(path),loc) for loc in NEIG[path[end]] if !(loc in path)) | |
end | |
collect(enlarge([1])) | |
function enlargepaths(paths) | |
Iterators.Flatten(enlarge(path) for path in paths) | |
end | |
collect(enlargepaths([[1],[2]])) |
This file contains hidden or 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
using BenchmarkTools | |
dirname = "anotherdir" | |
isdir(dirname) || mkdir(dirname) | |
fname = joinpath(dirname,"stackexchange46809845_f.jl") | |
funname = "myfun" | |
funstr = """$funname() = rand(100)""" | |
open(fname,"w") do f | |
write(f,funstr) | |
end |
This file contains hidden or 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
using HDF5 | |
"HDF5 appears to be inefficent for small writes, so this a simple buffer that | |
allows me to write to HDF5 only once per unit time (typically one second) to | |
limit the number of small writes." | |
mutable struct BufferedHDF5Dataset{T} | |
ds::HDF5Dataset | |
v::Vector{T} | |
lasti::Int64 # last index in hdf5 dataset | |
timeout_s::Float64 # interval in seconds at which to transfer data from v to ds |
This file contains hidden or 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
using MacroTools, Base.Test | |
"@parsetype T ex | |
replace all numeric literals that are supertypes of `T` with type `T`" | |
macro parsetype(Tsym, ex) | |
T=getfield(Main, Tsym) | |
ST=parsesuper(T) | |
parsetype(T, ST, ex) | |
end |
This file contains hidden or 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
package main | |
import "time" | |
import "fmt" | |
func counter(c chan int, N int) { | |
for j := 1; j <= N; j++ { | |
c <- j | |
} | |
} |
This file contains hidden or 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 searchsortedfirst2vec(a,b) | |
[searchsortedfirst(a,bb, 1, length(a), Base.Sort.Forward) for bb in b] | |
end | |
c=searchsorted2(a,b) | |
# returns an array of indicies into a such that each points is the first value in a[i] greater than b[i] | |
# assumes both a and b are sorted | |
function searchsortedfirst2a(a,b,o::Base.Sort.Ordering=Base.Sort.Forward) | |
alow = 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder