--- Start of Idrisi List message
Hi Guillaume Larocque, Chris Huddart, Tim Shields and others

CONVERTING AVHRR 8x8km DATA TO IDRISI

For those of us who can't use C programming, here is the method for plebs
(it took me three whole days to figure it out!!! There may still be a better
way - if you know of one, let me know.):

To convert AVHRR data (Goode Homolosine projection) to Idrisi, I used a free
programme from the FAO, called WinDisp4, downloadable at:
http://www.fao.org/WAICENT/faoinfo/economic/giews/english/windisp/dl.htm

Since both WinDisp and Idrisi have a batch / macro facility, the conversions
of many files are actually quite quick.

In short, I imported the AVHRR data into WinDisp, converted it into Lambert
Azimuthal projection, since this is recognised by Idrisi, is also an
equal-area projection, and is versatile in that the origin, or centre, of a
regional projection can be placed anywhere on the globe. This file could
then be exported to Idrisi, where I created a custom Lambert projection
suitable for my data. Once the images were correctly geo-referenced in
Idrisi, they could be reprojected into lat/long or any other projection
within Idrisi.

Here are step-by-step instructions:

I will use as example a custom window of the 8x8km NDVI data which I
downloaded for southern Africa from http://daac.gsfc.nasa.gov/   >Search &
Order > Data Sets > AVHRR > Data Products > FTP products > FTP user subset >
Africa > custom window

I also downloaded a global image (8x8km NDVI) as reference image for my
subset. The global image is 5004 pixels wide and 2168 lines high. The centre
of this reference image (0�N x 0�E), is at pixel 5004 / 2 = 2502, and line
2168 / 2 = 1084.

To import the global image into WinDisp4: (just for interest�s sake)

Process > Import > Binary Image
        Height: 2168
        Width:  5004

Process > Header > Edit
        Image Type:     0, Generic
        Projection:     9, Goodes Homolosine
        Height: 2168
        Width:  5004
        Latitude Centre:        0 (centre of the projection)
        Longitude Centre:       0 (centre of the projection)
        X Centre:       2502 (half of width for reference image)
        Y Centre:       1084 (half of height for reference image)
        DX:     8000 (width of pixel in projection units, ie m/pixel)
        DY:     8000 (height of pixel in projection units, ie m/pixel)

By the way, note that the X-item in the header file does not consistently
come before the Y-item! So:
X               Y
Long            Lat
W-E             N-S
Width           Height
Columns Rows
Pixels  Lines

Now to the subset download. This is the Readme information on the southern
African subset:

Data Format: unsigned char (NDVI), unsigned integer(other parameters)
Headers, trailers and delimiters none
Missing data =0, water= 1, Interrupted space =2, Land data >=10
Subseted image size: 327 x 202

Goode's coordinates for subset area:
min_line = 1363 max_line = 1564 min_pix = 2663 max_pix = 2989
lat,long corner values for goode's subset box area
lower left   -34.524973,  9.833143 (lat,long)
lower right  -34.524973,  38.301293 (lat,long)
upper right  -20.063874,  36.052255 (lat,long)
upper left   -20.063874,  11.082543 (lat,long)

IN WINDISP4:

Step 1 - Process > Import > Binary Image

Width and Height as given in download documentation �subseted image size:
327 (width) x 202 (height)�

Step 2 - Process > Header > Edit

Set the header of the imported image.

According to the WinDisp help file, the Lat Centre and Long Centre are the
centre of the projection, ie 0�,0�.

The X Centre and Y Centre �define the centre of the image relative to the
reference projection image. For the reference image (in this case the global
image), these values are half the height and width. For sub-images (here the
SA data), the sub-image offsets are subtracted from the reference X Centre
and Y Centre.�

In relation to the global NDVI image, the southern African subset starts
with pixel 2663 (�min_pixel�), so the X-offset is 2663. It starts in line
1363 (�min_line�), so the Y-offset is 1363.

The centre of the global reference image (0�,0�) is at pixel 2502, line
1084, so, according to the WinDisp4 help file, you subtract the subset
offset from the reference image centre, ie:
the X-centre of the SA subset image is 2502 - 2663 = -161
and the Y-centre is 1084 - 1363 = -279

        Image Type:             0, Generic
        Projection:             9, Goode Homolosine
        Height:         202
        Width:          327
        Latitude Centre:        0
        Longitude Centre:       0
        X Centre:               -161
        Y Centre:               -279
        DX:                     8000
        DY:                     8000

Step 3 - Find centre of subset image

To find the exact latitude and longitude of the subset centre, which you
will need for the conversion to Lambert, zoom into the centre of your image,
until the pixels are at least a cm wide on your screen (for maximum
accuracy).

The Long (X) and Lat (Y) are displayed in WinDisp4 in the third box from the
left, in the status bar, and in that order.

Centre image pixel = width/2 = 163.5
With cursor on the border between pixel 163 and 164 (in line 101), read off
the X-coordinate = 23.77�

Centre line = 101
With cursor in the middle of line 101 (at pixel 163) read off the
Y-coordinate = -27.33�

Long Centre: 23.77      Lat Centre: -27.33
X Centre: 163.5 Y Centre: 101

Step 4 - Process > Image > New

You need to create a new blank image with the correct projection (Lambert
Azimuthal) and dimensions, in order to re-project the Goode image.

        Height:         202
        Width:          327

Step 5 - Process > Header > Edit

Set the Header of the new image. Get Lat/Long Centre values from Step 3.

        Image Type:     0, Generic
        Projection:     6, Lambert Azimuthal
        Height: 202
        Width:  327
        Latitude Centre:        -27.33
        Longitude Centre:       23.77
        X Centre:       163.5
        Y Centre:       101
        DX:     8000
        DY:     8000

Step 6 - Process > Reproject

        Image to reproject:     Imported Goode Homolosine image
        Reference image...:     New Lambert Azimuthal image
        Image to create:        Output filename

Step 7 - Process > Export > Idrisi Image

IN IDRISI

Step 8 - Create a new Idrisi projection reference file

The Origin of the new Lambert Azimuthal projection for your data area is
simply the Lat and Long of the centre of your subset image (ie 23.77, -27.33
for my SA data).

Use EDIT to open lazea.ref (Lambert Azimuthal Equal Area, set up for the
US).
Save under a new file name, eg lazea_sa.ref , and make following changes
(datum NAD27 and NAD83 are for the US only. Lambert Azimuthal is for
projection on a sphere.):

ref. system : USGS Lambert Azimuthal Equal Area
projection  : Lambert Oblique Azimuthal Equal Area
datum       : none
delta WGS84 : 0 0 0
ellipsoid   : Mean Sphere
major s-ax  : 6370997.000
minor s-ax  : 6370997.000
origin long : 23.77
origin lat  : -27.33
origin X    : 0
origin Y    : 0
scale fac   : na
units       : m
parameters  : 0

Step 9 - Modify the raster documentation file:

Change the raster documentation information as follows:

Calculate the minimum X and Y (which have to be in m):
min. X      : -  (width of image / 2 * resolution)
max. X      : width / 2 * resolution
min. Y      : - (height / 2 * resolution)
max. Y      : height / 2 * resolution

The resolution of the 8km x 8km NDVI surfaces is obviously 8000m, so the
X-bounds of my SA subset are -/+ (327 / 2) * 8000, and the Y-bounds are -/+
(202 / 2) * 8000.

The origin of the projection will be at 0,0 m, which is also the centre of
the image, and which is set in the lazea_sa.ref file.

data type   : byte
file type   : binary
columns     : 327
rows        : 202
ref. system : lazea_sa
ref. units  : m
unit dist.  : 1
min. X      : -1308000
max. X      : 1308000
min. Y      : -808000
max. Y      : 808000
pos'n error : unknown
resolution  : 8000
min. value  : 0
max. value  : 252
display min : 0
display max : 252

There you have it. Once the image is properly georeferenced in Idrisi, it
can be projected into any of the other Idrisi-recognised projections.


--------------------------------------------
Marlies Craig
Medical Research Council
771 Umbilo Road / PO Box 17120
Congella 4013 DURBAN South Africa
Tel: +27-31-2043600 (direct: 3653)
Fax: +27-31-2043601/2051498
Email: [EMAIL PROTECTED]
--------------------------------------------

--- End of Idrisi List message

IDRISI-L is an unmoderated list. As a service to list users, please post a 
summary of useful responses to your questions.
To post a message to IDRISI-L, send it to [EMAIL PROTECTED] To 
subscribe to the list, send an email from the address to be subscribed to 
[EMAIL PROTECTED] with "subscribe" (without quotes) as the first line 
of the message body. To unsubscribe, do the same, only with "unsubscribe" 
as the first line of the message body.

Reply via email to