GMS-GrADS

This directory contains what would become useful tools when you want to analyze GMS-5 data which are brought to you via GMS-5 ( Japan Meteorological Agency), former Takagi-Lab Recieving Station (Institute of Industrial Science, Universtiy of Tokyo) and the Kochi Universtiy Weather Home by myself.

A freely distributed grid data analysis system, GrADS, may be obtained from the GrADS Home Page.


Appendix: A short note on PGM format

In the GMSxxx.pgm files, RAWBITS format is used. Therefore,
  1. the first "line" which containing the "magic number" is "P5".
  2. Our mapping software put a line of "comment" next which is safely ignored but must be cared if you are going to read the file with, for example, fgets().
  3. the third line is width and height in ASCII integer. You can pick up the data size from this value.
  4. the fourth line is "255" for IR channels, "63" for VIS channel.
You can read these lines with "head -4" command with UNIX system. So, the programming in C will become like:
fgets(buf,80,fp); /* skip P5 */
fgets(buf,80,fp); /* skip comment */
fgets(buf,80,fp); /* read a line with width & height */
sscanf(buf,"%d %d",&width,&height);
fgets(buf,80,fp); /* skip 255 */
/* next comes raw byte stream */
for (y=0; y<height; y++) {
  for (x=0; x<width; x++) {
    data[y][x] = fgetc(fp);
  }
}
Note that you must tackle with the libp?m in the netpbm package if you care more on the PGM format variations.
Or, you may use a trick to strip the comments off by:
pnmtorast GMSxxx.pgm | rasttopnm > GMSxxx-tmp.pgm

Tokio Kikuchi, Kochi Universtiy