MITIFF
Author
Øystein Godøy, METNO/FOU, 16.02.2006
W5 of MITIFF
What?
MITIFF is an implementation of geocoded information in TIFF 6.0. The
difference bewteen a standard TIFF 6.0 image and the MITIFF image is the
special formatting of the TIFF commentary tag. This is formatted with
information required for geolocation of the image. The reason this
formatting is used and not the GEOTIFF standard is that the GEOTIFF
standard was not available when the MITIFF was needed. More info on the
ASCII tag wil be given below.
Why?
GeoTIFF was an idea, but not a functional library when MITIFF was created. If
GeoTIFF had been available, this would have been used instead.
Where?
MITIFF was developed for visualisation of meteorological raster data (e.g.
satellite and weather radar data) in a meteorological work station. MITIFF
is implemented in various local libraries at the Norwegian Meteorological
Institute. The reference implementation is the libsatimg
implementation. This is the basis for the use in DIANA
.
libsatimg
is now being phased out and support is added to
libfmio
instead. Libraries are available upon request.
When?
MITIFF was defined in 1994 with only minor adjustments since tehn.
Who?
The original version was defined and implemented by Øystein Godøy,
adjustments have been performed together with Steinar Eastwood.
Fundamentals
TIFF 6.0
TBW
User Coordinate System
The User Coordinate System (UCS) system is the navigation system used
within the USGS mapping software PROJ.4. Basically it is a Cartesian
coordinate system having origo at the North Pole. Positive x-direction is
eastwards and y-direction southwards in the Pacific. The following
variables are used to navigate images in this system:
- Ax - size of the pixel in km in x-direction (must be the same as Ay)
- Ay - size of the pixel in km in y-direction (must be the same as Ax)
- Bx - distance in km from 0°E to upper left pixel of the image
- By - distance in km from the North Pole to upper left pixel of the image
- iw - image width in pixels
- ih - image height in pixels
All distances are given for the center point of the pixels. Images are
always presented in Polar Stereographic map projection correct at 60°N
aligned along the 0°E (Greenwich) meridian. A graphical outline of the
configuration is given below.
Geolocation information
An example of the MITIFF geolocation information and an explanation of the
elements is given below. When presented here newline characters are also
visualized.
Satellite: NOAA-16 \n
Date and Time: 09:38 26/10-2001 \n
SatDir: 0\n
Channels: 5 In this file: 1 2 3 4 5 \n
Xsize: 1000 Ysize: 1000\n
Map projection: stere \n
TrueLat: 60.00 N GridRot: 0.000\n
Xunit: 1000 m Yunit: 1000 m\n
NPX: 0.000000 NPY: 0.000000\n
Ax: 1.500000 Ay: 1.500000 Bx: -266.731445 By: -2301.237549\n
Calibration VIS: A=(0.000000)+(0.392157)*C\n
Calibration IR: T=(323.000000)+(-0.500000)*C
The geolocation information is a specially formatted text string located
within the TIFF tag for "Image description". It is composed of a
sequence of keywords and data content. The keywords are not only a single
word, but can also be a sentence. The keywords can be grouped in sections,
not being physical sections clearly identified in the header, but sections
by purpose.
The first section describes the satellite data and contains the keywords:
- Satellite: - name of satellite or data source
- Date and Time: - hour:minute day/month-year
- SatDir: - Rarely used...
- Channels: - Number of channels in the file (e.g. 5 AVHRR channels)
- In this file: - Identification of the channels by number or text
string
The second section describes the image:
- Xsize: - Number of pixels horisontally (also found elsewhere in the
tags).
- Ysize: - Similar as Xsize but for vertical size.
- Map projection: - Only Polarstereographic is used at METNO (stere is the
definition of polarstereographic in the PROJ software).
- TrueLat: - Latitude for the Polarstereographic projection. Always 60
deg N at METNO.
- GridRot: - Rotation of the projection around the 0 deg longitude.
Always 0 at METNO.
The third section describes the Universal Coordinate System used both in
the MITIFF and MEOS/HDF files:
- Xunit:
- Unit used for Ax and Bx. Always 1000 m, meaning 1000 meters at METNO.
- Yunit:
- Unit used for Ay and By. Always 1000 m, meaning 1000 meters at METNO.
- NPX:
- Position of the North Pole in the coordinate system x-direction.
Always 0 at METNO meaning the Universal Coordinate System
(UCS) data used refer to a righthanded coordinate system with origo at the
North Pole.
- NPY:
- Position of the North Pole in the coordinate system
y-direction. Always 0 at METNO meaning the Universal Coordinate System
(UCS) data used refer to a righthanded coordinate system with origo at the
North Pole.
- Ax:
- Referring to the Xunit this is the pixel size in x-direction
(east/west referring to a righthanded coordinate system) in kilometers.
- Ay:
- Referring to the Yunit this is the pixel size in y-direction
(north/south referring to a righthanded coordinate system) in kilometers.
- Bx:
- Referring to the Xunit this is the distance in kilometers of the upper
left corner pixel in the data matrix from the Greenwich meridian. Positive
x-direction is towards the East.
- By:
- Referring to the Yunit this is the distance in kilometers of the upper
left corner pixel in the data matrix from the North Pole. Positive
y-direction is towards the Bering Strait thus it usually a negative number
at METNO.
The final section defines calibration information or palette image
information and is not further described here.
Library reference
- int MITIFF_read(char *infile, unsigned char *image[],
struct mihead *ginfo);
- read standard greyscale TIFF 6.0 files containing specially formatted ASCII
commentary tag.
- int MITIFF_read_imagepal(char *infile, unsigned char *image[], struct mihead
*ginfo, struct miheadpal *palinfo);
- read palette color TIFF 6.0 files containing specially formatted ASCII
commentary tag.
- int MITIFF_write(char *outfile, unsigned char *image, char newhead[],
struct mihead ginfo);
- write standard greyscale TIFF 6.0 files containing specially formatted ASCII
commentary tag.
- int MITIFF_write_multi(char *outfile, unsigned char *image[],
char newhead[], struct mihead ginfo);
- Do not use at present.
- int MITIFF_write_rgb(char *outfile, unsigned char *image[],
char newhead[], struct mihead ginfo);
- write RGB composite TIFF 6.0 files containing specially formatted ASCII
commentary tag. This is used for presentation purposes e.g. combining
AVHRR channels 1, 2 and 4 and the applying the software [satsplit] to the
resulting files. [satsplit] puts landcopntours etc on the image.
- int MITIFF_write_imagepal(char *outfile, unsigned char *class,
char newhead[], struct mihead ginfo, unsigned short cmap[3][256]);
- write palette color TIFF 6.0 files containing specially formatted ASCII
commentary tag.
- void MITIFF_head(char imginfo[TIFFHEAD], char satellite[16],
char time[17], short satdir, short zsize, char chdesc[20], int xsize,
int ysize, char projection[30], char truelat[10], float rot, int xunit,
int yunit, float npx, float npy, float ax, float ay, float bx, float by,
char *calib);
- create the ASCII string to put in the TIFF commentary tag containing
geolocation info and more. see below for details.
- int fillhead(char *asciifield, char *tag, struct mihead *ginfo);
- internal function used by read functions
- int fillhead_imagepal(char *asciifield, char *tag,
struct miheadpal *palinfo);
- internal function used by read functions