Skip to content

Commit

Permalink
fix to anlz_dps_facility for pasco split, added pasco inst file for c…
Browse files Browse the repository at this point in the history
…omplete testing
  • Loading branch information
fawda123 committed Apr 10, 2024
1 parent 1069160 commit 3102610
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
25 changes: 23 additions & 2 deletions R/anlz_dps_facility.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ anlz_dps_facility <- function(fls){
dplyr::filter(!(grepl('^D', outfall) & permit == 'FL0028061LA')) |>
dplyr::filter(!(grepl('^R', outfall) & permit == 'FL0028061SW'))

##
# add coastal code 189, 193 for pasco (input is half of reported to account for two coastal codes)
# add back to dps
if(any(grepl('pasco', dps$fls))){

dpspasco189 <- dps |>
dplyr::filter(grepl('pasco', fls)) |>
dplyr::mutate(coastco = '189')

dpspasco193 <- dps |>
dplyr::filter(grepl('pasco', fls)) |>
dplyr::mutate(coastco = '193')

dpsnopasco <- dps |>
dplyr::filter(!grepl('pasco', fls))

dps <- bind_rows(dpsnopasco, dpspasco189, dpspasco193)

}

##
# calc loads

Expand Down Expand Up @@ -169,7 +189,7 @@ anlz_dps_facility <- function(fls){

# TN attenuation varies
# 95% for st pete coastsid
# 90% for those in thcoastid (Van Dyke, Polk SW, Polk NW, Zephyrhills, Pinellas WEDunn, SouthCross (outside of RA), MacDill, Manatee North Reg, Manatee SE Reg, Largo, HillsCoSouthCo_SW, HillsCoSouthCo_LA)
# 90% for those in thcoastid (Van Dyke, Polk SW, Polk NW, Zephyrhills, Pinellas WEDunn, SouthCross (outside of RA), MacDill, Manatee North Reg, Manatee SE Reg, Largo, HillsCoSouthCo_SW, HillsCoSouthCo_LA), added pasco manually
# 70% all others
thcoastid <- c("D_HC_002", "D_PK_001", "D_PK_002", "D_PA_001", "PINNW", "SCROSSB", "D_HC_12",
"D_MC_1", "D_MC_4", "D_PC_9", "D_HC18D1", "D_HC18D2")
Expand All @@ -178,7 +198,8 @@ anlz_dps_facility <- function(fls){
dplyr::mutate(
load_kg = dplyr::case_when(
permit %in% 'STPETE' & var == 'tn_mgl'~ load_kg * 0.05, # 95% reduction
coastid %in% thcoastid & var == 'tn_mgl' ~ load_kg * 0.1, # 90% reduction
coastid %in% thcoastid & var == 'tn_mgl' ~ load_kg * 0.1, # 90% reduction,
entity %in% 'Pasco Co.' & var == 'tn_mgl' ~ load_kg * 0.1, # 90% reduction for pasco
(!coastid %in% thcoastid) & (!permit %in% 'STPETE') & var == 'tn_mgl' ~ load_kg * 0.3, # 70% reduction
T ~ load_kg
)
Expand Down
13 changes: 13 additions & 0 deletions inst/extdata/ps_dom_pasco_pasco_2021.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Year Month Outfall.ID Total.N Total.P TSS BOD Total.N.Unit Total.P.Unit TSS.Unit BOD.Unit Average.Daily.Flow..ADF...mgd.
2021 1 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 2 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.13824404761905
2021 3 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 4 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.06236111111111
2021 5 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 6 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.06236111111111
2021 7 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 8 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 9 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.06236111111111
2021 10 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946
2021 11 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.06236111111111
2021 12 R-001 9 0 0 0 mg/l mg/l mg/l mg/l 1.02809139784946

0 comments on commit 3102610

Please sign in to comment.