= 5) { $done = true; break; } } else { system("jpegtran -rotate 90 snowpix/pic_$next-rotated.jpg > snowpix/pic_$next.jpg"); break; } } if ($done) { break; } } if (!$max) { echo("I have no pictures!\n"); exit(0); } $im = imagecreatefromjpeg("snowpix/pic_$max.jpg"); # Bottom of ruler is perched on a flipped bucket $bottom = 734; # Distance between rubber bands is 20 in $perinch = (735.0-386.0) / 29.0; $x = 308; # Look for a discontinuity, works in more lighting conditions $threshold = 15; $yellow = imagecolorallocate($im, 255, 255, 0); $blue = imagecolorallocate($im, 0, 0, 255); $first = true; for ($y = $bottom; ($y >= 0); $y--) { $p = imagecolorat($im, $x, $y); $level = ($p & 0xff); if (!$first) { if (abs($last - $level) > $threshold) { echo("$last $level $threshold breaking out at $y\n"); break; } else { echo("Continuing\n"); } } $first = false; $last = $level; } imageline($im, 0, $y, imagesx($im), $y, $yellow); imageline($im, $x, $bottom, $x, $y, $blue); imagejpeg($im, 'level.jpg'); copy('level.jpg', 'linepix/pic_' . $max . '.jpg'); $inches = ($bottom - $y) / $perinch; $inches = sprintf("%.02f", $inches); file_put_contents('depth/' . $max . '.txt', $inches); $depths = glob('depth/*.txt'); $lastHour = '[Earlier]'; $pointsThisHour = 0; foreach ($depths as $depth) { $mtime = filemtime($depth); $hour = date('ga', $mtime); $inches = file_get_contents($depth) + 0.0; if ($hour !== $lastHour) { $data[$lastHour] = $inches; $pointsThisHour = 0; } else { $pointsThisHour++; } $lastHour = $hour; } # Incomplete hour should show something so you can watch if ($pointsThisHour) { $data[$hour] = $inches; } $salt = rand(); ob_start(); ?>
This page will refresh automatically every three minutes.
DIHYDROGEN MONOXIDE! DIHYDROGEN MONOXIDE in its horrific SOLID FORM! FALLING! FROM! THE! SKY! Only DASA (the Delaware Aeronautics and Snow Administration) has the technology to measure this phenomenon accurately...
| Hour | Inches | Total | ||
|---|---|---|---|---|
@tommybgoode of P'unk Avenue coded this. Have a peek at the source code.
Jill's webcam is an Android tablet running Camera Trigger, pushing images to dropbox.
The snowflake in the graph is a photomicrograph of an actual snowflake taken by Wilson Bentley circa 1902.
In response to questions from fans on ycombinator: Jill's bucket is located near Arden, Delaware, USA.