DOI-USGS / lake-temperature-model-prep

Pipeline #1
Other
6 stars 13 forks source link

Troubleshooting Iowa Data #321

Closed padilla410 closed 2 years ago

padilla410 commented 2 years ago

This PR closes #286, #316, #161

Verification of changes to address #286

I manually added spatial information to Iowa_Lake_Locations.csv based on an email from Grace Wilkinson.

This snippet verifies that the new lakes were correctly added to Iowa_lake_pts_sf.rds:

iowa_raw_pts <- readr::read_csv(sc_retrieve('1_crosswalk_fetch/in/Iowa_Lake_Locations.csv.ind'))
nrow(iowa_raw_pts)

[1] 140 # this is the expected number of records

image

As part of the process outlined above I discovered that there was duplicate entry for LakeID == 94 in the version of Iowa_Lake_Locations.csv that predates this PR and that I had conflicting entries for lake Name == "Kent Park Lake":

LakeID | Lake Name | County | Zone | UTM (NAD83)_E | UTM (NAD83)_N | STORET ID -- | -- | -- | -- | -- | -- | -- 94 | Kent Park Lake | JOHNSON | 15T | 605610 | 4619828 | 22520005 94 | Pierce Creek Pond | PAGE | 15T | 301205 | 4522705 | 22730001 49 | Kent Park Lake | Johnson | 15T | 605613.7272 | 4619841.193 | 22520005

image

After a little sleuthing, I decided that the record where LakeID == 94 && Lake Name == "Kent Park Lake" in Iowa_Lake_Locations.csv was probably a mistake. This was based on two pieces of evidence:

Lake_ID | Lake_Name | County -- | -- | -- 049 | Kent Park Lake | Johnson 094 | Pierce Creek Lake | Page

To correct this issue I did the following:

Verification of changes to address #316

Verification that the fix for the UTM Zone 14 Iowa crosswalk locations works as intended:

library(scipiper)
library(tidyverse)

iowa_map <- ggplot2::map_data('state') %>% filter(region == 'iowa')
iowa_points <- readRDS(sc_retrieve('1_crosswalk_fetch/out/Iowa_lake_pts_sf.rds.ind'))

ggplot() +
  geom_polygon(data = iowa_map, 
               aes(x = long, y = lat, group = group), 
               color = "black", fill = "transparent") +
  geom_sf(data = iowa_points, aes(color = Zone), size = 3)

image

Verification of changes to address #161

This was a minor fix and can be quickly verified using the diff

Verification of successful scmake('8_viz)

Snapshot of 8_viz/out/lakes_summary_fig.html

image