Help on Gaussian smoothing in polar coordinates…?

November 16, 2009

Does anyone know how to make an efficient Gaussian smoother in polar coordinates?  I have to recalculate the range (and thus the Gaussian curve) for every point in my domain…which turns out to be 300*360.  Lots of points, and lots of computational time.  Even truncating the 2-D curve @ 6 km…I end up with ~8700 points which need the Gaussian curve calculated for every point I’m iterating through.  Anyone?

Advertisement

4 Responses to “Help on Gaussian smoothing in polar coordinates…?”

  1. Nick Gasperoni Says:

    How long are we talking here? Would it be a considerable improvement to smooth to 2*sigma, or 4km, rather than 6 km? The error (or amount of Gaussian curve uncaptured) would be 5% rather than 0.2%, which is significant…but if it significantly reduces computational time, maybe its worth trying? Just spitballin’ here.

    How does Boonleng apply a smoother when he processes the refractivity data? Maybe he has a suggestion as to similarly smoothing RI/QI?

  2. Dan Michaud Says:

    I’ve actually figured it out…it involves a little messing with the data but it works. I essentially make a look-up table for the Gaussian curve as a function of range from the pixel (x0,y0), and then when I calculate range for each pixel from (x0,y0) I round the range to the nearest 0.01 km and look up that value in the Gaussian curve array…and that becomes my weight. It’s MUCH faster this way, and I’m even using the entire 300*360 array of range and other variables to compute the weights and smoothed variables.

    Now I’m going to start limiting the weights and smoothing calculations to a range of 6 km as before…this should go quickly now.

    Boonleng smoothes the phase and N each once using a circular convolution of some kind (I believe it’s a Gaussian window). I think one reason that his calculator might be so much faster is that it’s written in C…the computations fly when it’s written that way. I wish I knew (or had the time to learn) C…

  3. Nick Gasperoni Says:

    Ah, that’s a good fix. Good thinking! I don’t think you introduce much error by doing that, at least hopefully not…

  4. Dan Michaud Says:

    Hey Nick,

    I figured out a fast and easy way of doing this whole thing, and I can actually add as many decimal places when I round the Gaussian look-up table…I have it set to the closest 0.01 km, but I could just as easily set it to 0.001 km. At these resolutions the error should be very minimal and should cancel out since some points are rounded up slightly while others are rounded down slightly. Even at close ranges the difference between, say, Gaussian(0.05km) vs. Gaussian(0.06km) is very minimal, especially since the variance of the curve is 4 km^2…much larger than our 0.01 km resolution.

    I’ll actually be posting how this all worked later this morning…it’s something I want to remember and it might help someone else down the road as well.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.