This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>From: "D. J. Raymond" <address@hidden> >Organization: New Mexico Tech >Keywords: 200006210029.e5L0TGT14952 Unidata-Wisconsin Dave, >That helps a lot. Indeed, I am using my own code. OK. So the decoding into native AREA format will not help. >Given what you >have sent me, I should be able to modify things to make them work >sometime in the next month. Super. Again, if this is not enough time, please let me know so we can adjust the conversion schedule. >Is there a way for a program to tell whether it is looking at an >old delta-encoded file or a png compressed file? Yes. The beginning of the PNG compressed block in the image is labeled with the ASCII sequence PNG. It is then followed by four 4-byte words the third and fourth of which are the length of an image line and the number of image lines. Since the existence of a calibration codicil, aux block, and comment cards is not guaranteed, the location of the PNG string is not fixed. A code snippit from pnga2area.c shows how to locate the beginning of the PNG compressed image lines: /* ** Now figure out where the beginning of the PNG compressed image is. */ datoff = imgdir[33]; datlen = datoff - nbytes; cmtlen = 80 * imgdir[63]; udebug( "datoff: %d", datoff ); udebug( "datlen: %d", datlen ); udebug( "cmtlen: %d", cmtlen ); 'datoff' (area directory word 33 (zero based)) would be the beginning of the image lines in an AREA except that I move the comment cards to that location so that the compressed image lines will be at the end of the product. 'cmtlen' (area directory word 63 (zero based) is the number of bytes of comment cards which will be located after all of the directories/codicils and just before the PNG compressed image. This value could be zero. The beginning of the PNG stuff will be at 'datoff+cmtlen' bytes from the beginning of the file. I hope that this helps... Tom >From address@hidden Wed Jun 21 16:27:49 2000 >Subject: Re: 20000621: Unidata-Wisconsin datastream additions: CIMSS products >(cont.) Thanks Tom! -- Dave