comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: weird contour lines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: weird contour lines [message #68470] Mon, 02 November 2009 08:07
Brian McNoldy is currently offline  Brian McNoldy
Messages: 35
Registered: July 2000
Member
>> Libo Wang writes:
>>> Thanks, David. I've read helpful tips in your website. It is actually
>>> a bit of both aesthetic problem and a science problem! A meteorologist
>>> would probably tell me that my map is not what a standard pressure
>>> field plot should look like!
>
>>> I tried to expand my data from 144*37 to 1440*370 using cubic=-0.5 in
>>> Congrid,the contour map did improved in some parts, but some parts got
>>> worse:
>
>>> http://picasaweb.google.com/lh/photo/pbT1Ftfbx0nqS9O3uw0tGg? feat=dire...
>
>>> The NCEP data is low in resolution: 2.5 degree spacing. What else
>>> could I try?
>

The reason the results look so choppy is because the NCEP data are at
2.5-degree resolution and are near the pole; that results in a rather
irregularly spaced grid (still a regular lat/lon grid, but the
longitudes converge to a singularity). Anyway, have you tried using
SMOOTH on the data like David suggested a couple days ago? This might
be too simple, but could actually do the job. Try a variety of
widths: 3, 5, 7. Secondly, over what time period are the surface
pressure data averaged? Is it a daily field, monthly? Daily fields
at 2.5 degrees are generally quite choppy by nature due to poor input
data in very high latitudes. Here's a link to a plot I generated on
ESRL's website of January 2009 surface pressure:
http://einstein.atmos.colostate.edu/~mcnoldy/tmp/slp_jan2009 .png

Brian

*===========================================*
Brian McNoldy, Research Associate III
Dept. of Atmospheric Science
Colorado State University
Fort Collins, CO 80523
970.491.8558
http://einstein.atmos.colostate.edu/~mcnoldy/
*===========================================*
Re: weird contour lines [message #68478 is a reply to message #68470] Sat, 31 October 2009 20:08 Go to previous message
Libo Wang is currently offline  Libo Wang
Messages: 6
Registered: October 2009
Junior Member
On Oct 31, 1:16 pm, David Fanning <n...@dfanning.com> wrote:
> Libo Wang writes:
>> Thanks, David. I've read helpful tips in your website. It is actually
>> a bit of both aesthetic problem and a science problem! A meteorologist
>> would probably tell me that my map is not what a standard pressure
>> field plot should look like!
>
>> I tried to expand my data from 144*37 to 1440*370 using cubic=-0.5 in
>> Congrid,the contour map did improved in some parts, but some parts got
>> worse:
>
>> http://picasaweb.google.com/lh/photo/pbT1Ftfbx0nqS9O3uw0tGg? feat=dire...
>
>> The NCEP data is low in resolution: 2.5 degree spacing. What else
>> could I try?
>
> Well, this is a pain-in-the-kiester solution, but what you
> *could* do is obtain each closed contour from the CONTOUR
> command (PATH_XY keyword, etc.) and "resample" it with the
> ArcSample program from my web page:
>
>   http://www.dfanning.com/programs/arcsample.pro
>
> The purpose of ArcSample is to re-sample the contour
> at approximately equally spaced intervals, and then to
> use those points to interpolate the contour. This has
> the effect of smoothing the contour. I use this, for
> example, when I am getting the starting points for
> an active contour or snake algorithm.
>
> I wouldn't go to this kind of trouble unless your
> meteorologist friend is EXTREMELY anal.
>
> Cheers,
>
> David
>
> P.S. I assume you tried using the MIN_CURVE_SURF program
> on your data and gave up because you don't have that many
> hours in the day.
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks, David. I'll probably try the arcsample approach some day (I'm
pretty sure I'll make more contours in IDL!). For this "simple" task,
I'll see if I could do it in other softwares :(

I did try the MIN_CURVE_SURF fuction, but killed the run after 5
minutes.
Re: weird contour lines [message #68481 is a reply to message #68478] Sat, 31 October 2009 10:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Libo Wang writes:

> Thanks, David. I've read helpful tips in your website. It is actually
> a bit of both aesthetic problem and a science problem! A meteorologist
> would probably tell me that my map is not what a standard pressure
> field plot should look like!
>
> I tried to expand my data from 144*37 to 1440*370 using cubic=-0.5 in
> Congrid,the contour map did improved in some parts, but some parts got
> worse:
>
> http://picasaweb.google.com/lh/photo/pbT1Ftfbx0nqS9O3uw0tGg? feat=directlink
>
> The NCEP data is low in resolution: 2.5 degree spacing. What else
> could I try?

Well, this is a pain-in-the-kiester solution, but what you
*could* do is obtain each closed contour from the CONTOUR
command (PATH_XY keyword, etc.) and "resample" it with the
ArcSample program from my web page:

http://www.dfanning.com/programs/arcsample.pro

The purpose of ArcSample is to re-sample the contour
at approximately equally spaced intervals, and then to
use those points to interpolate the contour. This has
the effect of smoothing the contour. I use this, for
example, when I am getting the starting points for
an active contour or snake algorithm.

I wouldn't go to this kind of trouble unless your
meteorologist friend is EXTREMELY anal.

Cheers,

David

P.S. I assume you tried using the MIN_CURVE_SURF program
on your data and gave up because you don't have that many
hours in the day.



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: weird contour lines [message #68482 is a reply to message #68481] Sat, 31 October 2009 10:00 Go to previous message
Libo Wang is currently offline  Libo Wang
Messages: 6
Registered: October 2009
Junior Member
On Oct 31, 12:09 pm, David Fanning <n...@dfanning.com> wrote:
> Libo Wang writes:
>> Hi, I used the following code to set up a stereographic projection map
>> and overplot NCEP pressure field on it:
>
>> MAP_SET,/stereographic, 60, -105,color=grey,limit=[30,-180,80.0,-10],/
>> continents,/isotropic
>> levels = 16
>> step=4
>> userLevels = IndGen(levels) * step + 120
>> Contour, data,lon,lat,C_Colors=black,Levels=userLevels, /overplot
>> Contour, data,lon,lat,/Overplot,
>> Levels=userLevels,c_colors=black,c_charthick=2,$
>> max_value=200,min_value=120,/Follow
>
>> However, I got weird contour lines, which you could take a look at the
>> following link:
>> http://picasaweb.google.com/libowa/DropBox?feat=directlink
>
>> Could you point out what was wrong in my codes? How could I get smooth
>> contour lines?
>
> Is this an aesthetic problem or a science problem?
>
> If it is an aesthetic problem, that NCEP data is fairly low-resolution.
> You could try CONGRIDing it to a larger size, using interpolation,
> before contouring it. Or, you could just try smoothing your data
> before you contour it.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")- Hide quoted text -
>
> - Show quoted text -

Thanks, David. I've read helpful tips in your website. It is actually
a bit of both aesthetic problem and a science problem! A meteorologist
would probably tell me that my map is not what a standard pressure
field plot should look like!

I tried to expand my data from 144*37 to 1440*370 using cubic=-0.5 in
Congrid,the contour map did improved in some parts, but some parts got
worse:

http://picasaweb.google.com/lh/photo/pbT1Ftfbx0nqS9O3uw0tGg? feat=directlink

The NCEP data is low in resolution: 2.5 degree spacing. What else
could I try?
Re: weird contour lines [message #68483 is a reply to message #68482] Sat, 31 October 2009 09:09 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Libo Wang writes:

> Hi, I used the following code to set up a stereographic projection map
> and overplot NCEP pressure field on it:
>
> MAP_SET,/stereographic, 60, -105,color=grey,limit=[30,-180,80.0,-10],/
> continents,/isotropic
> levels = 16
> step=4
> userLevels = IndGen(levels) * step + 120
> Contour, data,lon,lat,C_Colors=black,Levels=userLevels, /overplot
> Contour, data,lon,lat,/Overplot,
> Levels=userLevels,c_colors=black,c_charthick=2,$
> max_value=200,min_value=120,/Follow
>
> However, I got weird contour lines, which you could take a look at the
> following link:
> http://picasaweb.google.com/libowa/DropBox?feat=directlink
>
> Could you point out what was wrong in my codes? How could I get smooth
> contour lines?

Is this an aesthetic problem or a science problem?

If it is an aesthetic problem, that NCEP data is fairly low-resolution.
You could try CONGRIDing it to a larger size, using interpolation,
before contouring it. Or, you could just try smoothing your data
before you contour it.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Fun with Int_tabulated.pro
Next Topic: Re: Set Intersection Code

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:35:44 PDT 2025

Total time taken to generate the page: 0.00705 seconds