Skip to contents

Continuous NOAA CRW v3.1 products are published as signed 16-bit integers with a scale factor of 0.01 and fill value -32768. Bleaching Alert Area products are unsigned bytes with fill value 251. This function rounds the returned values to their published precision and, when filename is given, writes those storage settings to disk.

Usage

encode_noaa(x, product, filename = "", overwrite = FALSE, wopt = list())

Arguments

x

A terra::SpatRaster.

product

One of the products supported by create_climatology().

filename

Optional output filename.

overwrite

Overwrite an existing file.

wopt

Additional terra::writeRaster() options. NOAA datatype, NAflag, scale, and offset settings take precedence.

Value

A rounded terra::SpatRaster, optionally backed by filename.