sh
2010-06-06 09:51:48 UTC
Hi together,
I have a problem using map projections since I didn't get the same
results for IDL and ENVI.
My task is to reproject an image in lat/lon's (WGS 84, Geographic lat
lon) to mercator for Australia and show/save (*.png) only spatial
defined subsets of this reprojected image. (And also define "bigger"
spatial subset and pin the image on the right position)
I tested MAP_IMAGE and MAP_PROJ_IMAGE in IDL, but in both cases a had
a problem with the output dimension. MAP_IMAGE seems to act in
accordance with the predefined windows size and with MAP_PROJ_IMAGE it
is possible to set it by yourself. On the contrary, ENVI makes a
suggestion concerning the output pixelsize, but I didn't get it how
ENVI calculates this output size.
So I guess the sampling rate and/or pixel size is responsible for the
suggetion of ENVI?? Or even the distortion introduced by the map
projection??
Anyway, for my further comparison between ENVI and IDL I used the
output dimension suggested by ENVI to reproject the image. And to
compare the results I made to plots with the coast lines, which in
BOTH (!) cases didn't match (the result of ENVI was a little bit
better somehow)
Now I have several questions/comments:
- I have seen that there are 2 libraries within IDL (IDL, GCTP), so I
tested both of them. The only difference I realized was that you can't
set an ellipsoid for the IDL (map_set) library. Which library uses
ENVI??
- I use congrid to resize the image to a "plotable" size. Maybe this
causes the shifting between the coastlines?
- How can I select a spatial subset from the image and plot it into a
"bigger" spatial subset? e.g. to show only the east coast of australia
but with new zealand (where no image data is available) I think the
"problem" here is to find the right position?
- The images are correct but the coastlines are in a wrong
projection??
Maybe some of you have already expierence with such tasks! Any help
would be appreciated!
some lines of my code:
; to display IDL result
geographical_extend= [-39.5,112.5,-10.5,154.0]
range =
[geographical_extend[1],geographical_extend[0],geographical_extend[3],geographical_extend[2]]
; c is the image with the size 9960, 6960 and pixelspacing 0.00417°
map4 = map_proj_init(105, ellipsoid=8, limit=geographical_extend)
warped4 = map_proj_image(c, range, dimensions=[10983,7797],
map_structure=map4, uvrange=uvOut4, xindex=xindex4, yindex=yindex4)
window, /free, xsize=10983./10., ysize=7797./10.
disp=congrid(warped4, 10983./10., 7797./10.)
tv,reverse(disp,2)
plot, map4.uv_box[[0,2]],map4.uv_box[[1,3]],/NoData, XSTYLE=1,
YSTYLE=1,POSITION=[0,0,1,1], /noerase
map_continents, map_structure=map4
map_grid, map_structure=map4, londel=5, latdel=5
; to display ENVI result
infile = 'D:\temp\test.img'
read_envi_file, infile, img, xs, ys, type, offset, mapinfo,
STATUS=status
window, /free, xsize=10983./10., ysize=7797./10.
disp=congrid(img, 10983./10., 7797./10.)
tv,reverse(disp,2)
map_set, /mercator, limit=geographical_extend, /noerase, /
hires,xmargin=0, ymargin=0
map_continents, /coasts, color=255, /hires
map_grid, londel=5, latdel=5
cheers,
Sebastian
I have a problem using map projections since I didn't get the same
results for IDL and ENVI.
My task is to reproject an image in lat/lon's (WGS 84, Geographic lat
lon) to mercator for Australia and show/save (*.png) only spatial
defined subsets of this reprojected image. (And also define "bigger"
spatial subset and pin the image on the right position)
I tested MAP_IMAGE and MAP_PROJ_IMAGE in IDL, but in both cases a had
a problem with the output dimension. MAP_IMAGE seems to act in
accordance with the predefined windows size and with MAP_PROJ_IMAGE it
is possible to set it by yourself. On the contrary, ENVI makes a
suggestion concerning the output pixelsize, but I didn't get it how
ENVI calculates this output size.
So I guess the sampling rate and/or pixel size is responsible for the
suggetion of ENVI?? Or even the distortion introduced by the map
projection??
Anyway, for my further comparison between ENVI and IDL I used the
output dimension suggested by ENVI to reproject the image. And to
compare the results I made to plots with the coast lines, which in
BOTH (!) cases didn't match (the result of ENVI was a little bit
better somehow)
Now I have several questions/comments:
- I have seen that there are 2 libraries within IDL (IDL, GCTP), so I
tested both of them. The only difference I realized was that you can't
set an ellipsoid for the IDL (map_set) library. Which library uses
ENVI??
- I use congrid to resize the image to a "plotable" size. Maybe this
causes the shifting between the coastlines?
- How can I select a spatial subset from the image and plot it into a
"bigger" spatial subset? e.g. to show only the east coast of australia
but with new zealand (where no image data is available) I think the
"problem" here is to find the right position?
- The images are correct but the coastlines are in a wrong
projection??
Maybe some of you have already expierence with such tasks! Any help
would be appreciated!
some lines of my code:
; to display IDL result
geographical_extend= [-39.5,112.5,-10.5,154.0]
range =
[geographical_extend[1],geographical_extend[0],geographical_extend[3],geographical_extend[2]]
; c is the image with the size 9960, 6960 and pixelspacing 0.00417°
map4 = map_proj_init(105, ellipsoid=8, limit=geographical_extend)
warped4 = map_proj_image(c, range, dimensions=[10983,7797],
map_structure=map4, uvrange=uvOut4, xindex=xindex4, yindex=yindex4)
window, /free, xsize=10983./10., ysize=7797./10.
disp=congrid(warped4, 10983./10., 7797./10.)
tv,reverse(disp,2)
plot, map4.uv_box[[0,2]],map4.uv_box[[1,3]],/NoData, XSTYLE=1,
YSTYLE=1,POSITION=[0,0,1,1], /noerase
map_continents, map_structure=map4
map_grid, map_structure=map4, londel=5, latdel=5
; to display ENVI result
infile = 'D:\temp\test.img'
read_envi_file, infile, img, xs, ys, type, offset, mapinfo,
STATUS=status
window, /free, xsize=10983./10., ysize=7797./10.
disp=congrid(img, 10983./10., 7797./10.)
tv,reverse(disp,2)
map_set, /mercator, limit=geographical_extend, /noerase, /
hires,xmargin=0, ymargin=0
map_continents, /coasts, color=255, /hires
map_grid, londel=5, latdel=5
cheers,
Sebastian