Skip to content

Commit

Permalink
Updates to manuscript figures / cleaned code
Browse files Browse the repository at this point in the history
Final updates to manuscript figures and push for release
  • Loading branch information
maxwellCcook committed Aug 30, 2022
1 parent 9c8d9b7 commit 28e5c8a
Show file tree
Hide file tree
Showing 38 changed files with 59,808 additions and 1,019 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ code/Python/.ipynb_checkpoints
# R code to ignore
code/archive/
code/R/scratch.R
code/R/complexes.R
!*.DS_Store
Code/.DS_Store
.DS_Store
Expand Down
11 changes: 7 additions & 4 deletions code/R/figures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@ source("setup.R")

Bring in the spatial ics-209-plus, ICS+FIRED.

```{r include=F}
```{r include=F, warning=F}
ics.points <- st_read("../../data/spatial/raw/wf-incidents/ics-209-plus-2.0/ics209plus-wf_incidents_spatial_us_1999to2020.gpkg")
ics.fired <- st_read("../../data/spatial/mod/ics-fired/ics209plus_fired_combined.gpkg")
ics.counties <- read_csv("../../data/tabular/mod/ics-spatial/ics_spatial_counties_for_pub.csv", show_col_types=F)
```

## Summary Figures by Regions

State Administrative Units.
State Administrative Units (using shifted Alaska from albersusa package).

```{r, messages=F, warning=F, fig.height=4, fig.width=5.5}
# Read in the formatted CONUS+AK file
library(albersusa,quietly=TRUE)
# states <- st_read("../../../data/boundaries/political/TIGER/tl19_us_states_w_ak_lambert.gpkg")
states <- usa_sf() %>%
rename(STUSPS = iso_3166_2) %>%
Expand All @@ -50,10 +52,10 @@ map1 <- ggplot() +
plot.title = element_text(size=10, hjust=0.2))
map1
# Save it
ggsave(f1, file = "../../figs/Westwide-PLUS_HomeLoss_byIncident_1999to2020.png",
ggsave(map1, file = "../../figures/Westwide-PLUS_HomeLoss_byIncident_1999to2020.png",
width=5.5, height=4, dpi = 350, bg="white") # adjust dpi accordingly
rm(states, state.summary)
rm(states, state.summary, map1)
```

Geographic Area Coordination Centers (GACC).
Expand Down Expand Up @@ -127,6 +129,7 @@ rm(ecol3, eco.summary)
Map structures destroyed and burned area.

```{r fig.height=5, fig.width=5}
map1 <- ggplot() +
geom_sf(data=ics.west.plus%>%filter(STR_DESTROYED_RES_TOTAL==0), color="gray60", size=0.3, alpha=0.9) +
geom_sf(data=states%>%filter(STUSPS %in% states.sub), fill=NA, color="gray20") +
Expand Down
9 changes: 8 additions & 1 deletion code/R/ics-fired.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -840,14 +840,21 @@ rm(r2,lm.fit)
```

Final bind and export.
Add in the FIRED point of origin coordinates. Final bind and export.

```{r}
# Create the master table
events.ics.master_ <- events.ics.master_ %>%
dplyr::select(-c(pred2,pred3,pred4)) %>%
rename(PREDICTED_ACRES = pred5)
# Add in FIRED POO
ig.coords <- st_read("../../../FIRED/data/spatial/raw/conus-ak_to2022_ig_points_wgs.gpkg")
events.ics.master_ <- events.ics.master_ %>%
left_join(ig.coords, by="FIRED_ID")
# Write out the master events data so far
st_write(events.ics.master_, "../../data/spatial/mod/ics-fired/ics209plus_fired_combined.gpkg",
delete_dsn=TRUE)
Expand Down
Loading

0 comments on commit 28e5c8a

Please sign in to comment.