Skip to contents

This function assigns to each Landsat pixel segment ID's derived from a shapefile of polygons with a Segment_ID attribute. This shapefile describes segments of interest along the west coast of the US. This function assumes that the Landsat data starts with quarter 1 of the first year of interest.

Usage

segment_landsat_data(
  lter_file_path,
  kelp_segments_file_path,
  ...,
  fractional_pixels = TRUE
)

Arguments

lter_file_path

character string path to the landsat netCDF file

kelp_segments_file_path

character string path to the kelp segments shapefile. Must contain a Segment_ID attribute and use the WGS 84 coordinate reference system (EPSG:4326)

...

These dots are for future extensions and must be empty.

fractional_pixels

whether to consider fractional area values of pixels, e.g. if a pixel in the Landsat data has a value of 66 m^2, setting fractional_pixels = FALSE will treat the pixel as 900 m^2 instead

Value

A dataframe with rows for each pixel, with the following columns:

  • Segment_ID: The ID of the kelp area segment

  • lon: The longitude of the Landsat pixel

  • lat: The latitude of the Landsat pixel

  • Q1.1984: The kelp area in m^2 of the given pixel for quarter 1 of 1984

  • ... : subsequent quarters and years

Segments that do not have any pixels ever are represented as rows of NA values