Skip to content

histogram matching of cloud masked Landsat 8 messages

2 messages · Barry Rowlingson, Sarah Goslee

#
Instructions say (help(histmatch))


Arguments:

  master: The target image, in SpatialGridDataFrame, data frame, matrix
          or vector format.

   tofix: The image to be normalized, in any format.

but what you have is a *raster* object, not a SpatialGridDataFrame, or
any other of those.

 You can convert a raster, r, to a SpatialGridDataFrame, rg:

 > rg = as(r,"SpatialGridDataFrame")

and then feed those to histmatch. You probably have to convert both arguments.

Barry
On Tue, Aug 12, 2014 at 4:45 PM, sarah crabbe <sarah_crabbe at yahoo.com> wrote:
#
What Barry says is completely correct: the landsat package (not
Landsat), is not currently compatible with the format used by the
raster package, only with sp classes or base R object types. You can
convert the raster objects, or use the rgdal package to import your
tifs as SGDFs.

And as I told you in private email, the landsat package was developed
pre-Landsat 8, and has not been updated for the new data source.

Both raster compatibility and Landsat 8 support are in the works, but
will not be available in the very near future.

Sarah

On Tue, Aug 12, 2014 at 12:25 PM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote: