Open glenncampagna opened 1 year ago
runid_11
: 2020 demand scenario
runid_13
: 2040 demand scenario
runid_14
: Median climate change scenario (50/50) -- 2020 demand
runid_15
: Dry climate change scenario (10/10) -- 2020 demand
runid_16
: Wet climate change scenario (90/90) -- 2020 demand
runid_17
: Dry climate change scenario (10/10) -- 2040 demand
runid_19
: Median climate change scenario (50/50) -- 2040 demand
runid_20
: Wet climate change scenario (90/90) -- 2040 demand
*CC scenarios for year 2055Example:
RU4_5640_6030
(Rapp. near Culpeper) w/ ws_model_summary.Rmd
2020 vs 2040: point source flow in grows by a factor > 2 (aligns w/ expected population growth in the region)
2020 vs Dry Climate: mean outflow decreases and large decrease in L90 & L30EasyMapGen.R
Glenn having R crash when running line 128 to create seglist
seglist <- ds$get('dh_feature', config=list(ftype='vahydro',bundle='watershed'))
Also gives error/output: No encoding supplied: defaulting to UTF-8
Megan gets the same error with fn_extract_basin() in line 131 as when trying to run Rob's watershed extraction mapping script:
app_segs <- fn_extract_basin(seglist, 'JL4_6520_6710')
Error in fn_ALL.upstream(end_seg, AllSegList) :
object 'AllSegList' not found
Ella does not get a specific error at any line anymore, but the .png of the map does not seem to have been formed.
Megan was able to generate a map .png after adding the following code chunk above line 131
, and changing the fpath
so that it exports locally. Neither Ella nor Glenn needed to explicitly set the AllSegList
.
## Example Code to get AllSegList
# Download and Import csv with all river segments (copy commented lines below)
localpath <- tempdir()
filename <- paste("vahydro_riversegs_export.csv",sep="")
destfile <- paste(localpath,filename,sep="\\")
download.file(paste(site,"/vahydro_riversegs_export",sep=""), destfile = destfile, method = "libcurl")
RSeg.csv <- read.csv(file=paste(localpath , filename,sep="\\"), header=TRUE, sep=",")
AllSegList <- substring(RSeg.csv$hydrocode, 17)
Ella was able to generate a map .png after adding library(rgeos)
and changing the fpath
to export locally. Neither Megan nor Glenn needed to load rgeos
.
Glenn was able to generate a map .png after updating his R version to 4.3.0 (However, Ella is using R 4.1.2 and Megan is using R 4.1.3). Glenn can now also render the summary .rmd with his updated R.
Region identification and include localities within
Framing text describing how document should be used per regulatory requirements
Regional coverage maps and tables: 2020 vs 2040 demand scenarios Maps likely @ watershed scale w/ regional planning boundary shown Table accompanying map (facility, source, location, permitted capacity) Table of unmet demands 2040 Dry climate vs differential climate scenario Table w/ riversegs expected to decrease flow (< -10%?)
Locality focus
Regional appendix for things not suited for more brief sections above
The change in metrics (L90, 7Q10) as a percentile will be useful (state plan does this)
more to come from us based on ideas from @gmahadwar
## Example Code to get AllSegList
# Download and Import csv with all river segments (copy commented lines below)
localpath <- tempdir()
filename <- paste("vahydro_riversegs_export.csv",sep="")
destfile <- paste(localpath,filename,sep="\\")
download.file(paste(site,"/vahydro_riversegs_export",sep=""), destfile = destfile, method = "libcurl")
RSeg.csv <- read.csv(file=paste(localpath , filename,sep="\\"), header=TRUE, sep=",")
AllSegList <- substring(RSeg.csv$hydrocode, 17)
#get upstream river segs
riv.seg <- "JA4_7280_7340" # !! user input
upstr <- fn_upstream(riv.seg, AllSegList)
[1] "JA1_7640_7280" "JA2_7550_7280"
upstr.df <- data.frame(matrix(nrow=0, ncol=ncol(RSeg.csv)))
colnames(upstr.df) <- colnames(RSeg.csv)
for(i in upstr){
row.i <- as.numeric(rownames(RSeg.csv[grep(i, RSeg.csv$hydrocode),]))
upstr.df <- rbind(upstr.df, RSeg.csv[row.i,])
}
for(i in 1:length(upstr)){
#get model run data
rseg.i <- RomFeature$new(ds,list(
hydrocode = upstr.df$hydrocode[i],
ftype = upstr.df$ftype[i],
bundle = upstr.df$bundle[i]),
TRUE)
model.i <- RomProperty$new(ds,list(
featureid = rseg.i$hydroid,
entity_type = 'dh_feature',
propcode = "vahydro-1.0"), #all climate change scenarios are under vahydro-1.0... can we keep this hard-coded?
TRUE)
model.i_url_base <- paste(site, 'node/62', sep = "/")
model.i_obj_url <- paste(model.i_url_base, model.i$pid, sep = "/")
model.i_info <- ds$auth_read(model.i_obj_url, "text/json", "")
model.i_info <- jsonlite::fromJSON(model.i_info)
assign(paste0(upstr[i], "_model"), model.i_info)
}
JA4_7280_7340
, are both JA2_7550_7280
and JA1_7640_7280
directly upstream? runid_15
) vs. Median CC (runid_14
) vs. Wet CC (runid_16
)JA1_7640_7280
:
JA4_7280_7340
:
maptype = "terrain"
)ggmap 3.0.0:
basemap_toner <- get_map(source = "stamen", maptype = "toner", color=c("color"), location = ggmap_bbox, zoom = 12)
ggmap 3.0.2:
basemap_toner <- get_map(source = "stamen", maptype = "toner", color=c("color"), location = ggmap_bbox, zoom = 12)
ggmap 3.0.2:
basemap_toner <- get_map(source = "stamen", maptype = "terrain", color=c("color"), location = ggmap_bbox, zoom = 12)
Questions on Mapping
These are based on the EasyMapGen.R
file
mapgen
function creation vs outlet_point
later on(how do we find the right coords)?fn_extract_basin
riverseg valueThought it may be cool to vary the size of the facility points depending on their consumption. We can also compare different runid's, but you can't see much of a difference unless the metric varies drastically. Below you can at least tell that they overlap because the points on the map become orange.
If the point sizes look too much like they correspond with facility area, then we could also have the point colors vary with a gradient.
This is done with a new Rmd called mapping_workflow.Rmd
. I tried to format the workflow so that different metrics and runid's can be passed in. I'm not sure if the unmet demands statistics are calculated for each facility, but those may be a cool way to draw attention to facilities that are most in need of supply plan revisions.
Way cool!
Durelle Scott, Associate Professor and Associate Department Head for Undergraduate Studies
Virginia Tech | Biological Systems Engineering Blacksburg, VA 24061 (540) 231-2449 | @.***
From: megpritch @.> Sent: Friday, June 2, 2023 3:29:27 PM To: HARPgroup/HARParchive @.> Cc: Scott, Durelle @.>; Assign @.> Subject: Re: [HARPgroup/HARParchive] Week of 5/30/23 (Issue #872)
Mapping Update
Thought it may be cool to vary the size of the facility points depending on their consumption. We can also compare different runid's, but you can't see much of a difference unless the metric varies drastically. Below you can at least tell that they overlap because the points on the map become orange.
This is done with a new Rmd called mapping_workflow.Rmd. I tried to format the workflow so that different metrics and runid's can be passed in. I'm not sure if the unmet demands statistics are calculated for each facility, but those may be a cool way to draw attention to facilities that are most in need of supply plan revisions.
[image]https://user-images.githubusercontent.com/104520247/242972040-3ef47ad6-7923-4a1d-86e9-133497480f6f.png [image] https://user-images.githubusercontent.com/104520247/242972108-bf55022f-fa1b-454d-9309-6de6612551b9.png
— Reply to this email directly, view it on GitHubhttps://github.com/HARPgroup/HARParchive/issues/872#issuecomment-1574215052, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC4K425VLWOOBQLL52OZRILXJI5JPANCNFSM6AAAAAAYUBZRC4. You are receiving this because you were assigned.Message ID: @.***>
@megpritch This looks really great and the sizing was on our wishlist for a while now! Can't wait to dive in next week.
852 & #853
From 5/30 Meeting:
ws_model_summary.Rmd
is already set up to pull data from thesevahydro-1.0
models or not. You should be able to pull in the metrics no problemEasyMapGen.R
for now (deep dive into mapping to come later), see #856ws_model_summary.Rmd
, iterating & comparing to first model suppliedexport_path
if the variable exists inWSP_basemap.R
(export_path
set in each of ourconfig.local.private
)