Outbreak Maps

Map cumulative case detections across all iterations by scenario

Create Raster Grids

Prepare to plot outbreak maps. First, get shapefile and set region boundaries. Then, create a raster grid version. Code demonstrates the workflow for the Eastern U.S. region. Outbreak maps for the Central U.S. are included below.

Region Boundaries

Get shapefile and subset to region

Code
## Get shapefile for conterminous U.S.
whole_us <- vect(here("script-inputs/shapefile/Contiguous_USA_for Regional_Model.shp")) 

## Boundaries for eastern U.S.
eastern_us <- subset(whole_us, whole_us$SUB_REGION %in% 
                       c("East North Central", "East North Central", 
                         "East South Central", "east South Central",
                         "New England", "Middle Atlantic", "South Atlantic"))

Create Raster Grid

Create a raster grid version for each region

Code
tmp_r <- rast(ext(eastern_us), 
              resolution = 25000, # 25km grid
              crs = crs(eastern_us))

east_r  <- rasterize(eastern_us, tmp_r)

east_r[east_r == 1] <- 0 # set land areas to 0

Cumulative Cases

Count Cumulative Case Detections

raster_point_counts() will count the number of detection events in each 25km cell. Smoothing the raster will improve the appearance by making the cells smaller and finding averages of surrounding cells.

Code
## Extract file paths to data
regional_path <- sprintf("%s/outputs_%s", generic_path, "eastern")

region_paths <- list.files(path = here(regional_path),
                            recursive = T, pattern= "Outputs_Detection", full.names=TRUE)

## Count events
count_events <- raster_point_counts(region_paths, # paths to files
                                    reference, # coordinate references
                                    east_r) # raster defining grid

## Smooth raster
count_events <- smooth_raster(count_events)

Plot Cumulative Case Detections

plot_raster_stack() will plot the rasters for comparison.

Code
no_low_virulence <- subset(count_events, 
                           !(names(count_events) %in% "low-virulence/6-days-preclinical"))

only_low_virulence <- subset(count_events, 
                            names(count_events) %in% "low-virulence/6-days-preclinical")

Eastern U.S. Maps

Compare outbreak maps across optimal and suboptimal detection scenarios

Code
stack_set <- plot_raster_stack(no_low_virulence, eastern_us)

stack_set

View map of cumulative cases for low-virulence scenario

Code
lv_set <- plot_raster_stack(only_low_virulence, eastern_us)

lv_set

Central U.S. Maps

Compare outbreak maps across optimal and suboptimal detection scenarios

Code
stack_set <- plot_raster_stack(no_low_virulence, central_us)

stack_set

View map of cumulative cases for low-virulence scenario

Code
lv_set <- plot_raster_stack(only_low_virulence, central_us)

lv_set