ssec / polar2grid

Tools for reading, remapping, and writing satellite instrument data.
http://www.ssec.wisc.edu/software/polar2grid/
GNU General Public License v3.0
72 stars 34 forks source link

questions about the viirs2gtiff #89

Closed psycho2012 closed 10 years ago

psycho2012 commented 11 years ago

Hi,

I use polar2grid 1.0 which download from http://cimss.ssec.wisc.edu/cspp/npp_polar2grid_v1.0.shtml to process the VIIRS M band data, it seems not work very well. The commands what I uesed is './viirs2gtiff.sh -d /mnt/hgfs/G/3/' and in the folder 3, it contains the VIIRS files 'SVM15_npp_d20130204_t0645181_e0650585_b06596_c20130923080917092309_noaa_ops.h5', 'GMTCO_npp_d20130204_t0645181_e0650585_b06596_c20130204125058936535_noaa_ops.h5'. The software can work well, but the result seems not quite right(The Brightness Temperature is small than the original h5 file). If I use the coefficients(DN*0.00412+111.0) in the h5 file to calculate the BT, many of them(Land, with out any cloud) is low than 200K. So, I am wonder what is wrong, and is there something wrong of my operating?

djhoese commented 11 years ago

Hi there,

I think polar2grid is working as expected in this case. In order to fit the output data type, in this case an 8-bit integer (v1.0 might be 16-bit actually) geotiff, polar2grid must scale the brightness temperatures to a 0-255 range. There are ways to scale the data differently, but traditional geotiffs do not contain float/decimal values (like the original brightness temperature values) so you would still have to do some type of scaling.

I hope this makes sense. Let me know if you have more questions.

psycho2012 commented 11 years ago

Yeah, thank you. If I want to get the real BT value from the tiff data, What type of scaling should I do?

djhoese commented 11 years ago

What you would have to do is essentially reverse the calculation described on this page: http://www.ssec.wisc.edu/software/polar2grid/rescaling.html#brightness-temperature

Note that this documentation is for v1.1.0 which we hope to release soon. The difference is that your v1.0 geotiff is probably 16-bit instead of 8-bit. Another important thing to note is an auto-incrementing step (mentioned at the top of that page) that adds 1 to the results of the scaling in both versions. So I think the steps needed to do this would be:

  1. Get the data out of the file
  2. Mask out all data equal to 0 (these are fill values).
  3. Subtract 1 from all values
  4. For all values less than 45232, do: (169620 - val) / 514
  5. For all values greater than 45232, do: (107422.854 - val) / 256.987
  6. You now have your brightness temperatures.

I should note that these won't be the exact brightness temperatures since they had to be converted from a float to an integer to be put in the geotiff (lost precision).

Something else you may want to consider if you want remapped "real" values is the "viirs2binary.sh" script which I believe is included in polar2grid 1.0. This script does not do any scaling by default and leaves the files in a 32-bit float binary file where -999.0 is the fill value (I think).

Good luck.

psycho2012 commented 11 years ago

I have tried the method you mentioned above and I think "viirs2binary.sh" is a good choice to get the exact brightness temperatures. By the way, if I can use polar2grid to process the VIIRS LST(VLSTO_npp_d20130510_t0524374_e0530178_b07943_c20130928072355052444_noaa_ops.h5) which download from http://www.class.noaa.gov/ ? Thanks.

At 2013-10-04 00:01:10,David notifications@github.com wrote:

What you would have to do is essentially reverse the calculation described on this page: http://www.ssec.wisc.edu/software/polar2grid/rescaling.html#brightness-temperature

Note that this documentation is for v1.1.0 which we hope to release soon. The difference is that your v1.0 geotiff is probably 16-bit instead of 8-bit. Another important thing to note is an auto-incrementing step (mentioned at the top of that page) that adds 1 to the results of the scaling in both versions. So I think the steps needed to do this would be:

Get the data out of the file Mask out all data equal to 0 (these are fill values). Subtract 1 from all values For all values less than 45232, do: (169620 - val) / 514 For all values greater than 45232, do: (107422.854 - val) / 256.987 You now have your brightness temperatures.

I should note that these won't be the exact brightness temperatures since they had to be converted from a float to an integer to be put in the geotiff (lost precision).

Something else you may want to consider if you want remapped "real" values is the "viirs2binary.sh" script which I believe is included in polar2grid 1.0. This script does not do any scaling by default and leaves the files in a 32-bit float binary file where -999.0 is the fill value (I think).

Good luck.

— Reply to this email directly or view it on GitHub.

djhoese commented 11 years ago

Right now it is not possible to process the VIIRS LST files with polar2grid, sorry.