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

Home » Public Forums » archive » Re: Confusions with map_image!
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
Re: Confusions with map_image! [message #66857] Fri, 12 June 2009 08:20 Go to next message
hethomas is currently offline  hethomas
Messages: 19
Registered: December 2008
Junior Member
Ah so it is as I feared! Will look further into the problem of fitting
the map to my image and see what that produces!
Thanks again,

Helen
Re: Confusions with map_image! [message #66858 is a reply to message #66857] Fri, 12 June 2009 08:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hethomas writes:

> I am not surprised by the results that are in my original grid (the
> one that I made as an amalgamation of my data). The thing that is
> surprising me is that when I use map_image on the image, the values
> change significantly, depending on the window size (and more
> obviously, whether the bilinear keyword is set) etc. It is this that
> has made me wonder how valid the results of Map_image are and what
> variables I should be using to get a "correct" result!

Well, yes, if you are using BILINEAR your results
*will* change with the size of the window! Those
extra pixel values have to come from somewhere.
BILINEAR interpolation will make them up for you.
(Often in the way you *wish* they were, rather than
the way they are.) Better in your case to use
nearest-neighbor interpolation so pixels are
replicated, but original values are not changed.

MAP_IMAGE is really a *display* technique (and a
poor one at that). It would probably be much better
to fit a map coordinate system to your image, rather
than fit the image to your coordinate system. There
are lots of articles on my web page and in the archives
of this newsgroup that address this issue. (Including
one this morning that points out how impossible this
is to do!)

But I would steer well clear of MAP_SET and any of
its associated routines if you really care about map
projected images. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Confusions with map_image! [message #66859 is a reply to message #66858] Fri, 12 June 2009 07:48 Go to previous messageGo to next message
hethomas is currently offline  hethomas
Messages: 19
Registered: December 2008
Junior Member
David,
I am not surprised by the results that are in my original grid (the
one that I made as an amalgamation of my data). The thing that is
surprising me is that when I use map_image on the image, the values
change significantly, depending on the window size (and more
obviously, whether the bilinear keyword is set) etc. It is this that
has made me wonder how valid the results of Map_image are and what
variables I should be using to get a "correct" result!
Re: Confusions with map_image! [message #66861 is a reply to message #66859] Fri, 12 June 2009 07:32 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hethomas writes:

> The processing code (written by someone else) runs in IDL and spits
> out an ASCII file for each individual MODIS image containing lat, long
> and SO2. I ran this code for each of the 575 images for a day's worth
> of data, rebinned each individual file to the 0.25x0.25 grid, combined
> the files and removed any duplicate points (by averaging the SO2
> value). Have I made a catostrophic gaff?

I don't know if you have made a catastrophic gaff,
but there are PLENTY of opportunities for maximum
values to be averaged out with all the rebinning and
averaging you are doing. Why are you surprised by the
results?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Confusions with map_image! [message #66863 is a reply to message #66861] Fri, 12 June 2009 07:02 Go to previous messageGo to next message
hethomas is currently offline  hethomas
Messages: 19
Registered: December 2008
Junior Member
Oh dear..... yes, I used IDL.

The processing code (written by someone else) runs in IDL and spits
out an ASCII file for each individual MODIS image containing lat, long
and SO2. I ran this code for each of the 575 images for a day's worth
of data, rebinned each individual file to the 0.25x0.25 grid, combined
the files and removed any duplicate points (by averaging the SO2
value). Have I made a catostrophic gaff?
Re: Confusions with map_image! [message #66864 is a reply to message #66863] Fri, 12 June 2009 06:39 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hethomas writes:

> The image I have was created by taking MODIS data for the entire globe
> (say, a day's worth of imagery), retrieving the SO2 from each of the
> individual images and combining them, and regridding the entire
> dataset onto a 0.25x0.25 degree grid. I have also been trying the
> method you used in the TOMS Aerosol Display problem although I'm not
> sure whether this is going to alleviate the issue either!

MODIS data!? Oh, dear. :-(

I suspect (as I always have) that the problem may lie then
in the regridding approach you are taking. How exactly
are you doing the regridding? (I hope you are not using
IDL for this!)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Confusions with map_image! [message #66865 is a reply to message #66864] Fri, 12 June 2009 06:24 Go to previous messageGo to next message
hethomas is currently offline  hethomas
Messages: 19
Registered: December 2008
Junior Member
Hi David - it is quite likely that I am taking the wrong approach so
any suggestions are more than welcome!

The image I have was created by taking MODIS data for the entire globe
(say, a day's worth of imagery), retrieving the SO2 from each of the
individual images and combining them, and regridding the entire
dataset onto a 0.25x0.25 degree grid. I have also been trying the
method you used in the TOMS Aerosol Display problem although I'm not
sure whether this is going to alleviate the issue either!

Thanks

Helen
Re: Confusions with map_image! [message #66866 is a reply to message #66865] Fri, 12 June 2009 05:37 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hethomas writes:

> Having spend the last couple of weeks trying to figure this out, I
> gather this isn't an uncommon problem, but hope that someone might be
> able to clarify -
>
> I have taken some global satellite data, and rebinned this into
> 0.25x0.25 degree pixels. Now I want to plot my data as an image for
> display. The data was originally in the format lat, long, data, but I
> formed data into a grid of 1440 x 720 in order to plot.
>
> The issue I am having is that there appears to be so many variables
> regarding the use of MAP_IMAGE, which seem to change my values
> significantly that I am not unsure what the "right" answer is! For
> example, the maxiumum value in my original grid could be 50, yet after
> using MAP_IMAGE this is reduced to say 35. The main factor which
> seems to affect this is the window size - I have set this to
> xsize=1453, ysize=749 in order to have a resulting image size of
> x=1440, y=720, but the values (although close) are still different.
>
> If anyone can shed any light on this I would be really greatful!

I think it is likely that this is completely the wrong
approach. :-)

Why don't you tell us more about the image (where you
got it, etc.) and maybe we can suggest something that
will work.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Confusions with map_image! [message #66970 is a reply to message #66858] Fri, 12 June 2009 17:49 Go to previous message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
David Fanning wrote:
...
> MAP_IMAGE is really a *display* technique (and a
> poor one at that). It would probably be much better
> to fit a map coordinate system to your image, rather
> than fit the image to your coordinate system.

It sounds like the original data he's using are MODIS L2 products, in
which case the the most appropriate coordinate system to use for any
given orbit's worth of data would be virtually any cylindrical
projection with it's axis tilted so that the "equator" of the projection
corresponds roughly to the ground path of the satellite (it can't be an
exact fit). However, he's interested in an entire day's worth of data
covering (incompletely) the entire globe. No single projection is going
to be a good fit for all of the orbits of an entire day's worth of data.
I think he's stuck with fitting his data to his coordinate system, and
not vice versa.

MODIS data, because of the high inclination of it's orbit, heavily
over-samples the polar regions. About the only thing he could do to
adapt his projection to the data is to choose one that exaggerates the
size of the polar regions; but that would only make sense if he's
actually interested in the polar regions.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Checking version number
Next Topic: Confusions with map_image!

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

Current Time: Wed Oct 08 15:39:45 PDT 2025

Total time taken to generate the page: 0.00619 seconds