Once again I am coming to the forum. I can't tell you how much I appreciate all your help, and I have made progress but am stumped again. It seems to be in fits and starts. For those who have not followed this in excrutiating detail, my goal is to get Chlor a, nlw, and K490 data out of the binned cumulative product for analysis in my GIS, all on a windows platform. Now I am a Biologist/GIS guy and while I've been doing this for a while, this project has been really wracking my brain because all these formats and conversions are foreign to me, I am more comfortable with digital air photos and Landsat TM !
While HDFView 2.3 seemed to work fine to display the maps of data for the SMI product (which I found out lost the shallow zones during conversion to 8 bit data), HDFView does not display the data for the binned product and I figured that has something to do with the subordinate files. I should caveat this, at least I can't make it work. I know HDFView is reading something properly because I can pull up the properties of each of the subordinate data (ie chloro ) and I can see the metadata such as path (/level-3 binned data/) tag, ref (1962,12) name (chlor_a sum) Type (32-bit floating point) Array Size (1)
I've been following the steps that Norman posted for me on one of my previous queries http://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?tid=1018
Here's the steps so far:
1) Download four files A20020012006031.L3b_CU.main, A20020012006031.L3b_CU.x04, A20020012006031.L3b_CU.x07 and A20020012006031.L3b_CU.x08.
2) bunzip'd them
3) Installed HDP (as far as I can tell, it works great on windows platform).
4) Ran hdp dumpsds -h -o sds.txt A20020012006031.L3b_CU.main so I could look at the header everything looks good, but what would I know!
5) Ran hdp dumpvd -h -o vd.txt A20020012006031.L3b_CU.main so I could look at the header
6) Ran hdp dumpvd -n chlor_a -d -o chlor_a.bin -b A20020012006031.L3b_CU.main (I also made an ASCII file so I could look at it).
Interestingly, the ASCII file is two columns wide, not a 8640 x 4320 matrix of values, any reason for that ?
7) Installed netpbm (version 10.27) to get the pgm conversion tools
8) Ran rawtopgm 8640 4320 chlor_a.bin > chloro.pgm
9) Tried to open the file in ERMapper as a binary in BIL (Band Interleaved by Line ), BIP (Band Interleaved by Pixel), and BSQ (Band Sequential format) with no luck. Did not expect the BIL or BIP to work because I did not think pgm is structured that way but I was not sure so I gave it a shot. I used the values of 8640 cells 4320 lines and 1 band and a 32-bit unsigned integer (ERMapper can't handle 32-bit floating).
So, I then tried to open the PGM file in a generic viewer (Advanced Batch Converter 3.9) and the image was basically gray noise.
I know the forum is not an expert on PGM file format, but does anyone have any ideas of where I went wrong ? I thought I did everything correct but it sure does not look like it. Ii was expecting a picture that resembles the earth.
By the way, if I try to convert the PGM file to a TIFF with pnmtotiff, it does not work, I get an error that says "_TIFFVSetField: Standard Output: Bad value 0 for "RowsPerStrip". Which made me wonder if I got my columns/rows transposed and when I ran rawtopgm with 4320 x 8640 the resultant file is taller than it is wide, so that can't be right.
Also, by the way, I'd like to import the file into ERMapper before making it to a TIFF because a TIFF will loose the 32-bit information in the HDF chloro file.
So I am stuck again with a bunch of questions on how to do what I want to do. What's worse is when I look at the headers and the PDF describing the binned product it says that in the subordinate files the data are
_sum (4-byte real): weighed sum of binned pixel values for corresponding geophysical parameter.
_sum_sq (4-byte real): weighted sum of squares of binned pixel values for corresponding geophysical parameter.
which means I then have to pull out the weights to compute the average (which I have no idea yet how to get the weights.
Thanks again for all your help !
PS If I have to do this again, I'll have to find a LINUX box that is for sure.