On 19 July 2012 15:25, Jose Gomez-Dans <[email protected]> wrote: > Hi, > > > On 19 July 2012 04:46, sigologo <[email protected]> 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. >
Here is your script modified to take the linear correction into account. Note that the destination spread (-2 to 45) was read from the metadata. Also note that you need to make the output format Float, otherwise, you get a quantised version. *for file in A*L3m_8D_NSST_4 ; * *do* * echo "map: $file"* * gdal_translate -of GTiff -ot Float32 \* * -scale 0 65535 -2. 45. \* * -a_srs "EPSG:4326" \* * -a_nodata 65535 \* * -a_ullr -180 90 180 -90 \* * -co "COMPRESS=PACKBITS" \* * 'HDF4_SDS:UNKNOWN:"A20030012003008.L3m_8D_NSST_4":0' \* * A20030012003008.L3m_8D_NSST_4.tif* *done* Jose
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
