Skip to contents

Monthly irrigation values provided by AVB (in cubicmeters) downscaled to daily values (by dividing with "days_in_month" and normalised to mm/squaremeter by dividing with assumed irrigation area (44111068 m2)

Usage

irrigation

Format

A data.frame with 8835 rows and 3 variables:

year

year

month

month

days_in_month

days in month

date_start

date start

date_end

date end

irrigation_area_sqm

irrigation area in squaremeter

"groundwater.mmPerDay

irrigation using "groundwater" (mm/sqm)

"clearwater.mmPerDay

irrigation using "clearwater" (mm/sqm)

)

Examples

if (FALSE) { # \dontrun{
install.packages(c("dplyr", "tidyr"))
irrigation_file <- system.file("extdata/input-data/Beregnungsmengen_AVB.csv",
package = "flextreat.hydrus1d")

# irrigation_area <- rgdal::readOGR(dsn = shape_file)
# irrigation_area_sqm <- irrigation_area$area  # 44111068m2

## 2700ha (https://www.abwasserverband-bs.de/de/was-wir-machen/verregnung/)
irrigation_area_sqm <- 27000000

irrigation <- read.csv2(irrigation_file) %>%
  dplyr::select(- .data$Monat) %>%
  dplyr::rename(irrigation_m3 = .data$Menge_m3,
                source = .data$Typ,
                month = .data$Monat_num,
                year = .data$Jahr) %>%
  dplyr::mutate(date_start = as.Date(sprintf("%d-%02d-01",
                                             .data$year,
                                             .data$month)),
                days_in_month = as.numeric(lubridate::days_in_month(.data$date_start)),
                date_end =  as.Date(sprintf("%d-%02d-%02d",
                                            .data$year,
                                            .data$month,
                                            .data$days_in_month)),
                source = kwb.utils::multiSubstitute(.data$source,
                                                    replacements = list("Grundwasser" = "groundwater.mmPerDay",
                                                                        "Klarwasser" = "clearwater.mmPerDay")),
                irrigation_cbmPerDay = .data$irrigation_m3/.data$days_in_month,
                irrigation_area_sqm = irrigation_area_sqm,
                irrigation_mmPerDay = 1000*irrigation_cbmPerDay/irrigation_area_sqm) %>%
  dplyr::select(.data$year,
                .data$month,
                .data$days_in_month,
                .data$date_start,
                .data$date_end,
                .data$source,
                .data$irrigation_mmPerDay,
                .data$irrigation_area_sqm) %>%
  tidyr::pivot_wider(names_from = .data$source,
                     values_from = .data$irrigation_mmPerDay)
} # }
head(flextreat.hydrus1d::irrigation)
#> # A tibble: 6 × 8
#>    year month days_in_month date_start date_end   irrigation_area_sqm
#>   <int> <int>         <dbl> <date>     <date>                   <dbl>
#> 1  2017     1            31 2017-01-01 2017-01-31            27000000
#> 2  2017     2            28 2017-02-01 2017-02-28            27000000
#> 3  2017     3            31 2017-03-01 2017-03-31            27000000
#> 4  2017     4            30 2017-04-01 2017-04-30            27000000
#> 5  2017     5            31 2017-05-01 2017-05-31            27000000
#> 6  2017     6            30 2017-06-01 2017-06-30            27000000
#> # ℹ 2 more variables: groundwater.mmPerDay <dbl>, clearwater.mmPerDay <dbl>