extractR()
is a function that will extract mean pixel values from dates of Landsat satellite imagery, from locations provided by shape file. It has been optimized to work on USGS Landsat imagery that has been illumination corrected and stored in a date/satellite data
folder structure.
extractR(wdir, imdir, option, attrb)
wdir Path to working directory. This directory will include a folder named site_vectors
containing individual shape file features and a folder for each unique shape file feature containing date named jpeg images.
imdir Path to local archive of satellite imagery at the path/row level.
option A vegetation index or single band to be extracted from the imagery. Can be one of “i35”, “ndvi”, “b1”, “b2”, “b3”, “b4”, “b5” or “b6”.
attrb Name of the attribute table column heading which contains the unique identifier for the features. Commonly these is site names.
NOTE: This function is to be run after jpegR
and the common arguments above should be the same as those used when running jpegR
.
When called extract()
will:
The main purpose of this function is to extract mean values from satellite imagery that has been quality assessed after using the function jpegR
. This function is optimised to extract values for dense time series analysis. This function will work on any multiband imagery provided that:
extractR
to extract single bands and later combine to calculate the desired index.NOTE re-running this function will overwrite any previous output if the date ranges are the same. Each output .csv will have the name of the beginning and end dates of the imagery processed.
For a single site the output .csv will be formatted:
date | site1 |
---|---|
10/03/1999 | 73.11526 |
26/03/1999 | 37.10274 |
etc | etc |
Note that this data set will never have any NA values as only suitable imagery is processed.
For the collated sites output the .csv will be formatted:
.. | date | site1 | site2 | etc |
---|---|---|---|---|
1 | 10/03/1999 | 73.11526 | NA | etc |
2 | 26/03/1999 | 37.10274 | 35.19674 | etc |
3 | 14/06/1999 | NA | 44.44317 | etc |
Note this data set will contain NA values for location/date combinations that were deemed unsuitable after using the jpegR
function. This is most commonly due to cloud. Also note that the .csv will contain numbered rows. Other analysis functions take this into consideration.