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

Home » Public Forums » archive » Is this a legitimate way of projection and subset?
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
Is this a legitimate way of projection and subset? [message #80903] Tue, 24 July 2012 17:13 Go to next message
YY[1] is currently offline  YY[1]
Messages: 1
Registered: July 2012
Junior Member
Hi all,

I need to subset a lot of images using another image (Let's just call it the reference image). I would like these images to have the same projection, extent, and exactly-matched pixels. The images to be subset have the same spatial resolution with the reference image. Here's my way of doing it. Please let me know if you think it's legitimate.

1. Get the file coordinates of the reference image, convert it to map coordinates, and then to lat/lon.

2. For each image to be subset, convert the 2D-array of lat/lon we got from the reference image to map coordinates, and then to the file coordinates, with respect to the image to be subset.

3. Use the 2D- array of file coordinates to subscribe the original image to be subset, and get a new image. I suppose the pixel locations of the new image matches exactly those of the reference image. Use the same map_info of the reference image to set up the header for the new image.

Thus we can get the image that matches exactly with the reference image, in terms of either projection, extent and pixel locations. I was just wondering if this is a legitimate way to do it, because usually we would warp the image to the new projection and then do the subset,although this would lead to discrepancy between pixels on the two images that are supposed to align with each other.

Thanks a lot!
Re: Is this a legitimate way of projection and subset? [message #80985 is a reply to message #80903] Thu, 26 July 2012 13:18 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, July 24, 2012 8:13:42 PM UTC-4, YY wrote:
> Hi all,
>
> I need to subset a lot of images using another image (Let's just call it the reference image). I would like these images to have the same projection, extent, and exactly-matched pixels. The images to be subset have the same spatial resolution with the reference image. Here's my way of doing it. Please let me know if you think it's legitimate.
>
> 1. Get the file coordinates of the reference image, convert it to map coordinates, and then to lat/lon.
>
> 2. For each image to be subset, convert the 2D-array of lat/lon we got from the reference image to map coordinates, and then to the file coordinates, with respect to the image to be subset.
>
> 3. Use the 2D- array of file coordinates to subscribe the original image to be subset, and get a new image. I suppose the pixel locations of the new image matches exactly those of the reference image. Use the same map_info of the reference image to set up the header for the new image.
>
> Thus we can get the image that matches exactly with the reference image, in terms of either projection, extent and pixel locations. I was just wondering if this is a legitimate way to do it, because usually we would warp the image to the new projection and then do the subset,although this would lead to discrepancy between pixels on the two images that are supposed to align with each other.
>
> Thanks a lot!

I think this is an OK way of working. In general, yes, I start with the coordinate system of the "reference" image, transform to sky, then transform to pixel coordinates of the image whose data is to be retrieved. In case the two coordinate systems do not match exactly, you might be able to use interpolation.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: plot problem
Next Topic: Re: Efficiently perform histogram reverse indices like procedure on a string array?

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

Current Time: Wed Oct 08 09:23:02 PDT 2025

Total time taken to generate the page: 0.00671 seconds