Skip to content

Instantly share code, notes, and snippets.

@hirokai
Created January 23, 2015 23:03
Show Gist options
  • Save hirokai/4a0324684dca78516ddc to your computer and use it in GitHub Desktop.
Save hirokai/4a0324684dca78516ddc to your computer and use it in GitHub Desktop.
Combining stats from ImagePipeline
#!/usr/bin/env ruby
$chs = ["488nm", "561nm", "647nm"]
def readall
res = {}
for ch in $chs
res[ch] = {}
for i in 1..6
file = "./stats/FC#{i}_#{ch}.csv"
ns = IO.readlines(file).map{|l| l.split.map{|a| a.to_f}}
res[ch][i.to_s] = ns
end
end
res
end
def summary(ns)
for ch in $chs
vs2 = (1..6).map{|i|
vs = ns[ch][i.to_s]
r = vs.map{|row| row[2] - row[0]}
r
}
len = vs2.map{|a| a.length}.max
vs3 = vs2.map{|v| v.dup.fill(nil, v.length...len)}
vs3.transpose.map{|row|
puts row.join("\t")
}
puts "\n"*5
end
end
res = readall()
summary(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment