Extracts a user-defined region from a set of VEGETATION
files in their distribution form (HDF format, zipped).
Corrects a time series of extracted NDVI input images
and computes some long-term statistics

Extracts user-requested masks from StatusMap files

 

 

 


 

 

(Win32  Version 2.1   -    February 2010)
written by Silvio Griguolo

University IUAV of Venice, Department of Planning, Italy
e-mail: silvio@iuav.it

Download Version 2.1 (February 2010)  NEW! 

  • Some users wrote to me, regretting that they were unable to use the information in StatusMaps (water/land pixels, ice/snow pixels, cloudy pixels) in their current bitwise form. I thought therefore to add an option to extract any desired combination of masks from any number of StatusMap files.
    After extracting it, a mask can be displayed using a graphic utility (DISPLAY) excerpted from ADDAPIX for Win32 (WINADX), an application that I am preparing, and will be released soon.

DISPLAY is also used to visualise the location of the Region to be cropped.

  • Keep in mind that land/water masks derived from StatusMaps show the well-known ghost layer of 4-5 pixels all around land. This is particularly evident (and somewhat disturbing) for small islands, whose size is enormously exaggerated.

In general, use masks with prudence: they are generated automatically from the values  of the four radiometric bands, and sometimes this appears to lead to  unreliable and bizarre results, like ice/snow pixels found around some great lakes in Central Africa(!). See the help on line for some pictures (but I hope to have done something wrong and that things are actually not like that...).

  • Two utilities have been added to derive from the .TXT documentation files associated to the cropped images the text files necessary to load BIL images in ArcView/ArcGis or ENVI. Two more utilities enable the conversion of BIL images to the WINDISP format, or vice versa. Their purpose is to change the format of the images and the text files that describe them without needing to re-crop the Regiion of Interest from the original zipped VGT distribution files.

  • This version also fixes a problem with 2010 VGT distribution files, refused by the previous versions. Actually, when I wrote CropVgt I did not think it would be used for so long, so the correctness of input filenames was checked only up to year 2009!


Version 2.0 (November 2008)

While working on a new version of Addapix for Win32 (Principal Components Analysis and Clustering on a set of satellite images), it occurred to me  that some functions conceived for that application could also be useful to CROPVGT users.
I decided to spend some time adapting them, and here they are.

1. Any number of NDVI images forming a time series, cropped from VGT continental images, can be improved by suitably correcting the time series
    of each pixel. Unreliably low values caused by mist or partial cloudiness are corrected, missing values are simulated,  and the new  corrected
    images thus obtained are saved.

2. From these corrected images 36 dekadal long-term means images (historical averages) and 36 dekadal standard deviations images (measuring
    the inter-annual variability) are computed.

The distribution zipped file includes a sample time series of 405 dekadal images (April 1, 1998 through June 3, 2009) of a Region around Lake Tana, Ethiopia, cropped (in one go!) from the NDVI VGT continental images of Africa. They are used for an exercise on correction/computation of long-term statistics. A PDF file of instructions for that exercise is also included.


Version 1.1
in case of multiple extraction only one file .TXT, that describes the cropped window,
   is saved to file. Before there was one TXT file for each image saved, which  needlessly multiplied
   the number of the TXT files.

-  when processing NDVI images, if the requested output is in WINDISP format the code indicated
   for clouded pixels is now correctly saved in the header of the output image.


Version 1.0
added support for processing global NDVI images, available on the free VGT site starting from August 2006.
Thanks to dr. Sander Zwart for bringing the use of these images to my attention.


Version 0.9
same as version 0.8, with the only difference that the number of decimals declared in the header of output images saved in WINDISP  format has been changed from 0 to 3. This allows the user to compute correctly some areal statistics using WINDISP.


At the time being, S10 and D10 products (ten-day MVC and BiDirectional Reflectance syntheses respectively) can be freely downloaded from the SPOT4/VEGETATION site http://free.vgt.vito.be.

The available files are zipped, and each of them covers a whole continent, or part thereof: they are therefore quite large. Besides, the planes included in each zipped file are in HDF format (Hierarchical Data Format) and it is not immediate to interpret their headers or point to the beginning of the bitmap to extract it, or to crop a sub-region.

After spending quite a lot of time creating batch commands to do the job (so easy to overlook something!), I decided to write a Win32 program to do it in a fully automatic way. Here is my contribution to the VEGETATION users' community...

CROPVGT can be used to extract a user-defined Region of Interest from any number of files downloaded from the free VGT site.

NEW!
 
A time series of cropped NDVI images (no limit on their number) can then be improved by interpolating through the maxima of the series of each pixel, and simulating reasonable values for missing ones. Using the corrected images thus obtained, long-term means and standard deviations can be computed by pixel and dekad, taking into account all the available years.

 How CropVgt works

The user selects:

  • any number of zipped VGT files to be processed; they can reside in different folders, but must all refer to the same type of product (S10 or D10) and the same continent;

  • the output folder where the images being cropped are to be saved; 

  • the bands to be processed;

  • the Region of Interest to be extracted from all the files and all the bands indicated. This is done by entering the longitude/latitude of the RoI's upper-left and lower-right corners; 

  • to have the clouds automatically masked in NDVI images, deriving the necessary information  from the Status Map. 

CROPVGT scans one by one all the user-chosen VGT zipped files. From each input file, the bands selected by the user are extracted. For each band, the HDF header and the accompanying LOG file are read, then the Region of Interest is cropped and saved to a file named  <BBBYYMMDREG.EXT>, where

' BBB'   is a group of two or three letters indicating the band;
'
YY '      are the year's last two digits;

' MM '   stands for the month ('01' to '12');
' D '       stands for the dekad  ('1' to '3');
' REG '  stands for up to three letters entered by the user to label the RoI.
' EXT'    is an extension that depends on the output image format chosen by the user. It is:

.bil  if they are saved as pure binary bitmaps, accompanied by suitable documentation files to enable their loading in ArcView/ArcGis, or ENVI, or other applications;
.img  if they are saved in WINDISP format: a binary bitmap, preceded by a 512-byte binary header.

Optionally, in NDVI images cloudy pixels can be masked by assigning them a code indicated by the user.

The output images are accompanied by a documentation text file, having the same filename and  extension 'txt'.


How to install CROPVGT

  • Download the new version 2.1. It comes as a zipped file: unzip it anywhere on your hard disk (please, not on the desktop!). It creates a folder <cropvgt> with all the necessary software and data. It includes a service sub-folder <images> (do not tamper with it!) and a sub-folder <Tana>  (see below). To run the application, double-click on the executable cropvgt.exe.

  • The Windows Registry is not modified, so no installation is actually necessary. You can optionally edit the file CROPVGT.INI to change some parameters loaded by the programme at startup.

  • The programme includes a help that offers some info derived from the VEGETATION FAQ. The paper by Duchemin and others, presented at the 2000 Belgirate Conference, on which the D10 BDR products are based, is also included. 

  • the programme's directory <cropvgt> contains a folder < tana >, with  405 NDVI images cropped around Lake Tana, Ethiopia. Each image is 225x225 pixels (2°x2°). The file instructions.pdf provides the instructions for an exercise on image correction, and computation of long-term statistics.

For an example of how the long-term means can be used to construct an eco-climatic classification or to monitor the evolution of the cropping season, download a worked example on Sudan 2005 (PPT presentation, data and software: 170 MB all together).


Problems with online help?

At the time being CROPVGT offers only an online help in WINHELP (*.HLP) format, which is no longer supported by Windows Vista. Until a .CHM help file is ready, users of Vista can dowload and install WINHELP pushing the button below.

 WINHELP is here 


Credits

  • Thanks to the Info-ZIP group for making Unzip32.dll freely available;

  • Aicon.dll is derived from AICON (the Artemis Image CONverter), a program  that I wrote for FAO/ARTEMIS, available  from here;

  • Adxlib.dll is a dynamic link library developed during my very slow (still ongoing) attempt to convert ADDAPIX into a Win32 package. ADDAPIX (Data Analysis pixel-by-pixel), also partially funded by FAO/ARTEMIS, is a DOS package, quite old and no longer supported. However, a Windows 32 version (Addapix for Windows, or WINADX) is being prepared and will soon be ready. 


Feel free to link this page, or copy the installation file to your site, as long as the author's name goes along. Please, do not omit to offer your suggestions and to inform me of the bugs you may find.

(page maintained by S. Griguolo - email: silvio@iuav.it - last update: February 2010)