Skip to content

Commit

Permalink
yearly summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Jul 10, 2024
1 parent a5eff1b commit c021ac2
Show file tree
Hide file tree
Showing 3 changed files with 488 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/summarize_yearly.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ summarize_yearly <- function(raster, sub_vect) {
"sum",
"quantile"
),
quantiles = c(0.025, 0.1, 0.25, 0.75, 0.9, 0.975)
quantiles = c(0.025, 0.1, 0.25, 0.75, 0.9, 0.975),
max_cells_in_memory = 1e+07, #to lower RAM usage maybe?
stack_apply = TRUE #slower but less RAM usage maybe?
) |>
tidyr::pivot_longer(everything(), names_sep = "\\.", names_to = c("stat", "year")) |>
tidyr::pivot_wider(names_from = "stat", values_from = "value") |>
Expand Down
11 changes: 9 additions & 2 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library(quarto) #only required for rendering reports
controller_local <-
crew::crew_controller_local(
name = "local",
workers = 4, # max workers
workers = 3, # max workers
seconds_idle = 60, # how long a worker can be doing nothing before it is shut down
local_log_directory = "logs"
)
Expand Down Expand Up @@ -104,7 +104,7 @@ target_yearly_summary <- tar_plan(
),
tar_file(
summary_yearly_csv,
tar_write_csv(summary_yearly, "output/yearly/")
tar_write_csv(summary_yearly, "output/yearly/yearly_summary.csv")
)
)

Expand Down Expand Up @@ -286,3 +286,10 @@ list(

render
)


# Product comparison ------------------------------------------------------

# re-project to common CRS and resolution and calculate pixel-wise standard
# deviation across products to get a sense of how variation ("disagreement")
# varies spatially
Loading

0 comments on commit c021ac2

Please sign in to comment.