Re: reading a sector from a McIdas area file, How display??

  • To: "Campbell, Garrett" <Campbell@xxxxxxxxxxxxxxxxxx>
  • Subject: Re: reading a sector from a McIdas area file, How display??
  • From: Tom Whittaker <tomw@xxxxxxxxxxxxx>
  • Date: Wed, 15 May 2002 12:49:46 -0500 (Central Daylight Time)

re: displaying your image in line/element coordinates

Since the plot() function uses the SpreadSheet's BasicCell, the default
is to try to convert a display to Lat/Long if that is possible.  You can
always use the "Mappings" control to change the default.

You can also do 'plot(data,1)'.  The second parameter will force the
Mappings Dialog to appear before the display.  Plot() also has a
signature of 'plot(data,mappings)' whereby you can specify the
ScalarMaps you want to use.

Finally, you could also just use the image() method in  It
just maps the RealTypes from the domain of the image onto the x- and
y-axes and shows the result.

re: navigation

As you suspect, you are getting 'area' coordinates for your 10x10
image.  To convert these to image coordinates, you need to add in the
beginning image line and element.  These values are available in the
AreaDirectory associated with the AreaFile.  Since you are using
AreaAdapter, however, there is no method in the current version to get
these values.  I will correct this.

In the meantime, and probably what is better, is not to tile your images
by lat/long.  If you use AreaFile to read your local data files, you can
get the directory information before the image data is read.  When you
instantiate an AreaFile object, only the metadata (directory, nav, cal)
are read.  The directory would then be available thru AreaFile's
getAreaDirectory() method.

You could, in fact, use this to just get the directory and then use
AreaAdapter() to read the files.

Other questions:

> From this what should x1,y1,nx,ny be??

Starting line/element, and the number of lines/elements to return.

> How can I display this image in image coordinates, not remapped to a
> lat/lon grid?

see above...

>       adum=AreaAdapter(request,0,0,10,10)   # does this read all the
> image or just the corner?

The actual reading in AreaFile computes the position of the first elemnt
of the requested line, and then reads all the pixels on those lines.
After that, it extracts the pixels you requested and stuffs those into
the return array.

>       edges=nav.fromReference(ltln)
> #          what order does fromReference want

(latitude,longitude) <-> (element, line)

> plot(dimg)
> # I wonder why this produces just a gray plot?

On some systems, if the image contains more than 2000 pixels, it is
displayed as gray.

> # How can I display just the image in image coordinates, not remapped to
> lat/lon?

See above.


Tom Whittaker
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Telephone/VoiceMail:  608.262.2759