[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

19991005: Converting raster data to area data

>From: Justin Sharp <address@hidden>
>Organization: University of Washington/Atmospheric Sciences
>Keywords: 199910051925.NAA04765 McIDAS MAKEAREA MAKNAV


>I'm currently trying to convert a large set of 30 second terrain data into
>McIDAS area format.  My data is in row/column format with 5401 rows each
>containing 10201 columns.

This _is_ a large dataset.

>Each data value is 16 bits long.  There are no
>header or footer bytes in the file.  The area covered is from 15N;-135W to
>60N;-50W.  The first 16 bit word represents grid point 60N, -135W.  We are
>using McIDAS v7.6.  I'm having some problems and also have some other
>general questions:
>1) I am desperately trying to convert this file to an area file using
>makearea but do seem to be able to do so.  I'm pretty much McIDAS
>illiterate but here's what I've tried:
>MAKEAREA CONUS.TER 5000 5401 10201 0 2 0 6000 

>where CONUS.TER is my raster file and is located in ~/mcidas/data

This looks OK.

>(I'm not sure if I need the first command or not.)

You don't.

>The command fails with the message:
>MAKEAREA: Program called abort
>Any idea what is going wrong?

I just checked the code (makearea.pgm).  It looks liked I dimensioned
the arrays needed to do the work too small.  Try, or have the appropriate
person try:

<login as 'mcidas'>
cd mcidas7.6/src
<edit makearea.pgm>

      INTEGER     IBUF(10000),IDIR(64)
      INTEGER*2   JBUF(20000)
      CHARACTER*1 KBUF(40000)


      INTEGER     IBUF(12000),IDIR(64)
      INTEGER*2   JBUF(24000)
      CHARACTER*1 KBUF(48000)

make makearea.k
rm ~/bin/makearea.k
ln makearea.k ~/bin

>2) Although I have got no further, I believe that the next step is to use


>I planned to use:
>MAKNAV 1, 15, 1, -135, 0.008333333, 0.008333333

If 60N;-135W means 60 North (obviously) and 135 west (is -135W east?),
then the line would be:

MAKNAV 1 60 1 135 0.008333333, 0.008333333

McIDAS uses positive west longitude conventions.

>However, I'm not sure of the mapping of the lin param to the lat param. 
>Perhaps it should be:
>MAKNAV 1, 60, 1, -135, 0.008333333, 0.008333333 ???

Right, but longitudes would be positive west (yea, yea.  I know that this
is backwards!).

>3) I have written a Perl script which allows me to extract different areas
>of raster data from a larger grid and ultimately would like to completely
>automize the process of making a McIDAS areas for these subgrids.  Is
>there anyway to script the process?

Sure.  McIDAS routines can be run from Unix shell scripts as long as
the proper environment is setup.  For reference, check out the scripts
mcscour.sh, uwgrid.sh, and xcd_run in the 7.6 distribution and batch.k 
in ldm-mcidas.  This will give you an idea of what is needed.
Also check out Appendix H in the McIDAS-X Users Guide:

Running Commands Outside a McIDAS-X Session

>4) Finally, the reason I am doing all this is to provide myself and my
>department with high resolution terrain overlays for use in Gempak and
>Garp.  Once I have an area file how can I integrate it into Garp so that
>it can be selected of the overlays menu?

I will have to defer to Steve Chiswell on this one.

>Sorry to ask such a lot of question at once but I've been struggling with
>this for a while.  Assuming that I can resolve these problems I will have
>the capability of producing 30 second terrain overlays for any specified
>area from 6N:-180W to 90N:-50W (i.e. all of N. America and beyond).

I have done what you want above before, but on a smaller scale
(hence the limited buffer size in makearea.pgm) so I know that it is possible.

>I will of course be happy to contribute these to the Unidata community at

Yes, but who will want to keep around a 56 MB AREA file?


I will forward the GEMPAK question to Chiz for comment.

Tom Yoksas

>From address@hidden  Tue Oct 12 15:42:03 1999

Steve & Tom,

Thanks for the help.  I've managed to produce the high res terrain I
needed.  As you pointed out Steve, once I had made the AREA files
integrating into Garp was relatively painless.

Thanks again,


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.