07.03.2009 09:54

iPhone 3GS - first images

Last night, I picked up an iPhone 3GS! Pretty exciting. I gave the camera a try this morning and it did okay with the gray weather that we are having in NH. The image sync with iPhoto is super fast - my old digital camera takes a minute or two as apposed to about 2 seconds for the iPhone. Here is a small piece of the image:



I shrank the image down so you can see the whole thing:



It's worth a second to take a look at the EXIF headers:

% fink install jhead
% jhead IMG_0006.JPG
File name    : /Users/schwehr/Desktop/IMG_0006.JPG
File size    : 1265684 bytes
File date    : 2009:07:03 09:36:45
Camera make  : Apple
Camera model : iPhone
Date/Time    : 2009:07:03 07:10:49
Resolution   : 2048 x 1536
Focal length :  3.8mm
Exposure time: 0.017 s  (1/60)
Aperture     : f/2.8
ISO equiv.   : 78
GPS Latitude : N 43d [snip]
GPS Longitude: W 70d [snip]
Comment      : {
Comment      :     AEAverage = 193;
Comment      :     AELimitsReached = 0;
Comment      :     AEStable = 1;
Comment      :     AFStable = 1;
Comment      :     AFStatus = 4;
Comment      :     AGC = 287;
Comment      :     AWBBGain = 194;
Comment      :     AWBGGain = 64;
Comment      :     AWBRGain = 137;
Comment      :     AWBStable = 1;
Comment      :     
If you say yes, the camera geocodes the images quite nicely. The camera model isn't very specific.

Posted by Kurt | Permalink

07.03.2009 09:30

Firefox geolocation confusion - now working

The "Give it a try!" link on the firefox geolocation page works, but following their code is difficult.



This demo (http://people.mozilla.com/~dolske/tmp/geoloc.html) has easy to follow code, but doesn't work.



Where can I find a simple example that works? Introducing Geode says that I can do:
navigator.geolocation.getCurrentPosition(function(pos) {
  alert( pos.latitude + ", " + pos.longitude );
})
But that doesn't seem to do it. I get the share location request beneath the navigation bar, but then I get null back for the position... a little digging, and I found that the return structure has changed since the initial design. Here is a super simple working example. Instead of pos.longitude, it uses pos.coords.longitude.

geolocation-alert.html

<html dir="ltr" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head>
<script type="text/javascript">
navigator.geolocation.getCurrentPosition(function(pos) {
  alert( pos.coords.latitude + ", " + pos.coords.longitude );
})
</script>
Firefox could use an update to their page to point to this working demo: geoloc-new.html

Posted by Kurt | Permalink

07.03.2009 08:22

FireFox 3.5 location aware

Note: If you have Firefox 3.5, this is built in to the browser by default: Firefox Geolocation. Try this URL, which doesn't work for me: Local food - http://azarask.in/local/. Now the real question is: How do I tell these services where wifi access points are located if it doesn't already know? I'd like to add access points that I am frequently around that aren't in the Google Location Services.

Google and Mozilla Team Up to Tell Firefox Where You Are [webmonkey]
Google and Mozilla have partnered to geo-enable the next wave of web
applications in Firefox, the companies announced Thursday. The latest
version of Firefox - 3.5 ... will use Google's Location Service as its
default location provider. ...

Once the user provides a web app with permission to do so (the
geolocation abilities are opt-in, as they should be) the application
can use the browser to determine the user's location. This means
developers can provide more accurate local search results and other
geo-aware functionality ...

...Mozilla launched the Geode project, a location
awareness add-on for Firefox, Yahoo brought us Fire Eagle and the
Geocoder API, Google gave us Latitude and Microsoft is developing
Vine. ...
And Inferring context from the environment [Magic Ink]
Geographical location. Similarly, the most interesting spatial
landmark is usually "here." Unfortunately, this currently can be
harder to determine automatically, but the payoff is enormous.* Obviously, a
software roadmap needs to know the user's location, but so does the
bus schedule, as well as business listings, transportation planners,
travel guides, and much other information software.

* I believe that location is such vital context, Powerbooks should
come with GPS receivers pre-installed, with an easy software
API. Developers would then write software to take advantage of it, and
other computer makers would follow suit. Someday, a computer without
GPS might seem as silly as a computer without a clock.
Just a reminder, GPS is first and formost a clock. No time, no GPS position. One day soon, I hope to install the latest version of linux or Mac OSX and discover that it is preconfigured to be a stratum 1 NTP timeserver (and PTP) using the built in GPS chip with a fallback to the a mobile phone service (e.g. CDMA) time source. As a reminder, this is how you check how ntp is doing:
% ntpq -p -n
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-132.177.137.2   209.123.234.24   3 u  414 1024  377    4.680    4.171   0.221
-72.18.205.156   128.138.140.44   2 u  348 1024  377   79.530   -6.882   0.450
+69.10.36.5      64.90.182.55     2 u  479 1024  377   36.526   -3.959   0.540
-38.117.195.101  209.51.161.238   2 u  471 1024  377   12.920    7.163   0.164
*207.171.30.106  .PPS.            1 u  514 1024  377   79.463    3.569   2.720
+72.18.205.157   128.138.140.44   2 u 1611  68m  377   79.433   -6.352   1.356
 66.70.29.130    66.250.45.2      3 u  46h  68m    0   18.614   -3.436   0.000
-65.255.217.202  69.36.241.112    3 u 1654  68m  377   79.327   10.225   3.076
 127.127.1.0     .LOCL.          13 l   62   64  377    0.000    0.000   0.001

Posted by Kurt | Permalink

07.03.2009 08:17

Reson multibeam movies

Reson has put some of movies from their systems up on YouTube:




Posted by Kurt | Permalink

07.03.2009 08:09

MATE ROV Competition

NOAA DYI ROV (aka mini-submarine in a bucket) [sea-fever]. Thanks to Art, I have the guide book for this sitting on my shelf.


Posted by Kurt | Permalink

06.28.2009 09:16

Louisville Locks

The USCG and ACOE have a project in Louisville at the McAlpine Locks. I believe there is an Acoustic Doppler Currant Profiler - ADCP at the split coming into the locks.

Here is a vessel approaching the area coming through the several leading bridges:



A vessel that has made the approach and is entering the channel to the lock:





The ACOE has a airphoto of the lock in their McAlphone Locks and Dam fact sheet


Posted by Kurt | Permalink

06.28.2009 08:52

Louisville








Posted by Kurt | Permalink

06.27.2009 09:09

How and why do you configure your AIS?

The initial comments that I got an LiveJournal are great. To step up the conversation some more, I started a thread over on gCaptain. If you want more, on this, take a look at the paper by Brian Calder and myself: Traffic Analysis for the Calibration of Risk Assessment Methods, US Hydro 2009

cCaptain thread: How do you configure your AIS and why?:

I'm a researcher at the Center for Coastal and Ocean Mapping/NOAA Joint Hydrographic Center in New Hampshire (research blog: http://schwehr.org/blog). I've been working with AIS for a couple of years now... ways to get information to mariners and ways to understand how mariners move about. After looking at the settings people put into their devices and configuring a bunch of units myself, I've seen that there are a lot of different styles for what is done. It would be a huge help to know what your strategy is for setting the vessel type, draught, length, width, name, call sign, ship and cargo type, ETA, and destination fields. Many vessels set it once and leave it, while others change one or more of these all the time. I've looked at a few books that are used for teaching and haven't seen any guidance on best practices and the AIS standards documents don't say much. Are you or someone above you setting some quidelines for what you do?

I got some great initial discussion:

http://goatbar.livejournal.com/2139.html

A few of the things I see:
  • Parameters set at AIS install time
  • Parameters (sometimes partialy) changed when the vessel is sold
  • There are ships that change when the pilot gets on board and then go right back after the pilot leaves
  • Ships that look like they change with the watch stander changes
  • Changes when a vessel enters of leaves port
  • When there are power glitches (e.g. Nauticast devices that reset to factory defaults)
  • Tugs that become Tows and some that change their length to match what they are towing.
  • Tows that never change length or status even when not towing
  • Vessels where the length randomly changes (turned out to be a lighting strike on the ship)
  • etc...
Understanding why you do what you do with your AIS device would be hugely helpful for those trying to use AIS to help understand what we see. We are looking at AIS to try to help direct where (in the US - NOAA) hydrographic offices will focus surveys and how to manage waterways better.

Here is an example of an interesting draught history for a vessel, while others are static (frequently with a draught of 0):

[picture of vessel draught that I posted a few days ago]

It would be great if we could start working towards best practices for the community!

Posted by Kurt | Permalink

06.26.2009 14:17

New antenna location at nhjel

Andy M. just got a chance to move the AIS J-Pole antenna at Jackson Estuarine Lab (JEL) from inside to top floor room to outside. The improvement in reception is impressive. The old site was too close to computers, cables, and other radio gear. Hopefully I'll get a chance soon to plot the difference in reception. The tough part about AIS is that most of the things that you are hearing (at least in NH) are moving.


Posted by Kurt | Permalink

06.26.2009 14:06

Phil Zimbardo TED talk

Seeing this guy speak in person is quite the experience!



and 2008:


Posted by Kurt | Permalink

06.26.2009 12:32

Sansa Clip music player

I am now the prowd owner of a Sansa Clip mp3 player. This is the first digital music device that I've owned that isn't an iPod. We looked at the new shuffle and couldn't figure out what Apple was thinking. The Sansa Clip just works. It shows up on my mac as a drive, I add files to the music, podcast, and audiobook folders. Then I eject the drive, it takes about 10 seconds to scan the changes. Then I just use it. It's small, light, and I don't notice it on my while working out. It's so unlike the iPod, which Apple has decided to lock down. I haven't yet tried the FM receiver or the recording capability. here is what I see when loading music:



In case you are interested, the SYS files are binary, but version.sdk is just a text file:
#DO NOT EDIT OR REMOVE THIS FILE

Product: Clip
FW: V02.01.32A
Region: Americas

Posted by Kurt | Permalink

06.26.2009 05:52

UNH iTunesU

I just recently found out that UNH has an iTunesU. There isn't a huge amount of Marine content, but I found a clip about a local commerical Open Ocean Aquaculture (OOA) project.


Posted by Kurt | Permalink

06.26.2009 00:24

udcshel youtube channel

youtube udcshel:
Videos related to the efforts of faculty, staff, students, and
associates of the Coastal Sediments, Hydrodynamics, and Engineering
Lab (CSHEL). For more info check out our website
geology.udel.edu/cshel/




And...

UBC-Gavia: The (Un)Common Loon in the Lake [pavilionlake.com]
...
This year we are particularly excited to have Dr. Art Trembanis
joining the project who will be bringing some very high-tech toys with
him from the University of Delaware. Dr. Trembanis may have an
uncommon name (apparently he is one of only 6 Trembanis' in the world
- the other 5 being his immediate family) but he's certainly no
loon. Art is the happy owner of another Gavia AUV that is equipped
with an inertial navigation system (INS), the navigation instrument
found on commercial airliners. ...

Posted by Kurt | Permalink

06.25.2009 09:16

Geologic Symbols for Google Earth

Peter Selkin has been posting some great stuff on his blog - Oblate Spheroid. Check these out:

Check out the Geologic Map Symbol KML Generator [SDSU]



And this video of Fred Vine explaining magnetic reversals recorded in the sea floor:


Posted by Kurt | Permalink

06.25.2009 09:02

Detecting landmarks in images

A new landmark in computer vision [Google Blog]
...At Google, we think computer vision has tremendous potential
benefits for consumers, which is why we're dedicated to research in
this area. And today, a Google team is presenting a paper on landmark
recognition (think: Statue of Liberty, Eiffel Tower) at the Computer
Vision and Pattern Recognition (CVPR) conference in Miami, Florida. In
the paper, we present a new technology that enables computers to
quickly and efficiently identify images of more than 50,000 landmarks
from all over the world with 80% accuracy.
...
A link to the paper is at the bottom of the blog post.

Posted by Kurt | Permalink

06.24.2009 21:12

geojson python __geo_interface__

I've been looking at JSON and GeoJSON today trying to fit it into my project in a way that makes sense. I'd like to provide something that isn't confusing and doesn't require the user of the interface to know or do anything special. How do I do this with the python 2.6 json (that looks a lot like simplejson)? I tried GeoJSON and it's got something exactly like that: the "Python Geo Interface". I add one method to my class and it's set. My original code:
% ipython2.6
import imo_001_22_area_notice as a
import geojson
pt = a.AreaNoticeCirclePt(-69, 42, radius=9260)
geojson.dumps(pt)
This is not happy when I run it.
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (9, 0))
ValueError                                Traceback (most recent call last)

/Users/schwehr/projects/src/ais-areanotice-py/<ipython console> in <module>()

/sw/lib/python2.6/site-packages/geojson/codec.pyc in dumps(obj, cls, **kwargs)
     36 
     37 def dumps(obj, cls=GeoJSONEncoder, **kwargs):
===> 38     return simplejson.dumps(to_mapping(obj), cls=cls, **kwargs)
     39 
     40 

/sw/lib/python2.6/site-packages/geojson/mapping.pyc in to_mapping(ob)
     16         msg = "Expecting something that has %r or a mapping, got %r"
     17         msg %= (GEO_INTERFACE_MARKER, ob)
===> 18         raise ValueError(msg)
     19     return Mapping(candidate)
     20 
I just had to add the Geo Interface to my class:
    @property
    def __geo_interface__(self):
        return {'area_shape':0, 
                'type':'Point', 'coordinates': (self.lon, self.lat), 
                'radius':self.radius, 'scale_factor':self.scale_factor}
Now with it working:
Out[50]: '{"scale_factor": 10, "type": "Point", "radius": 9260, "coordinates": [-69, 42], "area_shape": 0}'
Now how can I do that something like that with Python 2.6's json module?

Trackback: Thanks to Sean for answering in his blog! Geo interface and Python 2.6

Posted by Kurt | Permalink

06.24.2009 20:21

iPhone for field geologists (or other field scientists)

Back when I was in field camp in 1993 and everytime I've been in the field since, I have pondered the posibilities of what could be done with portable computing power to make the field scientist more effective. Panasonic ToughBooks are heavy and so are laser ranfinding glasses. I remember seeing the combination back in 1994 or 95 and thinking that these technologies were almost there. It's now 15 years later and we are "almost there" with the iPhone accept that it's not rugged. There are great cameras with built in GPS cameras, compasses and soon the new laser range finders won't have to sit on a mount with the camera. It's great to see the rest of the community thinking about this too. I think my professors in the early 90's assumed I was crazy trying to mix so much computer science into my geology, but it has done well for me. This post was triggered by seeing Chris Rowan's post: Could an iPhone be a useful field tool? [Highly Allochthonous], which links to The iPhone: A Field Tool for Geologists? [Bob Jamieson]. I think we need to start writing a bunch of very custom applications focused on our specific tasks to really make a big impact beyond basic note taking, pictures, and GPS/maps. High on my list is to create a little core collection worksheet with proper metadata export for when we collect cores at sea... next we need a waterproof iPhone that floats when you drop it over the side of the ship!

The list goes on and on... I have thoughts of realtime stereonet plots that build on the fly and help you to make sure you have enough data before you head back from the field. etc... etc...

Now back to trying to make my latest project do a proper JSON serialization of the Python classes that fits with ESR's proposal for AIS JSON.

Trackback: iPhone as a tool for hydrographers [The Moni Blog]

Posted by Kurt | Permalink

06.24.2009 12:40

Python inheritance

I'm building some python code where the parent needs some information from the child classes to serialize an AIS Binary Message. I gave it a try and somehow thought that python couldn't do this. I resorted to setting an attribute in the child, which is ugly. I posted to the python mailing list and quickly got an answer!

Thanks to Jean-Michel for setting me straight on this. I must have done something dumb in my trying to do this. He wrote a great example.
#!/usr/bin/env python

class Parent:
   def foo(self):
      raise NotImplementedError() # virtual method, it has to be overriden by childs

   def bar(self):
      self.foo()

class Son(Parent):
   def foo(self):
      print "I'm your son"

class Daughter(Parent):
   def foo(self):
      print "I'm your daughter"

Son().bar()
"I'm your son" 

d = Daughter()
d.bar()
Running it:
% ./foo.py
I'm your son
I'm your daughter
I definitely like the concept of adding the NotImplmentedError to give the same concept as a pure virtual in C++.

As yes, it does work as I originally thought it should!

Posted by Kurt | Permalink

06.24.2009 12:13

WKT Raster

Check out a Google Summer of Code (GSoC) project to add WKT Raster support to gdal: GSoC 09 Weekly Report #4: 12/06 - 19/06 [GIS4Free]

To go with this, check out: PostGIS WKT Raster

Posted by Kurt | Permalink

06.23.2009 16:31

Whales and ship noise

What It Sounds Like to Be a Whale
...
In the last decade, scientists have realized that noise generated by
ships often drowns the natural sounds of the sea. Some types of sonar,
especially those used by military vessels, can be heard for hundreds
of miles. Together with engine noise, these produce an aquatic roar
heard across Earth's oceans, often at levels that humans associate
with airports and rock concerts.
...
Just remember that dB levels in water do not have the same reference level than that used in air and are not directly comparable.

Posted by Kurt | Permalink