Saturday, March 13, 2021

Vaccinate! Vaccinate!

A lot of emotions today.

It was exactly one year ago today, March 13, 2020, we decided to send everyone home from work because of the Coronavirus. Our IT dept. stepped up and quickly installed remote desktop software and VPN solutions on hundreds of workstations. Some of us, like me, had dedicated development hardware, so I had to take everything home and then get a hardware VPN shipped to my house.

The following weeks were scary. We didn't fully understand how the virus was transmitted. We were scared to leave the house and store shelves were emptied. I ordered some necessary medications and cat food from the internet,  and when boxes were delivered, I'd just leave them sitting by the door for several days before opening them. 

I'm reliving these emotions today, not just because it's the one-year anniversary, but I also got my first of two vaccination shots today! What a year we've gone through collectively and some trials my family has gone through as well. We thought we'd be working from home for 2 weeks, a month at the worse. I haven't seen the inside of my office for 365 days now. One year!  I've heard from co-workers that needed to go in our office that it's a time capsule from life one year ago, pre-COVID.

As I waited for my shot, I remembered everything that happened this past year. In one week last December a family member was diagnosed with cancer, my granddaughter was born, and my father-in-law passed away from COVID.

When I got the call that I could get vaccinated, it was like a huge weight was lifted from my shoulders and I could finally see the light at the end of the tunnel. It will still be years before we're back to normal if there even is a normal anymore. I have no idea if I'll even be working in an office building again. But things are looking up. When it's your turn, do us all a favor and get your vaccine!

Friday, March 12, 2021

Emulation!

It's been close to 25 years since I last worked on writing an emulator. When I undertook that project, it was to prove that a game console (in my case, the Sega Genesis) could be emulated on a PC. I didn't even realize there was an emulation scene and I wasn't the first. I discovered all that after I wrote the emulator. I didn't really even know what I was doing with the emulator, so it wasn't code to be proud of. It did work and I could play a large percentage of Sega Genesis games and even emulated the 32X add-on decently well. Apparently, I was the first to do so. As I tried for more accurate emulation, it was clear my ad hoc experiments weren't the proper method for emulation. I would need to start from scratch.

I do remember briefly starting on a new architecture, but it didn't get far and I got distracted by other things that life throws at you. But, in the intervening 25 years or so, I've never stopped thinking about emulation. I think I've even coded a few in my dreams. It's great therapy when you can't fall asleep.

One week ago, on March 5, 2021, I loaded up Visual Studio and started coding. It's now been seven days and I have a running NMOS 6502 core running at a cycle level and it passed a functional test I found on GitHub.

So what are my goals with this thing? Let's start with a quick list:

  • Cycle accuracy. I don't mean I run an instruction and it updates the clock by 3 because it's a 3 cycle instruction. No, I mean I want to emulate what happens during each cycle of an instruction. Typically this means slow emulation, but I have some ideas to make this quick, and let's admit it, today's processors are wicked fast and we have a lot of cores to play with.
  • Each device (CPU, I/O, Video Chips, etc) will be self-contained. They will not know anything outside of what the chip can do.
  • A bus architecture to connect the devices (chips.)
  • An architecture plus a scripting language that will allow the user to quickly connect various devices (chips) together to create a wide variety of different computers and game consoles.
There! That shouldn't be too hard, right?

By my second day of coding, I had a base device class, a bus class, memory devices, RAM, and ROM. I also came up with the idea of a pin class. A device could have any number of pins, such as RES (for reset), IRQ (for interrupt), etc. and the pins could be connected between devices. A DMA chip could lower the RDY pin on the CPU so the processor would stop processing while the DMA happened. These are the sorts of details needed for highly accurate emulation. Along with the Pin class, I added some basic gate classes, such as AND and OR for connecting them like a real digital circuit.

I spent 3 more days and coded up a NMOS 6502 emulator. After bouncing around ideas for months, I ended up with a large table that was 7 TStates wide by 256 opcodes tall. Each entry would be a 'task' that would be completed by that opcode during a specific TState (cycle.) I started coding these up, and I was going to need too many unique tasks that were really similar. Then I realized I could encode the command in the higher bit ranges and the lower bits could encode registers, etc. I had basically just re-invented micro-coding, which is how most CPUs after the 6502 were implemented in silicon. I ended up with 33 microcode ops, but if I was a bit more clever I could write fewer. I haven't yet implemented the illegal 6502 instructions, but due to the nature of how they work, they are basically combinations of existing instructions so they shouldn't need any new micro-ops. I will simply need to update the table.

I do plan on emulating every variant of the 6502 ever made. And since I have this table of microcode, I won't need to hack my actual C++ code, but instead, just have an alternate microcode table for processor variants.

Tonight I finished testing with Klaus Dormann's 6502 Functional Test. I added some timing info and the test is running at the equivalent of a 109 MHz 6502! Just a tad faster than the Apple ][+ I grew up with!

I'll finish up this first (of many, I hope!) development blogs with a small bit of code. This function creates a computer using a 6502 and 64K of RAM then starts running the functional test.


static void DormannFunctionalTest( void ) { 

// create a test 6502 computer

RAM ram( 0x10000 );

Bus bus;

MCS650X cpu( MCS650X::MOS6502 );


bus.AddMemory( &ram, 0x0000 );

cpu.SetBus( &bus );

        cpu.AttachRDY( &VCC ); 


bus.LoadBinary( "6502_functional_test.bin", 0x0000 );

bus.Write16( 0xfffc, 0x0400 ); // start vector


// Run for awhile

for (;;) {

cpu.Update();

}

}

For now, I directly called the CPU's Update function. Later, I'll add a Machine class that will have a clock and will automatically call the Update functions for all the devices in the machine.

If anyone knows a nice way to imbed code in blogger.com, let me know!


Sunday, December 13, 2015

Calibrating Lightroom colors

When I post-process a photo in Lightroom, I usually work top down through the settings. Sadly the Camera Calibration setting is at the bottom, so I've just spent time manually correcting colors which should have been corrected through calibration. Any of the options in the Camera Calibration menu should have been done first. In this post, I'll show how to calibrate the colors for your specific camera and make this calibration the default when you import an image from that camera.

First off, you'll need to buy a few things: a color card and some lightbulbs. For the color card, I use a ColorChecker Passport from X-rite. You'll also want to get two lightbulbs, one at 2850K color and the other at 6500K. The 2850K is easier to find and I found one at a local hardware store (about $5 for a pack of 4.) You can do the calibration with just one lightbulb if that's all you can find. For this article, I only found a 2850K. The bluest I could find was 5000K.

Next, take a camera raw photo of the color checker with a single lightbulb (it's important that you shoot this photo in raw mode, not JPG.) Do this for each of the light bulbs, or just one if that's all you have. Now import these photos into Lightroom and export them as DNG files (Adobe's raw format.)

Unprocessed photo under 2850K light bulb.

You now need to download the calibration software from Adobe's website: DNG Profile Editor

After downloading, run the editor and load your photos. Each photo will have four colored circles on the image. Drag these colored circles to the matching four corners of your color card. On Chart tab, select the color of the lightbulb for the image (2850K) then click the "Create Color Table..." button. You can repeat the above for a 6500K image if you have one.

Your image of the color chart should now be displayed with proper white balance and you now have a calibration for your camera. The DNG file already knows what camera took the picture, so the calibration you created will only show up in Lightroom when editing photos taken on that same camera.

Now, jump to the Options tab and type in a Profile Name. For my example, I used "Tim's 5D3." And finally, go to the "File..." menu and choose "Export <camera> Profile..." This will write the calibration file to a location that Lightroom can find.

Now run Lightroom again (if it's already open, close and re-run it to make sure it loads the calibration file.) Choose a file without any edits such as the color card photo you just took. Go to the Camera Calibration section, and change the profile to the one you just made. It probably says "Adobe Standard". When I click on it, I also see Adobe's defaults for my Canon, and at the bottom "Tim's 5D3".

After selecting your profile, go to the Develop menu and select "Set Default Settings..." When the dialog appears, you want to click the button labeled "Update to Current Settings." This is now the new default when you import a photo taken on this camera. Any other changes you made to this image will also be the new defaults, so make sure you reset all your edits before setting the new profile and updating the settings. While I was here, I also went ahead and enabled lens correction in my defaults.

Below are two images with the Adobe Standard profile and the profile I just created. The Adobe Standard image has a slight green tint and the image from my camera's profile looks more natural and more closely represents what I saw when taking the photo.


Adobe Standard


Tim's 5D3 Profile

Update!

It turns that finding a 6500K lightbulb isn't that hard after all, especially if you search for 6500K instead of 6400K. Whoops. So my new lightbulb just arrived, and this time I was able to create a calibration for both 2850K light and 6500K and now my calibration looks very close to the Adobe Standard. Interesting. I did kind of like the cooler look I got when only calibrating to 2850k. When toggling between the newest calibration and Adobe Standard, there is still a small differnce, but nowhere like I showed. I still think it's important to do this for each camera you own. Soon I will calibrate several of my other cameras as well and see what the difference is.

Thursday, December 10, 2015

Adam Ruins Cars

Last night I caught Episode 3 Season 1 of Adam Ruins Everything. On this episode, he ruins cars. Quite a fascinating episode and I found it interesting how almost everything he said is wrong with cars can be fixed with my future vision as outlined in my previous post.

1. We're stuck with a dealer model for buying cars. No online shopping or direct buying from the manufacturer. In my vision, car ownership is dead and we just get rides in them.

2. Insurance is an issue, but when cars become autonomous and they are no longer owned by individuals, we will no longer need car insurance.

3. Our cities and towns are turning into parking lots. Well, without car ownership, an autonomous vehicle shows up in front of your house and takes you to your destination. It then drives off to give the next person a ride. Parking lots will be a thing of the past and we get to reclaim our cities.

These are just a few points I wanted to mention. But really, everyone should be watching Adam Ruins Everything. Great TV show.

Sunday, December 6, 2015

The Next Revolution

As a computer programmer, I have always had a fascination with teaching computers to perform amazing things. Specifically, teaching computers to replicate tasks that humans can perform. This includes tasks such as deep learning neural networks and my current interest: computer vision. With this as my background, it was with great excitement that I followed the DARPA Grand Challenge in 2004 & 2005. The Department of Defense was offering a $1 million prize to anyone that could develop an autonomous vehicle that could drive a set course set through the Mohave desert. No vehicle completed the challenge in 2004, but in 2005 four teams completed the course in the allotted time. This was a huge breakthrough in robotics and got the engineering and business community to start taking autonomous vehicles (self-driving cars) seriously. When I was a kid in the 1970's I remember my dad telling me in the future cars would drive themselves. I couldn't imagine how they would work, but my dad explained that we would lay cables in the roads and the cars would follow the cables. Of course! But would we really put cables in all the roads? That would require a massive undertaking. A few years later I read an article (Popular Science I believe) that scientists in California had embedded some cables in a road and were testing this exact idea. But this seemed such a complicated way of going about this, but no one (well, not me anyway) was imagining that 30 years later we could write computer programs that could see the world around the vehicle and learn how to drive safely through the world just like a human.

A number of people working on the DARPA Grand Challenge vehicles were soon hired by Google and a few years later shocked the world by demonstrating they already had an autonomous vehicle driving around California roads. At the same time, road cars were already getting adaptive cruise control with limited lane following features and GPS mapping was included in nearly every car sold. As I write this in 2015, nearly every car manufacturer is working on autonomous driving features for their cars and it is believed that fully autonomous cars will be available for purchase within two years. Tesla has already updated its fleet of Model S sedans (well, those that can support it) with an advanced cruise control that can follow lanes on the freeway.

For quite awhile I have been thinking about the implications of autonomous vehicles and I believe they are about to cause the next great revolution and forever change how we live. Below is a list some of the big changes I believe will happen as a result of this technology and why it is a revolution and not a gimmick.

SAFETY.

This is the topic most people are focused on right now and are using as the selling point for autonomous vehicles. The naysayers will say that they can't trust a computer, but can you really say you can trust humans either? Autonomous vehicles will continue to learn and can only get better, whereas humans are limited in their capabilities and make mistakes. Machines never get tired. They don't get intoxicated. They don't have bad days at work. They aren't distracted. In fact, humans barely notice what's going around them compared to an autonomous vehicle which can see every single thing happening around it hundreds of times per second. A machine has split second reaction times. When all cars are autonomous, they can communicate with one another and warn each other of road conditions. Accidents and injuries to humans will soon be a thing of the past. When this happens, cars will be built without safety equipment. No more heavy crash structures, restraint systems, or airbags. You'll be able to move freely throughout the vehicle. Want privacy, just close the curtains on the windows.

INSURANCE.

At first, insurance will get complicated. Who is to blame when there is an accident? To get this technology off its' feet, the manufacturer's are already stating they will accept liability in case of accidents. As cars become more and more autonomous, the need for insurance is going to diminish because of the previous point: autonomous cars will reach a point of no accidents. There will still be “recreational vehicles” in the foreseeable future that are human driven for fun though probably not allowed on freeways. As autonomous vehicles reach a majority, human driven cars will take the brunt of liability insurance it will become too costly for humans to drive cars on public roads and driving a car will become of memory.

EFFICIENCY.

When all the cars on the road are autonomous, the rules of the road change. In fact, rules exist to make people play well with each other. Machines need a smaller set of rules. Autonomous vehicles will drive at higher speed on long roads. They can drive close together in packs to reduce wind drag and increase energy efficiency. They can negotiate intersections safely without the need for stop signs and red lights. Without human drivers, traffic jams will be a thing of the past. The cars will know the road conditions at all times and can route around troublesome areas. As safety equipment and human controls are removed from cars, they will become increasingly lighter weight and more energy efficient. Travel time will reduce dramatically for many people. Traffic will no longer make you late. No more road rage and being angry at other drivers. Since you don't need to drive, you can also use your time more efficiently. Start getting stuff done for work, or read that novel you've been enjoying, or catch up with some shows on Netflix. No more sitting for hours behind the steering wheel going nowhere.

FREEDOM.

Driving a car is a great pastime for may of us, myself included. It's not going to be nice losing the ability to drive our cars anymore and some people aren't going to take this sitting down. But autonomous vehicles are going to open up vast vistas of travel to many people that could have never hoped to drive a car. People with disabilities and the elderly who can no longer safely operate a vehicle will suddenly have the opportunity to travel at any time to go anywhere. For years, I have thought about how horrible it's going to be when I get older and my driver's license gets taken away and I can no longer be independent. But now, I'm excited knowing that by the time I'm too old to drive, autonomous vehicles will be commonplace. Have you been alone and felt ill and were unable to drive yourself to the doctor's office? No problem now. Do you have car trouble? Pull to the side of the road where another car picks you up within minutes and you continue your trip. If the autonomous vehicle senses an issue with the car, it can take itself to the shop.

OWNERSHIP.

This is where the true revolution begins. When you stop and think about modern society, you begin to realize how insane we are. We all own cars. Yet how often do we drive them? I drive 10 to 15 minutes to work, where my car then sits in a huge parking lot all day, then I drive 10 or 15 minutes back home, where it then sits in a purpose-built garage in my house. So, on a given workday, my car is parked 98% of them time! Every member of my household has his/her own car. All of my neighbors have cars. I look down the street and there are two to three cars in every driveway. With autonomous vehicles, sharing cars is simple, and they never need to park. Imagine every single car can be shared and we not responsibilities of ownership. If I need a ride anywhere, there will always be a car somewhere in the vicinity. We've had this with limited availability already with taxis, and recently with private drivers through Uber, and numerous car sharing businesses. But with all these current systems, the inventory of cars is limited and getting a ride is still a waiting game. When every car is shared, things change radically. You just tap a button on your smartphone and the closest car picks you up and takes you where ever you want to go. My office will now have grassy parks instead of parking lots. When I go Christmas shopping I don't need to circle the mall for 45 minutes trying a find a space to park. I no longer drive to long-term parking at the airport and then ride the bus to the terminal. No more parking fees. No more stashing Quarters in the car for parking meters. The autonomous cars will most likely be all electric, such as Teslas, so they can charge themselves when needed. No more range anxiety with an autonomous electric vehicle. When the battery starts getting low, the car can stop for a charge and you can switch to a freshly charged car that is waiting for you. After 200 to 300 miles, you need to stretch your legs anyway. Finally, when car ownership is removed from the equation, so is car theft.

FUN STUFF.

If cars can drive themselves, then they can do some tasks without a human at all. Package and mail delivery won't need a human driver anymore and can happen 24 hours a day. Did you buy too much stuff at Home Depot? Load up 3 cars or trucks with everything you bought and send them to your house where they'll be waiting when you get home. Your friend who lives 20 minutes away wants to borrow something from you, so you toss it in a car and the car drives it to their house. It doesn't even need to drive back. Want to go for a long hike, have a car drop you off at the trailhead and have it, or another car, waiting for you 10 miles away at the other end of the trail. Going for a nice walk and it suddenly starts to rain? Grab your phone and call the closest car to come rescue you and get you home. As the cars get more intelligent, they'll predict your patterns and they'll be waiting for you after work. They'll be lined up at the grocery store waiting in the check out lines. Your child gets out of school at 2:30 but you can't leave work to pick him up? Have an autonomous car pick him up. The possibilities are endless when you start thinking about it.

*  *  *


That is my vision of the near future. No more car ownership, no more parking lots, no more insurance, and no more accidents. A car picks you up, drops you off, then repeats this with the next person who needs a ride. With cars getting maximum use, the number of cars manufactured will drop a hundred-fold. We just pay for the time or mileage we travel. Anyone at any age or physical ability can get a ride. I will miss driving my car, but I also can't wait for all the new possibilities this will bring! And the most amazing thing is I don't think we need to wait long. The first steps of this vision are already starting and in ten years we will be 50% of the way there. Approaching the final goal of 100% autonomous vehicles could take significantly longer, but once we reach a tipping point, legislation could make it happen even sooner.

Monday, September 26, 2011

Mt. Whitney (Sept 16-24, 2011)

The time has finally come to head for Whitney and see if my training and preparations will pay off. Mt. Whitney is the highest point in the contiguous United States at 14,505 ft, and until this year my highest hike has been around 9,500 ft! I had no idea all year how my body will react at high altitude and I was anxious about this trip. Three weeks previously I spent a week at Mammoth where I hiked to 10,000, 11,000, then finally 13,000 ft at Mt. Dana. Other than being short on breath, I didn't seem to suffer from any altitude issues, so my confidence was good, though I was still wary. Before leaving, I decided to contact my doctor and get a prescription for acetazolamide (aka Diamox.) The Diamox makes you excrete bicarbonate from your kidneys via urine thus acidifying your blood, which increases the oxygen content in the blood. A similar effect happens naturally through hyperventilation, but takes a much longer time (acclimatization.) Even though my previous hikes showed I might be OK at altitude, I still wanted to use the pills since they should make it easier to breather and shorten the time to climb to the top of the mountain. I tried my first pill on Thursday, the day before leaving, and I really did not like the side effects. I had the tingling in the extremities like everyone complains about, but also developed a really bad headache that afternoon and evening. I decided to wait and did take my next pill until Saturday afternoon, the day before starting hiking up Whitney. I wouldn't have any more headaches, but the pins and needles lasted the entire trip.

Friday morning I quickly packed and headed to NJ's house to pick him up and start driving. We got on the road a little late and I decided to follow the GPS directions instead of the way I knew was shorter. We ended up with quite a long drive and reached our camp site at the White Mountain trail head after dark and behind schedule by an hour. The rest of our group (we were 8 in total) was already there and preparing for bed. The rest of the group that had arrived earlier and stopped by the Ancient Bristlecone forest on White Mountain and did one of the short hikes through the 4,500 year old trees. I had a done a similar hike several weeks before and didn't need to do it again. Though everyone was preparing for bed, NJ and I still had to set up our tents and make dinner. The White Mountain trail head is at 12,000 ft and we were staying there to help acclimate to the altitude. The mountain was quite exposed in addition to the altitude, so it was quite chilly. At around 8pm when we arrived it was already lower 30's and would soon drop to the mid to upper 20's.

Our campsite on White Mountain.

A really nice write-up on the White Mountains can be read here.

The next morning, Saturday, we were planning a simple hike on White Mountain. Three from our group were going to hike to the 14,246 ft summit (14 mile around trip) and the rest of us would hike the first 3 miles up and back. Not much mileage or altitude gain, but it was enough to get our hearts beating and get used to hiking at high altitude. We had time to do the entire summit hike, but at 14 miles, I wanted to save my feet for the grand prize starting the next day. NJ wasn't feeling at his best since he was recovering from a 2 week long cold so he opted not to hike with us and did a short 1/2 mile or so on the trail on his own. Everyone was getting used to their Diamox and it was a bit of a comedy with everyone having to stop and pee every 15 minutes since it's a diuretic. Luckily, the more you take Diamox, the less the side effects affect you.

An old rusty observatory on White Mountain.

Myself posing in front of the White Mountain peak in the background.

After the White Mountain hike it was time to pack up and head to Lone Pine, CA, where we would meet for dinner. One group with JY would also stop and pick up our permits. A few of our group were new to backpacking, so after their first night on White Mountain they had to hit the outfitting stores and pick up some items they missed and some sleeping bag liners to keep warm. I loved my Marmot 15 degree bag and stayed toasty warm and didn't even need to wear socks.

After our dinner in Lone Pine, we headed up to Whitney portal where we had a campsite for the night at around 8,400 ft. As we got a out of our cars and were about to set up our tents, I black bear casually walked passed our cars and through our camp site. We we warned by the rangers that the bears were being aggressive since winter was around the corner and they had to fatten up. As long as I wasn't dinner, I wasn't bothered.


Morning in our two campsites at Whitney Portal.

We got up early on Sunday morning and started to break camp in preparation to begin our Whitney hike. It was my understanding that we were all grabbing breakfast at the Whitney Portal Store at the trail head, but everyone decided to just have breakfast in camp. NJ and I hadn't brought extra food, so we left camp 20 minutes before everyone else and headed to the store. We both had an awesome breakfast of eggs, hash, bacon, and toast. NJ wasn't feeling hungry from his cold (or altitude?) and only ate some of his breakfast. I cleaned my plate and felt well satiated. I wouldn't be lacking any energy on the hike. As soon was finished our last bites, the rest of the crew showed up at the trail head so we headed over.


First thing was to weigh our packs. This was JY's second time up Whitney and the first for everyone else. Last year his pack weight was 45 lbs and he was hoping for a smaller pack this year. His weighed in at 52 lbs! The heaviest in our group. I came in at the lightest at 30 lbs and NJ, who followed my lead and got some of the same gear, was second lightest at 32 lbs. Everyone else was around the mid-30s.

At the Whitney trail head ready to set off for Trail Camp.

As we started up the trail, I took up a position near the back, since I figured I was one of the slower hikers. I'm a strong hiker at times, but I hike better setting my own pace, which is usually a bit slower than other people. After a half mile or so I ended up in the fourth position and remained there the rest of the hike. NJ really struggled and was setting a slow pace. I assumed his cold was still affecting him, but later I heard he had to stop a lot to catch his breath a lot. Since JY was a veteran of Whitney and a strong backpacker, he was acting as the "sweeper" to make sure anyone lagging behind still made it up. He ended up hiking the 6 miles to Trail Camp alongside NJ, encouraging him all the way.

Looking back towards Lone Pine Lake.

Mirror Lake


About 2 miles from Trail Camp, I still had 2 of 3 of our group in view in front of me and I had long lost sight of the 4 behind me. At this time I also started feeling nauseous, which of course, hiking at altitude, made me very nervous. I was still at 10,500 to 11,000 ft at this point and I've shown I could hike w/o issues well above this height. I then started burping a lot and felt like I had diarrhea coming on. I then realized my problem wasn't altitude, but eating a large greasy breakfast mere minutes before starting a strenuous hike. Didn't mom warn me about swimming after eating lunch! Same problem. By the time I was approaching sight of Trail Camp, I had to stop after almost every step to keep myself from vomiting. I know it would have made me feel better to do so, but I was worried about dehydrating myself. So I just walked slower and slower with more frequent breaks until I started to feel better. Amazingly, with all these stops and slow hiking, the four members of our party behind me never caught up or passed me. Though, when I walked into camp, I realized two of them were mere minutes behind me. It would be at least another hour and a half before NJ showed up in camp with JY at his heels. Since I was still nervous about not feeling great and NJ's struggle, I figured the two of us probably wouldn't do the summit the next morning and I was OK with that. As long as I tried my best, I would be happy.



Morning alpenglow as seen from Trail Camp.

Monday morning I awoke, made breakfast and started getting ready for summit day. I was feeling great and wasn't noticing the altitude at all. So far, the Diamox was working wonders and I had no problems breathing. I didn't talk to NJ much but remember asking if he felt any better from his cold and I mentioned he shouldn't try to summit, just go part way. I figured he would be slow enough anyways that I'd see him at the halfway point on my way down and just tell him to turn around.

We were soon on the trail and I was making good progress up the mountain. The first half of the summit hike is 99 switch backs that go up to the mountain ridge and cross over a pass to the other side. We soon spread out and NJ fell quite far behind. Disregarding NJ, I was the slowest going up in 7th position, but when everyone ahead of me would stop for a breather, I usually caught up to them within a few minutes, so I wasn't too far back. Since NJ didn't need to make it to the summit and he could turn around at any time, no one stayed back to help him. We would see him on the way back down.

Looking toward Whitney summit from the switchbacks.

Looking down at Trail Camp and Consultation Lake.

Crossing over the pass to the back of the mountain.

It took me 2 hours to reach the pass and now I just had to follow along the back of the ridge line towards the Mt. Whitney summit. The climbing wasn't as steep, but it was slower due to the altitude. The end of the trail turns right and heads straight up to the summit. I could really feel the altitude at this point and it made the hiking much slower, but it was a really nice section of the trail so it was much easier to hike at a slow consistent pace. Earlier on the trail, there were big steps over the rocks so at times you had to use a lot of energy and effort, which is hard with so little air. The Diamox did its job and I never suffered too much on the way. After the brief section up, I had reached the top of Mt Whitney four hours after starting up the trail. Man, it felt so good to reach the top, and honestly, it didn't feel that difficult of a hike. It was only 5 miles up and not that hard as most hikes go. It's the altitude that makes it difficult and all my training, acclimatizing, and even the Diamox, paid off and I got to the top without too much difficulty. With me at the top, 7 of our 8 had made it up. None of us thought NJ would make it and we assumed we'd meet him back at the halfway point and tell him to turn around, if he hadn't done so already. Most statistics say that 1 in 3 that try to climb Whitney make it to the top, so we did well with 7 of us making it. Though to be fair, aside from NJ, everyone in the group were seasoned hikers, even though a few were new to backpacking.


Posing at the top!

Great views from the summit.

The Whitney hut.

After playing around on the top, we all started heading back down. Going down is always easier, especially at high altitude. We had only been going down 15 or 20 minutes when we saw NJ on the way up. He was actually quite close to the summit and would probably make it (he did, btw, making it 8 of 8 for our group.) He didn't show any sign of distress and was simply going at his slow pace. In fact, I saw another couple just ahead of him that I had passed near the bottom, so there were others hiking at his pace as well. Even though we were only 20 minutes down from the top, I figured it would take him 1 hour to worse case 1 and a half hours to reach the summit. This would have him arriving at 2:00 to 2:30.. which was before the agreed upon safety turn around time of 3:00. He should then be back at camp by 6:00, and the latest of 7:00, though a few people thought his slowness was downhill as well and he could arrive after 8:00.. Since I had done some hikes with him, I knew he was fast downhill and was confident we'd see him by 6:00.

I made good time going down and it looked like I would make the estimated 3 hours down and arrive at camp at about 4:30 or so, which I did. When I was within a half mile of camp though, my body started to shut down and I just completely ran out of energy for some reason. I even grabbed an energy bar and it seemed to make no difference. My body felt like it just wanted to stop and have a 30 minute nap. But, I was so close to camp I just pushed on and soon arrived. I pretty much collapsed and simply relaxed for 30 to 60 minutes. Everyone was wondering when NJ would be back, but I was still betting he would making by 6:00. But, at 5:00 some clouds rolled in and it started to sleet at our campsite. Soon after there were lightning flashes across the sky and we really started to panic with NJ still on the mountain. I just knew he was only an hour away, but with everyone else thinking he was still 2 to 3 hours away, the nervousness around camp was really spreading. We even looked in his tent just to verify he had his warm clothes and his water proof jacket. It only takes minutes to get hypothermia on a mountain if you're unprepared. We really began to fear the lightning and hypothermia on the mountain. What really happened caught us by surprise.

At 5:30 a man came running through camp asking if were NJ's group. Apparently NJ was in trouble on the mountain at the cables and needed his insulin. (Good news was the cables aren't that far from camp, so NJ had made good progress coming down.) NJ is a type I diabetic and has an insulin pump. I didn't make sense to me that he needed more insulin since his pump carries plenty, plus the energy he was burning and I know he wasn't eating much, I wondered if actually he was having low sugar and just need some sweets. Regardless, we gathered together his medical supplies we found in his tent, plus some power bars and an extra bottle of water. NB was our strongest hiker and nurse so she immediately headed up the mountain with SK. NJ was close enough to camp that I could actually see them reach him. I was completely nervous and worried, not knowing what was happening to my close friend, plus I didn't have the energy to help him myself. Though, the adrenaline that hit me at this point completely supercharged me and I think I might just have been able to run up the mountain to help.

NJ came into came by 6:00 and was in bad shape. He was vomiting a lot and was obviously suffering from AMS (Acute Mountain Sickness). He then told us he hadn't eaten all day and only drank 13 ounces of water, not even close to the 2 to 3 liters you should drink while hiking. Even worse, because of his vomiting, he couldn't keep drink any more water, it would just come back up. I really began to get scared that he would become extremely dehydrated and we needed to worry about that more than the AMS, though curing the AMS might allow him to start drinking again. NJ hadn't fully realized he had AMS... when he started feeling sick, he checked his insulin pump and saw that he had ripped the line that feeds the insulin so it was no longer working. That's when he panicked and sent for help. Luckily the first person he asked on trail for help had a radio and could talk to others from their party at Trail Camp who then found us. After testing his glucose levels, they weren't that bad, so his diabetes wasn't the problem. It was AMS and dehydration.


Sleet on my tent.

Sunset with storm clouds.

Sunset behind the needles.


After several emergency meetings and coming up with several plans, it was decided we would give NJ 20 minutes to rest. If his nausea went away and he could start drinking, we would wait until morning, otherwise we had some plans on heading down that night, even though the sun was almost gone at this point. NB, our nurse, did most communication with NJ. Not just because of her nursing knowledge, but also because she would appear as an authority figure to NJ because she was a nurse and he would be more likely to listen to her. Luckily he realized how bad his situation was and would do whatever we told him to do.

For the next few hours NJ's nausea seemed to have abated and he drank a small amount of water and we felt we could wait until morning when it would be safest for everyone to hike down. We still knew he was in bad shape and he needed medical attention quickly. We went to bed at 8:00 to get ready for an early morning start when the sun came up. Unfortunately NJ started getting really sick again around midnight and was sick continuously all night long. In hindsight, we all wished we had just risked it and taken NJ down the mountain at night to get him help sooner. But it's hard to make a correct decision when you don't have all the information.

When we broke camp in the morning, we split up NJ's gear among our packs so he would have minimal weight to carry. Our plan was to send four of our group ahead and they would quickly get to the Whitney Portal trail head and make sure the authorities knew we were coming down with a sick person. Hopefully an ambulance could be waiting at the bottom for us. JY, NB, and myself then started down with NJ in tow. NB at point and myself directly behind NJ, ready to catch him whenever he lost balance. After a half mile or so another hiker saw we had a sick member and refuse to leave us until he knew we got NJ to help. What a great person to stay with us and help with NJ! He also took NJ's lightened pack and carried it with his own. I could see NJ actually walking a little faster and at the end of the day, he really needed the help. At this point NJ had not eaten in over 2 days and hadn't drank in a day and half. Plus he had no sleep. His energy levels were pretty much at zero, yet we needed him to get himself down the mountain. We couldn't carry him.

We were also testing NJ's glucose levels and they were rising dangerously high as we were descending. By this time, JY, NB, and myself realized NJ would never make it to the trail head. Our only option was to make it to a place where we could get a helicopter to land. We knew from talking to rangers previously that a helicopter could get into Outpost Camp, which was 2 miles down the mountain from Trail Camp where we started and 4 miles from the Whitney Portal trail head. So we kept pushing NJ towards the camp. I don't think I will ever know how he found the energy to hike those two miles. Our plan was to send NB to the bottom when we reached the camp and she would arrange the helicopter. She was a fast runner, plus being a nurse, should explain to the authorities how bad NJ's situation had become. As tired as NJ was, he realized we could get him help even faster if NB left now before we reached the camp, since it would take NB at least an hour to run the 4 miles from Outpost to the bottom plus another hour or more to get the helicopter in the air. So NB started running down trail and it was just JY, myself, and the stranger helping NJ. I don't know how long it took us, but it seemed to take forever.

It was a real relief to finally make it to Outpost Camp and NJ didn't look like he could have walked another 100 yards. He had saved his own life getting himself down the mountain. I've left out many details of the hours it took us to cover the 2 miles, but NJ vomited at least 30 times and we kept trying to get him water, if only to wet his mouth.

About 30 minutes after reaching Output Camp, JY and I heard the *thump* *thump* from a helicopter approaching and we waved our arms around and we were quickly spotted. After a few circles the helicopter settled on a flat spot less than 30 yards from where NJ was sitting. When the other campers in the area realized what was happening and that it was our friend who needed the help, 3 or 4 of them ran to NJ and huddled around to keep the helicopter wash from blowing him over. I was running around trying to help some of the camper's tents that were being blown over. Within 20 seconds of touching down, NJ was already on board and in the air. Because of weight, the co-pilot and some rescue gear had to be left behind and the helicopter came back about 10 minutes to later to pick him up.


NJ's ride to the hospital.


JY and I quickly helped the campers set their tents back up and restored some order to the camp. We then started down the trail at a very fast pace with me in the lead. I had a really strong drive to get to the bottom and get myself to the hospital as fast as can, even though NJ was safe at this point and my own speed no longer mattered. It took a bit over an hour to cover the 4 miles to the bottom, where we met most of our group waiting. I gathered all of NJ's gear that everyone had helped carry down and I was soon in my car racing towards Southern Inyo Hospital in Lone Pine, about 30 minutes away.

At the hospital I just started running up and down corridors until I found NJ in a room that turned out to be the ER. When I got there he was finishing his fourth IV bag and about to start is fifth. The blood tests they gave him when admitted to the ER had shown that he a flu virus and should have never gone on the mountain. It wasn't a cold he had, it was the flu! Looking back, all the clues were there since he wasn't eating enough. But altitude also takes away your appetite so it wasn't quite so obvious.

NJ was initially admitted for AMS and hyperglycemia.  By the next day, Wednesday, his diagnosis would be changed to HACE (High Altitude Cerebral Edema), a much more dangerous altitude sickness that is often fatal. I ended up staying in Lone Pine for four nights and spent the afternoons in NJ's room while he healed. He looked quite bad for the first 2 days, but by the 3rd, his old self was returning as the brain swelling from HACE had normalized. His biggest problem by the end of the week was the damage to his throat from the vomiting and dehydration. He couldn't swallow any more. When I finally had to leave from home on Saturday, NJ was finally able to start drinking. I'm writing this blog on Sunday night and it's believed he will be released by Monday or Tuesday and will be able to go home.

On NJ's 3rd day in the hospital he was moved to another hospital room. His new roommate was none other than the guy whose tent was blown over during the helicopter rescue. The very next day as he hiked up Whitney, he began to feel odd. After remembering how bad NJ looked getting on the helicopter, he decided not to push his luck and turned around and headed back to Whitney Portal. He was still feeling bad and went to the hospital where he was diagnosed with HAPE (High Altitude Pulmonary Edema.) His was a mild case and he was released the following day.

Looking beyond NJ's medical emergency, it was a successful trip, at least on a personal level. I managed to summit Mt. Whitney and all the problems I feared about myself never happened. I'm even proud of myself and fellow hikers on the mountain for getting NJ to safety and as quickly as possible. I didn't dwell on describing how bad he looked at times, but I think we narrowly escaped a a real tragedy on the mountain. When sitting next to him in the hospital, I cannot see how he could have walked down the mountain in the shape he was in. It was quite an amazing feat. For now I like to think of him as the true hero in the story for saving himself, even though it could be argued he also got himself into the situation to begin with. It was his stubbornness that got him into trouble and saved his life.

All photos are on SmugMug.

GPS Track on Everytrail.

Monday, September 12, 2011

Pt Reyes (Sept 11 2011)

As a last minute warm-up before heading off to Mt Whitney, a few us decided to have an overnight camping trip to Pt Reyes. We planned about 11 miles on Sunday, then a quick 6 miles back Monday morning and make it back to work by noon.

Only JY, NJ, and myself ended up on the trip. Everyone else bailed or no-showed. To make it worse, NJ was at the tail end of a bad cold and JY was a few days into his cold and looked miserable. The fog lingered much longer than normal, so the hike along Skyline trail was basically drizzle conditions from the fog condensing and dripping from the trees, so we were all soaked for at least half the hike. After a nice morning hike we made it to Arch Rock, threw off our 20-30 pound packs and decided to relax. JY pretty much fell asleep as soon as he sat down and NJ and myself decided to the explore the beach below Arch Rock. I've hiked here a dozen times before before never actually got to see the "arch" in Arch Rock until now. The creek that follows the trail to the ocean actually cut a tunnel through the rock outcrop. It's quite cool.




After our 45 minutes of playing, NJ started pressuring JY to head back home. From Arch Rock it was 4 miles to the camp site or 4 miles back to the car. JY didn't look good and really should be back in bed recovering before we go to Whitney at the end of the week. After a bit more discussion, we decided we would all head back and grab a dinner in Pt Reyes Station.

When I got home I was beat. That hike was the heaviest load yet I've put in my pack. I didn't try to pack light as I wanted to see how much I could take. It surprised me how much stress a heavy pack puts on your legs and feet. That trip should have been easy for me in my current shape, but it wore me out. For Whitney I will definitely get my pack weight down.

Photos are on Smugmug.

GPS Track on Everytrail.