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

Home » Public Forums » archive » Overlaying data on a MODIS reprojected image created with the TrueColor package
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: Overlaying data on a MODIS reprojected image created with the TrueColor package [message #92376 is a reply to message #92374] Fri, 04 December 2015 05:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Steve writes:

> I have created a reprojected MODIS true color image using the
TrueColor package (ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/)
>
> I now want to read this image into IDL and overlay some data on top of the image e.g. an aircraft flight track. I am however having trouble getting the map projection correct.
>
> Note that the gpd file used in the TrueColor packaged to create the original image continas the following
>
> Map Projection: Azimuthal Equal-Area
> Map Reference Latitude: 62.500
> Map Reference Longitude: -10.000
> Grid Map Units per Cell: 0.250
> Grid Width: 4400.0
> Grid Map Origin Column: 2199.5
> Grid Height: 3400.0
> Grid Map Origin Row: 1699.5
>
> I have tried the following code which attempts to use the method from David Fanning's page http://www.idlcoyote.com/ng_tips/mapnogrid.php
>
> ;read in original image
> img = READ_TIFF('true.tif')
> img = REVERSE(img,3)
>
> s=SIZE(img,/DIMENSIONS) ;3x4400x3400
>
> projection='Lambert Azimuthal'
> latcen = 62.50
> loncen = -10.0
> res = 0.25
>
> map = Obj_New('cgMap', projection, /OnImage)
> uv = map -> Forward(Loncen, Latcen)
> uv_xcenter = uv[0,0]
> uv_ycenter = uv[1,0]
> xrange = [uv_xcenter - ((s[1]/2.)*res*1000.), uv_xcenter + ((s[1]/2.)*res*1000.)]
> yrange = [uv_ycenter - ((s[2]/2.)*res*1000.), uv_ycenter + ((s[2]/2.)*res*1000.)]
> map -> SetProperty, XRANGE=xrange, YRANGE=yrange
> cgDisplay, s[1]/4., s[2]/4.
> cgImage, img, Margin=0.1
> map -> Draw
> cgMap_Grid, MAP=map, /BOX_AXES, /cgGRID
> cgMap_Continents, MAP=map, /continents, /hires
>
> The above code displays the original image on a map which looks about right. However the coastlines produced by cgMap_Continents do not overlay the real landmass boundaries in the original image. Clearly the map projection isn't quite correct.
>
> Until I get this sorted I can't overlay data onto the image.
>
> Any ideas on what I am doing wrong?

It's hard to know without seeing the result, but I suspect you might
have to shift your range by half a grid unit to match the grid origins.

Cheers,

David

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: Google search from within an IDL program
Next Topic: chrome browser update

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

Current Time: Wed Oct 08 13:46:14 PDT 2025

Total time taken to generate the page: 0.00454 seconds