metachronistic

Sat, 12 Mar 2011

Walk with Piper

Piper and Nika on the trail

Today is the first time in a long time that I’ve been able to take both Nika and Piper out on the trails. For me, this is a turning point in a very long, stressful illness that Piper is still recovering from.

A couple months ago Piper got what we can only assume was an abscess inside her chest cavity. The result was that her chest filled with fluid and made breathing very difficult for her. The original diagnosis, made before she started having any real symptoms, was cancer, and we were preparing for the worst. Thankfully, Andrea didn’t give up on her, and several fantastic veterinarians in town didn’t either.

She spent some time in a hyperbaric chamber to get her oxygen levels up, and she had the fluids drained from her chest several times. Eventually, she had surgery to insert a pair of tubes into her chest, and we spent the next two weeks flushing her with fluids, every six hours. There’s a photo of the setup below. The procedure was to hook the saline bag to the input port on one side of her chest and put in 250 ml of fluid. Then we’d switch sides, and open the drain port on the side that had just been filled. Repeat until a liter has gone in and come back out again. The whole procedure took more than an hour, four times a day. At the same time, she was getting pain medication and antibiotics.

Flush setup

Flushing Piper’s chest, February 2011

In the beginning, even after we had a good diagnosis, she was so sick that I don’t think anyone had much hope that she could be saved. She was too weak to stand without help and had a head tilt that seemed to indicate she’d gone septic. But as soon as we got some of the fluid out and the antibiotics started working on the infection inside her she improved dramatically.

Throughout all of it, Piper was fantastic. She went up on the couch to get treatment, went into her kennel at night, and handled all the trips to the vet without complaint or struggle.

She still has to take antibiotics for at least six months to make sure the infection really is gone, and it’s been a cold couple months because her chest was shaved prior to the surgery, but it’s all worth it. Seeing her running around on the trails today with Nika was a pleasure, and I think she enjoyed it too.

Tags: , , , ,
cswingle @ 14:44:48 -0800

Sat, 05 Mar 2011

Skating on Goldstream Creek

Nika, overflow

Nika, Goldstream Creek

The last couple days have seen a lot of overflow on Goldstream Creek, causing it to rise more than two feet. The water moved fast enough and it’s been cold enough at night that it froze into a pretty good surface for ice skating. Many years ago we lived in a cabin at the edge of a pond near the railroad tracks and we bought ice skates so we skate on the pond. Turns out the number of days where the pond is frozen and not completely covered by snow is virtually zero, so we rarely got a chance to use them. But here, it seems that at least once or twice a year the overflow on the Creek or the DNR pond east of us will run over the snow and freeze into reasonably smooth ice.

I attempted to shoot a video while ice skating on the Creek today. It’s not the greatest video, but it does give you some idea of what it looks like. After it freezes and before the overflow starts later in the winter, I spend a lot of time walking Nika and Piper down here. During breakup, the water rises to just below the bottom of the bridge, and then recedes to between four and five feet lower than where I’m skating by the middle of summer. The bridge I duck under is where I do my river stage measurements for the National Weather Service.

Tags: , , ,
cswingle @ 18:08:05 -0800

Sat, 20 Mar 2010

New trail

Piper and Nika on the new trail

Piper and Nika on the new trail

We closed on a new piece of property last week and I’ve been exploring it on the ground and with Google Maps. There’s already a well-established non-motorized trail along two side of it, and based on the satellite imagery, it looks like there’s a partial trail approximately through the middle. I found it on the ground yesterday, and today I made an attempt at figuring out a way to connect the two trails. There’s still a foot of snow on the ground, so it’s wasn’t easy going, but I did snowshoe my way around. I’d hoped my snowshoe tracks would have hardened enough to walk it in boots this evening, but the snow had turned to sugar instead. Hopefully it’ll harden tonight when the temperature drops.

I’ve been on and off carrying my .22 rifle over the past couple months looking for grouse and snowshoe hare (hares?). I haven’t seen any grouse since I started carrying, but both last week and today I’ve seen hares. So far I’ve seen three on our property, and each time I saw them, I wasn’t carrying my rifle or my bow. The hare I saw this morning may have been laughing at me. Hares have a very clever strategy for eluding predators: when startled they run a short distance through the brush, freeze for ten to twenty seconds, then run again. For predators that are focused on movement, I think the momentary pause allows the hares to disappear due to their excellent camouflage. For a human hunter it’s a challenge because just as you get the animal in your sights, it bolts. And since you’re looking through your sights or scope, it’s much harder to pick them up after they’ve left the view. Anyway, the hare today was 20–30 feet away, in plain sight, and showed no sign that it considered me a threat. It kept right on eating alder shoots, preening, and at one point even got up on it’s hind legs and looked around. It would have been an easy target for my bow.

Had I been carrying it.

Tags: , , , , ,
cswingle @ 19:34:04 -0800

Sun, 21 Feb 2010

Where am I and who owns it?

Back 40

Back lot

Today I went for a walk on the Creek with Nika and Piper and it occurred to me that the iPhone ought to be able to tell me not only where I am (which it does quite well with the Google-driven map application), but on whose property I’m walking through. It took me a little time, but I now have a webapp (http://swingleydev.com/gis/loc.html) that can do this (don’t bother clicking on the link unless you’re on an iPhone or other GPS-enabled device).

The result is a pair of pages. The first one shows you your current location, speed, and heading. With a press of a button (and a delay while the database finds the property owner) you can see the Borough information on the property you’re currently inside (assuming you’re in the Fairbanks North Star Borough—this page doesn’t do non-Borough residents any good).

Here’s how I set it up:

My web hosting provider doesn’t have a new enough version of PostgreSQL to run PostGIS, which means I need to use the spatially-enabled version of SQLite3, called Spatialite. To get the parcel database from the shapefile to Spatialite requires the following steps. Some parcels are eliminated in this process, but it’s a small fraction of the parcels in the database:

Download the parcels shapefile:

$ wget ftp://co.fairbanks.ak.us/GIS/tax_parcels.zip

Unzip it and insert it into a spatially enabled PostgreSQL database using ogr2ogr. Crash the process immediately:

$ unzip tax_parcels.zip
$ ogr2ogr -f "PostgreSQL"
    -t_srs EPSG:4326
    -overwrite -skipfailures
    PG:"dbname='test'"
    tax_parcels.shp

Fix the column definitions:

sql> DELETE FROM tax_parcels;
sql> ALTER TABLE tax_parcels ALTER COLUMN
    sqft_calc TYPE numeric (22,12);

Re-import the data:

$ ogr2ogr -f "PostgreSQL"
    -t_srs EPSG:4326
    -append -skipfailures
    PG:"dbname='test'"
    tax_parcels.shp

Convert the geometry column to MULTIPOLYGON:

sql> ALTER TABLE tax_parcels DROP CONSTRAINT "enforce_geotype_wkb_geometry";
sql> ALTER TABLE tax_parcels ADD CONSTRAINT "enforce_geotype_wkb_geometry"
     CHECK (geometrytype(wkb_geometry) = 'MULTIPOLYGON'::text OR
            wkb_geometry IS NULL OR
            geometrytype(wkb_geometry) = 'POLYGON'::text);
sql> UPDATE tax_parcels SET wkb_geometry = ST_Multi(wkb_geometry);
sql> ALTER TABLE tax_parcels DROP CONSTRAINT "enforce_geotype_wkb_geometry";
sql> ALTER TABLE tax_parcels ADD CONSTRAINT "enforce_geotype_wkb_geometry"
     CHECK (geometrytype(wkb_geometry) = 'MULTIPOLYGON'::text OR
            wkb_geometry IS NULL);
sql> UPDATE geometry_columns SET type='MULTIPOLYGON'
     WHERE f_table_name='tax_parcels' AND f_geometry_column='wkb_geometry';

Re-import the data (there will be thousands of errors, but this insert should add the MULTIPOLYGON rows that weren’t inserted the first time around):

$ ogr2ogr -f "PostgreSQL"
    -t_srs EPSG:4326
    -append -skipfailures
    PG:"dbname='test'"
    tax_parcels.shp

Get rid of the illegal polygons:

sql> DELETE FROM tax_parcels WHERE NOT ST_IsValid(wkb_geometry);

Convert to spatialite:

$ ogr2ogr -f "SQLite"
    tax_parcels.sqlite
    PG:"dbname='test'"
    -dsco SPATIALITE=YES

With the data in the proper format, I built a mobile web page that can pull location information from the mobile device, display it on the screen, and pass this information to a page that finds and displays the parcel information from the Spatialite database. JavaScript handles gathering the location information, but because I don’t control the web server, I had to write a CGI script to pass a query to spatialite and format the results as a list. This CGI is called by the main page from a <form> element. The spatialite query looks like this:

sqlite> SELECT street_add, owner_firs, owner_last,
           owner1, owner2, owner3, mail_add, ci_st_zip,
           round(acres_calc, 1) as acres, ’$’ || total as total,
           ’$’ || land as land, ’$’ || improvemen as improvements,
           pan, sub, block, lot, road_water, lot_size, units,
           neighborho, primary_us, tax_status, tax_year, mill_rate,
           business, year_built, situs_numb, situs_name
        FROM tax_parcels
        WHERE Intersects(GEOMETRY, SetSRID(MakePoint(lon, lat), 4326));

Again, implementing this would be a lot easier if I could install PostGIS on the server and use PHP to access the data directly. Because I can’t, spatialite and CGI do the trick.

Update: I added a few more steps to convert the initially imported POLYGON layers to MULTIPOLYGON, which then allows us to include the MULTIPOLYGON rows from the shapefile.

Tags: , , , , , ,
cswingle @ 19:45:00 -0800

Fri, 25 Sep 2009

First “true” snowfall

Piper and Nika on the Creek

Piper and Nika on the Creek, Feb 2009

On Wednesday I reported the results of my analysis examining the average date of first snow recorded at the Fairbanks Airport weather station. It was based on the snow_flag boolean field in the ISD database. In that post I mentioned that examining snow depth data might show the date on which permanent snow (snow that lasts all winter) first falls in Fairbanks. I’m calling this the first “true” snowfall of the season.

For this analysis I looked at the snow depth field in the ISD database for the Fairbanks station. The data was present for the years between 1973 and 1999, but isn’t in the database before that date. I’m not sure why it’s not in there after 1999, but luckily I’ve been collecting and archiving the data in the Fairbanks Daily Climate Summary (which includes a snow depth measurement) since late 2000. Combining those two data sets, I’ve got data for 27 years.

The SQL query I came up with to get the data from the data sets is a good estimate of what we’re interested in, but isn’t perfect because it only finds the date of first snow that lasts at least a week. In a place like Fairbanks where the turn to winter is so rapid and so dependent on the high albedo of snow cover, I think it’s close enough to the truth. Unfortunately, the query is brutally slow because it involves six (!) inner self-joins. The idea is to join the table containing snow depth data against itself, incrementing the date by one day at each join. The result set before the WHERE statement is the data for each date, plus the data for the six days following that date. The WHERE clause requires that snow depth on all those seven dates is above zero. This large query is a subquery of the main query which selects the earliest date found in each year.

There must be a better way to deal with conditions like this where we’re interested in the consecutive nature of the phenomenon, but I couldn’t figure out any other way to handle it in SQL, so here it is:

SELECT year, min(date) FROM
    (
        SELECT extract(year from a.dt) AS year,
            to_char(extract(month from a.dt), '00') ||
                '-' ||
                ltrim(to_char(extract(day from a.dt), '00')) AS date
        FROM isd_daily AS a
            INNER JOIN isd_daily AS b
                ON a.isd_id=b.isd_id AND
                    a.dt=b.dt - interval '1 day'
            INNER JOIN isd_daily AS c
                ON a.isd_id=c.isd_id AND
                    a.dt=c.dt - interval '2 days'
            INNER JOIN isd_daily AS d
                ON a.isd_id=d.isd_id AND
                    a.dt=d.dt - interval '3 day'
            INNER JOIN isd_daily AS e
                ON a.isd_id=e.isd_id AND
                    a.dt=e.dt - interval '4 day'
            INNER JOIN isd_daily AS f
                ON a.isd_id=f.isd_id AND
                    a.dt=f.dt - interval '5 day'
            INNER JOIN isd_daily AS g
                ON a.isd_id=g.isd_id AND
                    a.dt=g.dt - interval '6 day'
        WHERE a.isd_id = '702610-26411' AND
            a.snow_depth > 0 AND
            b.snow_depth > 0 AND
            c.snow_depth > 0 AND
            d.snow_depth > 0 AND
            e.snow_depth > 0 AND
            f.snow_depth > 0 AND
            g.snow_depth > 0 AND
            extract(month from a.dt) > 7
    ) AS snow_depth_conseq
GROUP BY year
ORDER BY year;

See what I mean? It’s pretty ugly. Running the result through the same R script as in my previous snowfall post yields this plot:

First true snowfall histogram

Between 1973 and 2008 we’ve gotten snow lasting the whole winter starting as early as September 12th (that was the infamous 1992), and as late as the first of November (1976). The median date is October 13th, which matches my impression. Now that the leaves have largely fallen off the trees, I’m hoping we get our first true snowfall on the early end of the distribution. We’ve still got a few things to take care of (a couple new dog houses, insulating the repaired septic line, etc.), but once those are done, I’m ready for the Creek to freeze and snow to blanket the trails.

Tags: , , , ,
cswingle @ 18:21:58 -0800

Sat, 29 Nov 2008

Turn left!

GPS track

GPS track, Goldstream Creek

I just got back from walking Nika and Piper on the Creek. I’d looked at my GPS track from yesterday’s walk on the Creek and saw an obvious shortcut (from point A to B on the map) to cut off some distance. My objective was to take the Creek out to a section line (at points D and E—click on the image to see a full size version) that I also saw from the satellite imagery for the area, and wanted a way to make the route shorter. Yesterday’s walk was more than five miles, even though a raven could have covered the distance in a little over a half mile.

We walked down the Creek, came to the start of the shortcut at point A, walked overland through the forest to point B back on the Creek, and I immediately turned the wrong direction. I’d already walked about halfway back to point A before I realized I went the wrong way. Next time, turn left!

It is amazing how disorienting the Creek is, even with a GPS. Because it winds back and forth so much, even if you know where you’re going and can see it on the little map your GPS is showing you, it’s really difficult to tell if you are getting closer to your objective. The good thing is that the Creek only goes two ways. If you went the wrong way, just turn around and go back.

Tags: , , , ,
cswingle @ 11:20:00 -0800

Sat, 02 Aug 2008

Blueberry season

Blueberries

two pints of blueberries

The blueberries on the left cost $8 at the Farmer’s Market this morning. The blueberries on the right cost me two hours of hiking around the trails with Nika and Piper. We’ve got a lot of blueberry bushes on our property, but it’s been so cloudy and wet that ours didn’t get enough sun to produce very many berries. So I had to go farther afield.

It was a grand time, except for when Piper refused to cross over a two-foot wide area of deep water. She’s extremely food motivated, but no amount of coaxing would get her to jump across once she’d discovered there was deep water in between her and the treat. All the while, Nika kept jumping in and swimming around while Piper looked eagerly at the treat in my hand, trying to figure out how to get it without jumping or swimming. I finally had to step into the deep water (filling my left knee-high rubber boot with water) and help her across. She could have jumped the gap easily, but I don’t think there is a treat large enough to overcome her dislike of water.

Along the way we saw a flicker, four spruce grouse, gray jays and lots of smaller birds I couldn’t identify. I’ve still got the wonderful smell of Ledum palustre on my clothes.

Tomorrow morning: blueberry pancakes!

Tags: , , ,
cswingle @ 14:59:27 -0800

Mon, 23 Jun 2008

Where to Invade Next

Nika, Where to Invade Next

nika, where to invade next

I wish there were stronger ways than words to express how ruinous George W. Bush has been to our country. From McSweeney’s Where to Invade Next:

So I came back to see him a few weeks later [a few weeks after 9/11], and by that time we were bombing in Afghanistan. I said, ‘Are we still going to war with Iraq?’ And he said, ‘Oh, it’s worse than that.’ He reached over on his desk. He picked up a piece of paper. And he said, ‘I just got this down from upstairs’—meaning the Secretary of Defense’s Office—‘today.’ And he said, ‘This is a memo that describes how we’re going to take out seven countries in five years.’
—General Wesley Clark.

The seven countries Bush, Cheney and Rumsfeld wanted to “take out” are: Iran, Pakistan, Uzbekistan, Venezuela, Syria, Sudan and North Korea. This book, edited by Stephen Elliot lays out the case the Bush Administration would like to have made had their plans in Iraq not gone so horribly wrong (“Mission Accomplished”, jackass). It’s quite sobering reading, because these really are bad places, and in the case of Sudan, something really needs to be done. But most of these countries (all of them?) were made far more dangerous by the invasions of Iraq and Afghanistan, and it’s clear (to me anyway) that this is pretty much our fault. We elected Bush (sort of). Frigging twice (kinda). We elected the Congress that rubber stamped everything he did. We allowed the media to become a corporate shill for the Administration. And now all of the good will we might have had to effect change in the world is lost. To help in Sudan.

Tags: , , , ,
cswingle @ 18:05:43 -0800

Sun, 02 Mar 2008

Skijor Photos

I took Nika out skijoring both days this weekend. She’s still doing really well, although she wasn’t pulling as hard on the way back as she did last weekend. We had a lot of wind on Friday and it blew debris all over the trail, so not only did that slow us down, but there’s a lot more distractions for Nika. Andrea took a few photos as we came back to the house. If you click on the images you can see larger versions. There’s a sled dog team behind me in the first photo.

Skijor action

nika pulling me

Me and Nika

me and nika

Returning home

returning home

Tags: , ,
cswingle @ 13:39:41 -0800

Sat, 23 Feb 2008

Skijor Dog

Tired Nika

good doggie

Andrea is out racing in North Pole and had plenty of handlers, so I decided to stay home. Instead of taking Nika for a regular walk, I waxed my skis and tried skijoring. Andrea taught her to do it almost ten years ago, but Nika hasn’t done it since, and she wasn’t very good at it back then anyway. Today I took her down to the Creek, put on my skis and hooked her up. She knew right away what was going on and she ran straight ahead and pulled like a champion dog. I have a two mile trail that starts on the Creek and then crosses up to the mushing trail in the forest for the return trip home, and Nika was hooked up for about two-thirds of it. On the mushing trail, she was pulling me fast enough that the wind was whistling in my hair and I was worried about what would happen if I fell down (I haven’t been skiing in ten years either…). Luckily, I managed to keep my balance, and except for dipping for poops, she kept up the pace the whole way.

I’m very proud of her. She did a very good job, and both of us had a good time.

Tags: , , ,
cswingle @ 15:46:40 -0800
Next Page »

Back to Swingley Development
Powered by WordPress

Switch to our mobile site