ガイガーカウンターのRAWデータを変換する

ナチュラル研究所さんhttp://www.ishikawa-lab.com/index.html提供のデータを使い
こんなものhttp://uni-factory.jp/koizumi.jpgを作っています。

元のファイルが1分ごとの集計ファイルなので、これを1時間ごとの平均値にします。
少しずつ作り替えたので、ツギハギ感があります。もっと単純な手法があればお知らせください。

delay 5としていますが、もっと短くても問題ないです。

一刻も早い被災地の復興、原発事故収束を願います。

※興味のある方はナチュラル研究所(石川宏)さんから生データアドレスを提供していただき、
下記1行目 注1 部分へアドレスを入力後実行して下さい。

set {a3, a9, b1, s2} to {“”, “”, 1, “注1”}
tell application “Safari”
open location s2
delay 5
set a1 to text of current tab of window 1 as Unicode text
end tell
try
set a1 to paragraphs -4000 thru end of a1 as Unicode text
on error
set a1 to paragraphs of a1 as Unicode text
end try
set a12 to run script ((do shell script “echo ‘” & a1 & “‘ | sed -e ‘s/2011\\/..\\//},{\”/g’ -e ‘s/ , /\”,/g’ -e ‘s/^},/{/'”) & “}}” as Unicode text)
set {a1, a5, a4, a6} to {(a reference to a12), 0, 0, “0”}
set a6 to (words of a1’s item 1’s item 1 as list)’s item 2
repeat with a2 from 1 to count a1
set a8 to words of a1’s item a2’s item 1 as list
set a7 to a8’s item 2
if a7 = a6 then
set {a5, a4} to {a5 + ((a1’s item a2’s item 2) / 120), a4 + 1}
else
try
set a3 to a3 & a8’s item 1 & “日” & a6 & “時” & tab & (round ((a5 / a4) * 100000)) * 1.0E-5 & return as Unicode text
end try
set {a5, a4, a6} to {0, 0, a7}
end if
end repeat
set a3 to a3 & a8’s item 1 & “日” & a6 & “時” & tab & a5 / a4 as Unicode text
activate
display dialog “終了しました” & return & a3 with title “uni-factory”
set the clipboard to a3

1件のコメント

コメントはできません。