[gdal-dev] Convert to temperature in degrees C in MODIS Ocean Color?

Jose Gomez-Dans jgomezdans at gmail.com
Thu Jul 19 07:25:14 PDT 2012


Hi,


On 19 July 2012 04:46, sigologo <dlopezaspe at gmail.com> wrote:

> I'm trying import A20030012003008.L3m_8D_NSST_4, with gdal with this
> script:
>
> for file in A*L3m_8D_NSST_4 ; do
>   echo "map: $file"
>
>   gdal_translate -a_srs "+init=epsg:4326" -a_nodata 65535 \
>     -a_ullr -180 90 180 -90 -co "COMPRESS=PACKBITS" \
>     HDF4_SDS:UNKNOWN:"$file":0  ${file}_out.tif
>
> done
>
> all good, but the data not be in degree C............. I find for it
> another
> script but no found in gdal...
>

The problem is that the data are linearly scaled (from the GRASS script you
quoted). I am unfamiliar with the ocean products (that's the bit of the
data I blank out ;-D), and you know the linear scaling (either because it's
constant, or beause you can read it out from the files's metadata), I think
you can use gdal_translates 'scale' option: -scale [src_min src_max
[dst_min dst_max]]. Note that hte syntax will be slightly different to the
slope/intercept one in your GRASS script.

Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120719/677c38b8/attachment.html>


More information about the gdal-dev mailing list