Skip to contents

Estimates the observation date associated with each image mosaic and assigns corresponding values for year, water year, and month.

Usage

format_watertracker(df, unitID = "MU")

Arguments

df

Input data frame from water tracker

unitID

Character string for the field containing unique values for each of the management units for which hydrological data will be evaluated; default is "MU"

Value

tibble with added fields unit, wateryear, year, month, month_name

Details

For each unique wetland management unit, identifies and removes likely pseudoreplicate data from sequential observations with identical values that may represent the same image in multiple mosaics. Estimates the actual observation date as the midpoint between mosaic start and end dates, unless the next observation is a likely pseudoreplicate, in which case the date is estimated as the midpoint of the overlapping date range between the two observations. Also recalculate PercentWater as ObservedAreaWaterHa / ObservedAreaHa * 100 (to ensure none are >100%).

Wrapper function for find_duplicates(), estimate_obsdate(), and add_date_details(). Expects standard output from Water Tracker data with fields MosaicDateStart, MosaicDateEnd, ObservedAreaHa, and PercentWater.

Examples

data(sampledat)
format_watertracker(sampledat)
#> # A tibble: 5,537 × 19
#>    wateryear month month_name  year obsdate    unit        WETLAND CLASS AREA_HA
#>        <dbl> <dbl> <fct>      <dbl> <date>     <chr>       <chr>   <chr>   <dbl>
#>  1      2013     5 May         2013 2013-05-11 SampleWetl… Sample… mana…    37.1
#>  2      2013     5 May         2013 2013-05-27 SampleWetl… Sample… mana…    37.1
#>  3      2013     6 Jun         2013 2013-06-12 SampleWetl… Sample… mana…    37.1
#>  4      2013     6 Jun         2013 2013-06-28 SampleWetl… Sample… mana…    37.1
#>  5      2013     7 Jul         2013 2013-07-14 SampleWetl… Sample… mana…    37.1
#>  6      2013     7 Jul         2013 2013-07-30 SampleWetl… Sample… mana…    37.1
#>  7      2013     8 Aug         2013 2013-08-10 SampleWetl… Sample… mana…    37.1
#>  8      2013     8 Aug         2013 2013-08-19 SampleWetl… Sample… mana…    37.1
#>  9      2013     8 Aug         2013 2013-08-26 SampleWetl… Sample… mana…    37.1
#> 10      2013     9 Sep         2013 2013-09-04 SampleWetl… Sample… mana…    37.1
#> # ℹ 5,527 more rows
#> # ℹ 10 more variables: AREA_AC <dbl>, Mosaic <chr>, MosaicDateStart <date>,
#> #   MosaicDateEnd <date>, ObservedPixels <dbl>, WaterPixels <dbl>,
#> #   ObservedAreaHa <dbl>, ObservedAreaWaterHa <dbl>, PercentObserved <dbl>,
#> #   PercentWater <dbl>