okay
This commit is contained in:
parent
ea38c952ba
commit
3f7043199b
|
|
@ -32,7 +32,6 @@ public function __construct(Project $project,Carbon $date,int $offset)
|
||||||
*/
|
*/
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
|
|
||||||
$command = [
|
$command = [
|
||||||
sprintf('%supdate_RDS.sh', base_path('../')),
|
sprintf('%supdate_RDS.sh', base_path('../')),
|
||||||
sprintf('--end_date=%s', $this->date->format('Y-m-d')),
|
sprintf('--end_date=%s', $this->date->format('Y-m-d')),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# nolint start: commented_code_linter, line_length_linter,object_usage_linter.
|
||||||
library(here)
|
library(here)
|
||||||
library(sf)
|
library(sf)
|
||||||
library(terra)
|
library(terra)
|
||||||
|
|
@ -54,7 +55,7 @@ daily_vrt <- here(data_dir, "vrt")
|
||||||
harvest_dir <- here(data_dir, "HarvestData")
|
harvest_dir <- here(data_dir, "HarvestData")
|
||||||
|
|
||||||
source("parameters_project.R")
|
source("parameters_project.R")
|
||||||
source("utils_2.R")
|
source("ci_extraction_utils.R")
|
||||||
|
|
||||||
dir.create(here(laravel_storage_dir))
|
dir.create(here(laravel_storage_dir))
|
||||||
dir.create(here(data_dir))
|
dir.create(here(data_dir))
|
||||||
|
|
@ -181,7 +182,7 @@ pivot_select_model_Data_2024 <- harvesting_data %>% filter(year == 2024)%>% filt
|
||||||
# pivots_dates_Data_2024 <- pivots_dates0 %>% filter(!is.na(season_start_2024))
|
# pivots_dates_Data_2024 <- pivots_dates0 %>% filter(!is.na(season_start_2024))
|
||||||
# pivot_select_model_Data_2024 <- unique(pivots_dates_Data_2024$pivot_quadrant)
|
# pivot_select_model_Data_2024 <- unique(pivots_dates_Data_2024$pivot_quadrant)
|
||||||
|
|
||||||
extract_CI_data <- function(field_names, harvesting_data, field_CI_data, season) {
|
extract_CI_data <- function(field_names, harvesting_data, field_CI_data, season) { # nolint: line_length_linter.
|
||||||
# field_names = "AG1D06P"
|
# field_names = "AG1D06P"
|
||||||
# field_names = "1.13A"
|
# field_names = "1.13A"
|
||||||
# harvesting_data = harvesting_data
|
# harvesting_data = harvesting_data
|
||||||
|
|
@ -214,7 +215,7 @@ extract_CI_data <- function(field_names, harvesting_data, field_CI_data, season)
|
||||||
}
|
}
|
||||||
|
|
||||||
## Extracting the correct CI values
|
## Extracting the correct CI values
|
||||||
# Data_2021 <- map(pivot_select_model_Data_2021, ~ extract_CI_data(.x, harvesting_data = harvesting_data, field_CI_data = pivot_stats_long, season = 2021)) %>% list_rbind()
|
# Data_2021 <- map(pivot_select_model_Data_2021, ~ extract_CI_data(.x, harvesting_data = harvesting_data, field_CI_data = pivot_stats_long, season = 2021)) %>% list_rbind() # nolint: line_length_linter.
|
||||||
# message('2021')
|
# message('2021')
|
||||||
# Data_2022 <- map(pivot_select_model_Data_2022, ~ extract_CI_data(.x, harvesting_data = harvesting_data, field_CI_data = pivot_stats_long, season = 2022)) %>% list_rbind()
|
# Data_2022 <- map(pivot_select_model_Data_2022, ~ extract_CI_data(.x, harvesting_data = harvesting_data, field_CI_data = pivot_stats_long, season = 2022)) %>% list_rbind()
|
||||||
# message('2022')
|
# message('2022')
|
||||||
|
|
@ -238,4 +239,4 @@ message('show head')
|
||||||
|
|
||||||
saveRDS(CI_all, here(cumulative_CI_vals_dir,"All_pivots_Cumulative_CI_quadrant_year_v2.rds"))
|
saveRDS(CI_all, here(cumulative_CI_vals_dir,"All_pivots_Cumulative_CI_quadrant_year_v2.rds"))
|
||||||
message('rds saved')
|
message('rds saved')
|
||||||
|
# nolint end
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ echo "offset: $offset"
|
||||||
|
|
||||||
# Check if required arguments are set
|
# Check if required arguments are set
|
||||||
if [ -z "$end_date" ] || [ -z "$project_dir" ] || [ -z "$offset" ]; then
|
if [ -z "$end_date" ] || [ -z "$project_dir" ] || [ -z "$offset" ]; then
|
||||||
echo "Missing arguments. Use: build_RDS.sh --end_date=2024-01-01 --offset=7 --project_dir=chemba"
|
echo "Missing arguments. Use: update_RDS.sh --end_date=2024-01-01 --offset=7 --project_dir=chemba"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue