Outbreak Maps

Map cumulative case detections across all iterations by scenario

Central U.S. Maps

Prepare to plot outbreak maps for the central region. First, get shapefile for the conterminous U.S. and set state boundaries for regional scenario. Then, create a raster grid version.

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 Central U.S.
central_states <- c("Alabama", "Arkansas", "Illinois", "Indiana", "Iowa",         "Kansas", "Kentucky", "Louisiana", "Michigan", "Minnesota", "Mississippi", "Missouri", "Nebraska", "New York", "North Dakota", "Ohio", "Oklahoma", "Pennsylvania", "South Dakota", "Tennessee", "Texas", "West Virginia", "Wisconsin")

central_us <- subset(whole_us, whole_us$STATE_NAME %in% central_states)

Create Raster Grid

Create a raster grid version for the central region

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

central_r  <- rasterize(central_us, tmp_r)

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

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
central_path <- sprintf("%s/outputs_%s", generic_path, "central")

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

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

## Smooth raster
count_events <- smooth_raster(count_events)

Central U.S. Outbreak Maps

plot_raster_stack() will plot the rasters for comparison. Plot cumulative case detections across optimal and suboptimal detection scenarios.

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

stack_set <- plot_raster_stack(no_low_virulence, central_us)

stack_set

Plot cumulative case detections for low-virulence scenario

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

lv_set <- plot_raster_stack(only_low_virulence, central_us)

lv_set

Eastern U.S. Maps

Prepare to plot outbreak maps for the eastern region. First, set state boundaries for regional scenario. Then, create a raster grid version.

Region Boundaries

Subset to region

Code
## Boundaries for Eastern U.S.
eastern_states <- c("Alabama", "Arkansas", "Connecticut", "Delaware", "Florida", "Georgia", "Illinois", "Indiana", "Iowa", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "New Hampshire", "New Jersey", "New York", "North Carolina", "Ohio", "Pennsylvania", "Rhode Island", "South Carolina", "Tennessee", "vermont", "Virginia", "West Virginia", "Wisconsin")

eastern_us <- subset(whole_us, whole_us$STATE_NAME %in% eastern_states)

Create Raster Grid

Create a raster grid version for the eastern 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

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
eastern_path <- sprintf("%s/outputs_%s", generic_path, "eastern")

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

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

## Smooth raster
count_events <- smooth_raster(count_events)

Eastern U.S. Outbreak Maps

plot_raster_stack() will plot the rasters for comparison. Plot cumulative case detections across optimal and suboptimal detection scenarios.

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

stack_set <- plot_raster_stack(no_low_virulence, eastern_us)

stack_set

Plot cumulative case detections for low-virulence scenario

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

lv_set <- plot_raster_stack(only_low_virulence, eastern_us)

lv_set