Friday, February 19, 2010

The focal lengths I use

A long time ago I wrote a small script that spits out a histogram of all the focal lengths you use. This is done by querying spotlight on Mac OS X. The script is as follows:

#!/usr/bin/perl

$start=shift;
$end=shift;
$delta=shift;
$flength=$start;
$onlyin=shift;
$filetype=shift;

print "Generating histogram of focal lengths starting at $start, ending at $end, and with stepsize $delta in the directory $onlyin\n";

while ($flength<$end)
{
print "$flength\t";
$endbin=$flength+$delta;
$commandstring="mdfind -onlyin $onlyin \"(kMDItemFocalLength>=$flength) && (kMDItemFocalLength < $endbin) && (kMDItemDisplayName = '*.$filetype*'cd) \" | wc -l";
system($commandstring);
$flength+=$delta;

}


#mdfind "kMDItemFocalLength>=10 && kMDItemFocalLength < 15) " | wc -l



Copy and paste this in a textfile (I named it flengthscript.pl) and save it in your home directory. Now open a terminal and type
perl flengthhistoscript.pl 0 300 5 "Your directory location here" NEF

Replace the location with the location where you store your images and replace NEF by whatever filetype you use or leave it blank to analyse all filetypes.

The script spits out a simple tab delimited list of focal lengths followed by the number of images it found in the range of the focal-length number+the delta that you chose. You can simply graph this in any graphing program such as Igor Pro, gnuplot, Numbers, IDL, Excel, etc.

Here is the output on about 20k RAW files that are currently on my harddisk. You can see I favor 18, 35, and 50 mm and also the top of my tele range which is 200 mm. This indicates I might like some longer lenses as well as wider lenses to add to my repertoire.

No comments:

Post a Comment