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

Home » Public Forums » archive » Wrapping image on polar projection
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Wrapping image on polar projection [message #87786 is a reply to message #87767] Thu, 27 February 2014 05:26 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Vinay writes:

>
> Hi folks,
>
>
> Was anyone out there successful in wrapping images on polar projection using 'cg' routines. Most of the other examples essentially uses cgCoutour. OK here is where, I got stuck.
>
> My data is similar to the example given in
> http://www.idlcoyote.com/map_tips/warptomap.php
>
>
> ------My code---------------------------
> Filein = 'test1.sav'
> RESTORE, Filein
> Help, image, lats, lons
>
> S = Size(image)
> lat = Rebin(lats, s(1), s(2))
> lon = Rebin(lons, s(1), s(2))
> image1 = Bytscl(image,min = 0.0, max = 0.15,/NaN )
>
> cgDisplay, Title='Polar Projection'
>
> map = Obj_New('cgMap', 'Polar Stereographic', LIMIT=[60, -180, 90, 180], Center_Lat=90, Center_Lon=180, POSITION=[0.05, 0.05, 0.95, 0.95])
>
> warped = cgWarpToMap(Image1, lon, lat, MAP=map, MISSING=0, Resolution=[400, 300], /SetRange)
> cgImage, warped, Position=[0.1, 0.1, 0.9, 0.9]
> cgMap_Grid, Map=map, /Label, Color='Blue'
> cgMap_Continents, MAP=map, Color='Blue'
> cgMap_Continents, MAP=map, Color='Blue', /Countries
> ------------------------------------
>
> It will be great, if anyone has any suggestions!!

The reason you are not seeing *anything* in your window is that you have
resized the latitude array incorrectly. You have this:

lat = Rebin(lats, s(1), s(2))

And it should be this:

lat = Rebin(Reform(lats, 1, s(2)), s(1), s(2))

But, your other problem is that cgWarpToMap just doesn't deal well with
this kind of very low resolution data near the pole (always
problematic). Either of the two methods I outline in this article
"work", but I think the data itself limits our ability to get good
results.

http://www.idlcoyote.com/code_tips/usegriddata.html

I've sent you a program with the code I wrote to test this.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Congratulations Fabien!
Next Topic: Help needed for a CASE statement, something subtle going on ...

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

Current Time: Sat Oct 11 09:28:24 PDT 2025

Total time taken to generate the page: 1.68093 seconds