|
Re: Creating a .kml file from data with a geostationary map projection [message #92039 is a reply to message #92036] |
Fri, 02 October 2015 07:40   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
ian.j.ashpole@gmail.com writes:
> I have some data that i would like to be able to display in Google
Earth. The data are in geostationary map projection, and i understand
from reading around (predominantly here:
http://www.idlcoyote.com/cg_tips/image2kml.php) that these need to be
reprojected to an equirectangular map projection first. Unfortunately,
this is where i come unstuck! If anybody would be able to help me with
this it would be most appreciated.
>
> Data that i would like to plot are here (netcdf format):
> https://www.dropbox.com/s/49ri4ib7rju0j0s/data_to_plot.nc?dl =0
>
> The lon,lat values for each cell in that file are here:
> https://www.dropbox.com/s/m53d2tn6ccd6jto/lonlats.NA_MiddleE ast.nc?dl=0
I read the data into the variables, bt, lons, and lats. Then, as a quick
and dirty exercise, I did this:
i = where(lons le 360 and lats le 90)
img = cgwarptomap(bt[i], lons[i], lats[i], Resolution=[1331, 605], $
Map=imgmap, /SetRange) ; took a few seconds to grid
cgloadct, 33
cgdisplay, aspect=img
cgimage, img, /scale, /keep, xrange=imgmap.xrange, $
yrange=imgmap.yrange, /save
snap = cgsnapshot()
cgimage2kml, snap, imgmap, transparent=50
Opened the resulting KML file in Google Earth. Looks promising. :-)
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.")
|
|
|
|