Friday 12 April 2013

Chewin' Gum and Bailin' Twine
2013-04-12


My upgraded weather system has gone live.  It took some work to get there.

To summarize, my new home weather station includes a wireless LCD display, like the old one, but with more data fields (wind speed and direction, and precipitation).  Second, our cats frequently knock the data-capture camera out of position, forcing time-consuming recalibration.  The new version of the capture software makes it much easier to realign onscreen elements within the GUI environment.

It took trial, error, and plenty of arithmetic, but I'm getting the capture program fine-tuned, and the data are looking fairly reliable.  I do have to rejig the Humidex and Wind Chill calculation routines.  No biggie.  In the process, I've learned a lot about image processing.  For example, the webcam delivers a colour image, and I find that the green channel is the sharpest; so I use only the green values from the image.

The optical part of the data-capture process was the most time-consuming part.  I completely revamped how the system processes and validates the data from the LCD.  It now compares the average brightness for each character-segment against the brightness of a pre-selected control area for that character.  An adjustable darkness threshold allows tuning between false-negatives and false-positives.  One field is a differential value (current reading minus last reading), and another is a comparitive (select only the darkest of an array of segments).

The sky-observing software now outputs its results directly to the data-capture program, for integration into the data feed to the weather system itself.  Minutes of sunshine are imputed and recorded.

I've been tinkering with the weather software, to ensure it's properly recording and reporting the readings given it.

Looks good, so far.

-Bill

Wednesday 10 April 2013

My Babies
2013-04-10

I love cats.  They're fun, bright, cuddly and mostly self-maintaining.

Teeka is a sphynx cat--she's hairless and a bit on the smallish side.  Elroy just joined the family a few weeks ago.  He, too, is a sphynx, but full-sized.  He's a total lovebug, and the two have hit it off famously.

Here's a shot:


Elroy (pink; foreground) and Teeka
Sphynxes are extra-bright and engaging; there's always one hanging out or looking for lap space, or play... or treats... or nip--or, most importantly, warmth!

Teeka--the little blue-gray one in the pic--loves to play, either with toys, or one-on-one.  At random, she'll run up and start roughing-up my leg, making nasty-faces and generally looking for trouble.  That's my cue to jump up, raise my arms, roar like a monster and give chase.  She flees up the stairs, then comes charging back once I turn around.  In her previous home, she'd spent entire winters huddled up to the impotent baseboard heaters.  In summer, she's a total sun slut.  She baked away last summer, on the balcony, while I looked for work.  Now she's got spring fever and has taken to charging defiantly out onto the front step for a sniff and a shiver, when someone comes home.

Both like their spankings--it's a peculiarity of the breed.  Teeka's favourite spanking pose is left-cheek-up, clinging to the end of the arm of the chesterfield; for Elroy, it's on the bed.  Flop-"'Pank me!"

Because their faces are bare, Sphynxes broadcast their emotions more readily.  I know at a glance what kind of mood Teeka's in, and usually what she wants.  She gives 'the look' better than Mother; and when she's agitating for a tussle, her little Shatner-aping grimace telegraphs "Khaaaaaaaan!".  And, boy, smiles are special!

This post is mostly for the benefit of my friend Natasha, who's breaking into Northern life on her own and whose three little doggies are still waiting to join Mommy up North.  I know this picture will bring her a smile.

Have a good week.

-Bill

Tuesday 9 April 2013

C'mawn, April Showers!
2013-04-09


No, I'm not pining for a porn actress.  I'm waiting patiently for it to rain.

New Toys
About a month back, I ordered a new weather station, which arrived about ten days ago; the dr.Tech WA-1070-T.  It's wireless.  It includes wind and precipitation.  It includes a solar recharger.

One unexpected omission from the package:  USB capture.  Dammit.  Chumped by an assumption on my part.

So, I'll be back to OCR'ing an LCD display.


Back to the Fixture

(If that statement mystifies you: I capture my 'local' weather data from the LCD display of a cheap home weather station.  A webcam snaps a picture of the display, and custom software quite literally interprets what's on the screen and passes the info along to the weather software proper.  Versus wiring in and programming the necessary circuitry to interface it electronically, it's the best/simplest/cheapest solution.  And I'm damned certain I'm infringing on some troll's patent, somewhere, in doing this.)

I've had the new station installed and in testing for about a week.  Since then, it's been bloody windy, causing me to suspect vibration of the 'transmitter' unit--not the rain gauge mechanism itself--as the source of spurious readings.  I'm supposed to get precipitation data in increments of 0.3 mm.  What I've been getting is a string of spurious readings, 15.2 mm at a time--and this after having secured the rain gauge to a flat, stable surface.  What I'm suspecting is a loose connection, in conjunction with resonant vibration in the sensor mast.

Making Ready
I've been upgrading the data-capture software, with two competing goals in mind:

Make it capture more data

Make it easier to use (GUI-squishy) and more configurable

Issue:  There'll be a number of new fields on the new display (wind speed and direction, and running-total precipitation).  The number of fields actually captured may vary and could change again in the future, when I try to upgrade to something even-better and chump myself again.  Honest-to-'Ghettimonster, I will be absolutely certain, next time, that it's got computer connectivity.  *makes coiling motions with left hand*

So, make the data fields configurable and more flexible

Issue:  We have a new, active, male feline addition to the households.  Prowling occurs, as do minor upsets, such as trying to perch on the Centretown Observatory Data Capture Stage, which began life as a microwave cart with a nordic moniker.  Disturbances to the webcam and/or the display panel (position and orientation) are a major pain, as viewpoints change, and the camera must be realigned simultaneously with the data-capture software. 

So, make it easier and faster to realign.

The revised version of the capture software now recognizes any number of user-definable data fields, in which the individual digits can be expressed as a box and the expected segments scanned automatically; or each individual segment can be defined to specific coordinates.  (E.g. on the new display, the leading digit for the barometric-pressure reading is either blank, or 1 (i.e. two segments.).)

The configuration file is so simple, yet flexible, it really deserves a full page of documentation.  The initial calibration is done by hand, field-by-field and character-by-character, and entered into the config file.  Following that, realignment is easier.  Once the camera has been levelled and roughly pointed in the right direction, the data search-boxes can be adjusted onscreen either globally, or by field.  A future version may use special markings for auto-calibration.Eventually, I'll add interface elements to manage configuration completely visually.

So, a few polishing touches to the data-capture software, and a one-time calibration, and I'll be collecting live data from the new station.  The only catch is that I need to see a little live action from the rain gauge; to see how real data are reported, before deciding how--or, indeed, whether--to handle rainfall readings.

Water, Water, Everywhere--And Not a Drop to Measure

It hasn't rained much, nor at the right times, since I set up the new equipment.  

It's supposed to rain tonight.  I've been following the front in on local radar.  It's... in the neighbourhood but kind-of regrouping.

To paraphrase The Simpsons' Apu Nahasapeemapetilon (big fan; love the blithe fatalism): 


Rain, rain
Go away
...and please come again!


(And that brings us to 410.4 millimetres of imaginary rain for today.)