Re: how to initialize a projection from its specification? [message #83947] |
Wed, 17 April 2013 10:24 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
>
> Hi David,
>
> I will take a look to your routine cgWarpToMap, it could be a solution to my problem. On the other hand, I would like to be able to initialize the map structure from the information I provided in the link. Is it possible? If so, I will be able to use MAP_PROJ_IMAGE and get the analytical solution.
Sure it is possible. I don't know what Latin1 and Latin2 mean in that
link, but possibly they are related to the standard parallels you need
for the Lambert Conformal projection. To set the limits of the map
projection, you are going to need to know values (either in XY projected
meters or lat/lon) of the sides of the grid, and they give you the
corners of the grid, so you will have to do some work there.
I'd probably project the corners of the grid to XY meters and work with
those values to find the values I need. You can calculate the values
from the grid spacing and the size of the image.
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.")
|
|
|
Re: how to initialize a projection from its specification? [message #83948 is a reply to message #83947] |
Wed, 17 April 2013 09:58  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi David,
I will take a look to your routine cgWarpToMap, it could be a solution to my problem. On the other hand, I would like to be able to initialize the map structure from the information I provided in the link. Is it possible? If so, I will be able to use MAP_PROJ_IMAGE and get the analytical solution.
Thank you,
Bernat
|
|
|
Re: how to initialize a projection from its specification? [message #83949 is a reply to message #83948] |
Wed, 17 April 2013 09:50  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> How can I initialize a mapping projection in IDL using the following specification?
> http://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html#GRID 130
>
> I want to remap (by bilinear interpolation) one image (that is projected in the specified grid) to another projection, by using MAP_PROJ_IMAGE.
>
> I do have the lat/lon values of the image but it seems that I cannot use MAP_PATCH if my final projection is initialized using MAP_PROJ_INIT.
>
> Any ideas?
Well, you seem to be mixing a couple of things up here. :-)
If you want to take an image in one map projection and re-project it to
another map projection, then MAP_PROJ_IMAGE is exactly what you want:
http://www.idlcoyote.com/map_tips/warpimage.html
You simply create a map structure for the current projection and one for
the desired projection, and Map_Proj_Image does a great job.
On the other hand, if you are considering MAP_PATCH, that is another
problem altogether. Here you have an image and a lat/lon value for each
pixel in the image, and you wish to display this image on a map
projection. This is more of a display solution than an analytical
solution.
I have written the equivalent of Map_Patch for the Map_Proj_*** method
of creating the map projection. It is called cgWarpToMap. You can learn
more about it here:
http://www.idlcoyote.com/idldoc/cg/cgwarptomap.html
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.")
|
|
|