Skip to content
Prev 27972 / 29559 Next

issue when opening raster image in R, the pixel values a rescaled somehow

I see at the end of the output obtained with running gdalinfo on the file:

Band 1 Block=1200x3 Type=UInt16, ColorInterp=Gray
  NoData Value=0
  Unit Type: K
  Offset: 0,   Scale:0.02
  Metadata:
    DESCRIPTION=8-day daytime 1km grid Land-surface Temperature

This means that Kelving values are obtained by computing

0 (offset) + 0.02 (scale) * pixel_value

packages stars and readGDAL do this transformation for you, so you get
actual Kelvin values, and represent them with doubles so there is no
rounding problem. Other, lower level tools may give you INT2 values
where you need to take care of the offset & scale yourself.
On 3/24/20 10:28 AM, Roger Bivand wrote: