Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine viz pattern #8

Merged
merged 12 commits into from
May 10, 2022
Merged

Refine viz pattern #8

merged 12 commits into from
May 10, 2022

Conversation

padilla410
Copy link
Collaborator

This PR completes the mapping portion of the targets pipeline for the NAWQA Pesticide National Synthesis Project.

Building the pipeline creates two major families of outputs for each of the 2019 pesticides of interest:

  1. GeoTIFFs for high and low pesticide estimates
  2. Map pngs that roughly match the existing maps (example).

There is probably some refinement of the final images that will happen, but I intend to hold off until we meet with the WSC folks.

With no pre-existing targets, I expect this pipeline to take ~80 min to run.

@padilla410 padilla410 requested a review from cnell-usgs May 6, 2022 20:00
Copy link
Collaborator

@cnell-usgs cnell-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice. The structure of this made sense to me based on my understanding of the data, and what the moving parts are. I was able to build the entire pipeline in 160 mins:
image

The longest part of the build was generating the plots, but that seems pretty typical of plotting rasters with ggplot
image

In your create_pest_raster function you can clean up the commented out code creating cellkg since it is used a couple lines later.

I also might combine a few steps in create_pest_raster that are applied to cellkg rather than writing over the same-named object.

cellkg <- as.data.frame(us_raster) %>%
    rename(ID = 1) %>%
    left_join(dbf_data) %>% 
    dplyr::pull({{ cellkg_column }})

3_visualize/src/create_pest_map.R Show resolved Hide resolved
3_visualize/src/create_pest_map.R Show resolved Hide resolved
1_fetch.R Outdated Show resolved Hide resolved
3_visualize/src/create_pest_map.R Show resolved Hide resolved
3_visualize/src/create_pest_map.R Show resolved Hide resolved
_targets.R Show resolved Hide resolved
@padilla410
Copy link
Collaborator Author

First, thank you for a great set of comments/critiques. Second, because of some timeline stuff, I am going address comments that seems quick and easy within this PR and anything more time consuming will have an issue opened for the next round of work.

@padilla410 padilla410 merged commit 1304b2c into USGS-R:main May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants