Sunday, March 26, 2017

Canon 28-105mm f/3.5-4.5 USM II

TL; DR - use it at f/8 and it has (almost) L-class sharpness.

Back in 2001 or 2002 this was one of the lenses I wanted. It was too steep for me and I ended up with a Sigma 28-105mm f/2.8-4 (the infamously soft and bulky lens) which I used for some time on an EOS3000N and EOS50 until it got damaged (diaphragm stuck wide-open).

Fast-forward fifteen years and I have one from KEH for about $120 in "bargain" condition.

I have two lenses that cover (parts of) the range of this 28-105mm: the 16-35mm f/4 L IS, and the 70-200mm f/2.8 L IS. I was planning to compare these lenses but it turns out that The Digital Picture already has a lens comparison service. So here's the summary (so far as I can tell) on a 5D Mk III (which has the same sensor as my 6D):

Compared to the 16-35mm f/4 L IS (an $800 lens):
  • at 28mm and f/8, the 28-105 almost matches the 16-35mm wide-open (at f/4)
  • this is also true at 35mm
Compared to the 70-200mm f/2.8 L (a $1200 lens):
  • at 70mm and f/8, the 28-105 matches the 70-200mm at 105mm wide-open (at f/2.8) and at f/4, but notably the 28-105 has better corners than the 70-200 (note we are comparing f/8 to f/2.8 and f/4)
  • at 105mm and f/8, the 28-105 matches the 70-200mm at 100mm wide-open (at f/2.8) and at f/4, but the 70-200 beats the zoom in the corners even at f/2.8
The long and the short of it: the 28-105mm can produce almost-L class sharpness so long as you stick to f/8. However, the 28-105 has one massive feature that trumps these L lenses:
It is tiny (about the same size as a 35mm f/1.4) and not much larger than the Nifty Fifty.

My wife and I have traveled a lot with the 6D and 16-35mm f/4 L IS, and it is quite a large and bulky setup, which is why we ended up also buying a Canon G5X (which has a 24-105mm equivalent lens, with IS, and a 1" sensor). The G5X is tiny, but slow (slow to auto-focus and take photos) and has an EVF instead of an optical viewfinder.

I was stuck with the 16-35mm in Monterey in October 2016 when we went whale-watching, and 35mm is much too short for whales.  The 28-105mm would have been useful to have at that time: 105mm long end, f/8 is useful as there was full sun, and the 28-105mm doesn't add much weight or bulk to the camera bag.

Ultimately that's what I see the 28-105mm as: a useful adjunct to an ultra-wide L lens for travel. The 70-200mm is simply too large and bulky to be convenient when traveling. Furthermore, on a 5D Classic, I believe the gap between the 28-105mm and the L zooms would be even less.

I believe there's one reason the 28-105mm f/3.5-4.5 is unpopular and cheap, in spite of its FTM focusing, ring USM, and focusing scale: the zoom range is not very useful on reduced-frame (APS-C) DSLR's.

Tuesday, February 07, 2017

Amazon Polly Just For Laughs

If you've ever had a burning desire to create custom dialog for Consuela the housekeeper in Family Guy..

#! /usr/bin/python
import boto3
import io
from subprocess import call

client = boto3.client('polly', region_name='us-east-1')

# aws polly describe-voices --region us-east-1|grep Name
response = client.synthesize_speech(
    Text='<speak><p>Hola. Doggie a puera!</p></speak>',

# Access the audio stream from the response
if 'AudioStream' in response:
    sb = response.get('AudioStream')
    data =
    fd ='hello.mp3', mode='wb', closefd=True)

    call(["afplay", "hello.mp3"])

Saturday, January 21, 2017

Canon 70-200mm f/2.8L versus Pentax 200mm f/4 Super-Multi-Coated Takumar

I have compared two Canon lenses, the 10-20mm f/3.5-4.5 consumer zoom (on APS-C) and the 16-35mm f/4 L IS here. The results were predictable - the L zoom was consistently better than the consumer zoom, at about three times the cost (and increased weight).

Also, I used to collect old, Pentax screw mount manual focus lenses. These old lenses have a cult following, with various miraculous attributes being ascribed to them (glorious bokeh, an otherworldly quality of the image, etc. etc.) While some of these old lenses (particularly the old Leica lenses) do deserve the praise, I had always wondered how these old lenses compared to modern, non-consumer grade ones.

So in this post, I compare the older, non-IS Canon 70-200mm f/2.8L zoom with a decades-old, manual focus, Pentax screw mount 200mm f/4 Super-Multi-Coated Takumar. The comparison was done at f/4 (since the Pentax manual focus prime cannot open up to f/2.8) on a Canon 6D, which should have plenty of resolution. The target image was a neighboring building at (close to) infinity focus.  The Canon zoom was auto-focused, while the Pentax was manually focused using Live View (it ended up at the infinity stop anyway). Base ISO was used and a fairly high shutter speed (1/2000 second) on a tripod.

First the full image:

The highlighted areas are zoomed in (1:1) for comparison. They roughly cover the center of the frame, and the edge. The extreme edge was not used, because it turns out the Canon 70-200mm zoom is not really 200mm at the long end (it is a bit short).

Let's look at the center of the frame, where both lenses should be performing their best. The zoom is one stop down, so should show improved performance.. but it's a zoom, while the competition is a (wide-open) prime:

Canon 70-200mm f/2.8L at 200mm f/4, center:
Pentax 200mm SMC Takumar at f/4, center:
We can see that the Pentax is ever so slightly longer than the Canon, it has less contrast, and is less sharp. We're talking a $40 lens (at KEH) versus a $1300 lens. I wondered if the Pentax was not critically focused, but it was at the infinity stop, and Live View could not yield a better focus. In any case, "in the field" one would not have the luxury of tripod and Live View and would probably just use the prime at the infinity stop.

The difference is certainly obvious at pixel-peeping distances, but on a regular full-size image the two lenses would be indistinguishable.

Canon 70-200mm f/2.8L at 200mm f/4, edge:
Pentax 200mm SMC Takumar at f/4, edge:
again we can see better contrast with the Canon (better coatings perhaps) and also more detail in the fine vertical lines of the blinds. What is noteworthy is that both lenses don't really suffer much (if any) drop in resolution, going from the center of the frame to the (near) edge.

Is the $1300 Canon a better lens? of course it is - sharper, more contrast, autofocus - but is it thirty times better? that depends on the user.  If autofocus and zoom are important, then these are worth paying money for.

The Canon is quite bulky in comparison to the relatively compact Pentax prime, however.
I was whale-watching in Monterey in October 2016, and did not bring any long lenses (the Canon 70-200mm is very hard to travel with). Ended up with a lot of distant images of whales (using the 35mm end of the 16-35mm f/4L IS). At that time, I would have gladly used the small Pentax prime, in spite of all its shortcomings and non-L image quality.

In conclusion: yes, the Canon 70-200mm f/2.8L is a better lens at the 200mm end than the 1960's - 1970's Pentax 200mm f/4 Super-Multi-Coated Takumar.  But the SMC Takumar is more than good enough and I would say can more than hold its own image quality wise (so long as you don't pixel-peep at 100% magnification).

Friday, December 30, 2016

Making a Dobsonian from an Ikea Bedside Table

The Ikea RAST bedside table is cheap, made of pine, and happens to be almost a perfect fit for a typical 8" Newtonian OTA.
The upper and lower shelves just about fit an 8" OTA, and if you remove the left vertical plank in the photo above, and screw it to the back of the two shelves, you have the beginnings of a Dobsonian base.

I used an 8" f/4 Newtonian (an AT8IN actually) with its tube rings, and bolted two halves of a 12" diameter chopping board to the tube rings to serve as altitude bearings.  I had to use a number of fender washers to get the spacing right, but the diameter of the AT8IN is almost perfect for the Ikea table (about three washers were required to get the right spacing).

A significant advantage of this scheme is that by removing the trunnion bearings (which are held on with two M6 hex-head bolts on each side) and attaching a dovetail, the scope can be used for imaging.

Also, the scope has an extended-length aluminum tube of 2mm thickness, which is incredibly rigid (the original AstroTech tube was 0.8mm thick steel) while weighing the same as the original tube. In addition, because the tube is extended, focus can be achieved with a Paracorr without racking out the focuser, which improves the rigidity of the imaging train significantly.

Here's another view of the 12" diameter chopping board. I used the same type of chopping board as the azimuth base (and printed setting circles as well). It was necessary to cut V-shaped channels in the side of the Ikea bedside table to support the trunnion bearings.

The bearing surface is a rough glass fiber (FRP) strip that I purchased from and the bearings are virgin teflon blocks. The azimuth bearing surface is also an FRP strip from AstroGoods (I did not go for the vinyl LP record trick here).

I have used this setup to track Mars at 320X during the last opposition and while it's a tricky affair, it's actually usable. While the AstroTech 8" f/4 has a huge secondary, for Mars it was quite acceptable due to the small exit pupil.

I replaced the secondary collimation bolts with stainless steel M4 hardware:

There is a CatsEye hotspot on the primary mirror:

And all steel fasteners have been replaced with hex-head stainless steel hardware. Also note the seam in the faux carbon fiber covering: the aluminum tube underneath is unpainted, and I wrapped the tube in vinyl carbon fiber lookalike (used for wrapping cars).

The primary collimation locking bolts have been relocated next to the collimation knobs, and the primary support springs have been replaced with much stronger ones. This allows the Newtonian to hold collimation very well when used for imaging:

In addition, the telescope has a 2" Feathertouch focuser which is incredibly smooth and a joy to use.

I don't like to think about how much I've spent on this project in total. It is certainly several multiples of the price of a stock 8" dobsonian. However, this scope is better than a stock 8" dobsonian or a stock 8" imaging Newtonian in all possible ways.

Parsing VPC Flow Logs with Pandas

Here's a trivial code snippet to parse AWS VPC Flow Logs. This is extremely useful when setting up permissive security groups and then tightening them up later.

This script will (probably) fail if there are too many VPC flow log files (and therefore the Python interpreter would run out of memory). However it's nice to see that Pandas read_csv can read S3 URL's directly (even gzip'ped CSV files).

You can also filter for REJECT  rule and find out all the IP's that have been attempting to attack you.

from boto.s3.connection import S3Connection
import pandas as pd
import os

srcbucket = 'flowlogs-bucket-orly'
aws_access_key = 'AKIAxxx'
aws_secret_key = 'oRCIxxx'

os.environ['AWS_ACCESS_KEY_ID'] = aws_access_key
os.environ['AWS_SECRET_ACCESS_KEY'] = aws_secret_key

cols = [ 'timestamp', 'version', 'accountid', 'interfaceid', 'srcaddr', 'dstaddr', 'srcport', 'dstport', 'protocol', 'packets', 'bytes', 'start', 'end', 'action', 'logstatus']

# iterate over all the VPC flowlogs in the bucket
conn = S3Connection(aws_access_key, aws_secret_key)
bucket = conn.get_bucket(srcbucket)

count = 0
for key in bucket.list():
    keystr ='utf-8')
    if 'eni-' in keystr:
        s3url = 's3://' + srcbucket + '/' + keystr
        count = count + 1
        if (count == 1):
            df = pd.read_csv(s3url, delim_whitespace=True, header=None, names=cols, low_memory=True)
            df = df [ df['action'] == 'ACCEPT']
            df2 = pd.read_csv(s3url, delim_whitespace=True, header=None, names=cols, low_memory=True)
            df2 = df2 [ df2['action'] == 'ACCEPT']
            df = df.append(df2, ignore_index=True)
        print 'Processed ' + keystr

src = df.groupby(['srcaddr', 'dstaddr', 'dstport']).size().reset_index()
src.columns = [ 'srcaddr', 'dstaddr', 'dstport', 'count' ]

n = src.sort_values(by = ['count', 'srcaddr', 'dstaddr'], ascending=False)