HARPgroup / HARParchive

This repo houses HARP code development items, resources, and intermediate work products.
1 stars 0 forks source link

Week of 5/30/23 #872

Open glenncampagna opened 1 year ago

glenncampagna commented 1 year ago

From 5/30 Meeting:

glenncampagna commented 1 year ago

Vahydro runIDs connection to demand and climate change scenarios

Example:

glenncampagna commented 1 year ago

Trying to generate maps with EasyMapGen.R

glenncampagna commented 1 year ago

General plan for summary documents we'll be providing localities

more to come from us based on ideas from @gmahadwar

megpritch commented 1 year ago

Pulling Upstream Segment Models

## 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)
}
glenncampagna commented 1 year ago

Question about segment naming & upstream segments

glenncampagna commented 1 year ago

CC scenario comparison -- impacts on Upstream vs. Downstream segments

jdkleiner commented 1 year ago

ggmap()

ggmap 3.0.0: basemap_toner <- get_map(source = "stamen", maptype = "toner", color=c("color"), location = ggmap_bbox, zoom = 12) Picture1

ggmap 3.0.2: basemap_toner <- get_map(source = "stamen", maptype = "toner", color=c("color"), location = ggmap_bbox, zoom = 12) Picture2

ggmap 3.0.2: basemap_toner <- get_map(source = "stamen", maptype = "terrain", color=c("color"), location = ggmap_bbox, zoom = 12) Picture3

EllaF21 commented 1 year ago

Questions on Mapping

These are based on the EasyMapGen.R file

megpritch commented 1 year ago

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.

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.

image image
durelles commented 1 year ago

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: @.***>

rburghol commented 1 year ago

@megpritch This looks really great and the sizing was on our wishlist for a while now! Can't wait to dive in next week.