Skip to content

Commit

Permalink
Merge pull request #92 from eco4cast/stac-update
Browse files Browse the repository at this point in the history
Update stac functions
  • Loading branch information
jzwart authored Sep 10, 2024
2 parents 3df4588 + 946d5f5 commit fc387fa
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
15 changes: 14 additions & 1 deletion catalog/forecasts/forecast_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,17 @@ for (i in 1:length(config$variable_groups)){ ## organize variable groups
model_keywords <- c(list('Forecasts',config$project_id, names(config$variable_groups)[i], m, var_name_full[j], var_name, duration_value, duration_name),
as.list(model_sites$site_id))

## build radiantearth stac and raw json link
stac_link <- paste0('https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/forecasts/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

json_link <- paste0('https://raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/forecasts/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

stac4cast::build_model(model_id = m,
stac_id = stac_id,
team_name = registered_model_id$`Long name of the model (can include spaces)`[idx],
Expand All @@ -338,7 +349,9 @@ for (i in 1:length(config$variable_groups)){ ## organize variable groups
table_description = forecast_description_create,
full_var_df = model_vars,
code_web_link = model_code_link,
model_keywords = model_keywords)
model_keywords = model_keywords,
stac_web_link = stac_link,
raw_json_link = json_link)

} ## end model loop
} ## end duration loop
Expand Down
15 changes: 14 additions & 1 deletion catalog/scores/scores_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,17 @@ for (i in 1:length(config$variable_groups)){ # LOOP OVER VARIABLE GROUPS -- BUIL
model_keywords <- c(list('Scores',config$project_id, names(config$variable_groups)[i], m, var_name_full[j], var_name, duration_value, duration_name),
as.list(model_sites$site_id))

## build radiantearth stac and raw json link
stac_link <- paste0('https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/scores/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

json_link <- paste0('https://raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/scores/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

stac4cast::build_model(model_id = m,
stac_id = stac_id,
team_name = registered_model_id$`Long name of the model (can include spaces)`[idx],
Expand All @@ -331,7 +342,9 @@ for (i in 1:length(config$variable_groups)){ # LOOP OVER VARIABLE GROUPS -- BUIL
table_description = scores_description_create,
full_var_df = model_vars,
code_web_link = model_code_link,
model_keywords = model_keywords)
model_keywords = model_keywords,
stac_web_link = stac_link,
raw_json_link = json_link)
} ## end model loop

} ## end duration loop
Expand Down
15 changes: 14 additions & 1 deletion catalog/summaries/summaries_models.R
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ for (i in 1:length(config$variable_groups)){ # LOOP OVER VARIABLE GROUPS -- BUIL
model_keywords <- c(list('Summaries',config$project_id, names(config$variable_groups)[i], m, var_name_full[j], var_name, duration_value, duration_name),
as.list(model_sites$site_id))

## build radiantearth stac and raw json link
stac_link <- paste0('https://radiantearth.github.io/stac-browser/#/external/raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/summaries/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

json_link <- paste0('https://raw.githubusercontent.com/eco4cast/usgsrc4cast-ci/main/catalog/summaries/',
names(config$variable_groups)[i],'/',
var_formal_name, '/models/',
m,'.json')

stac4cast::build_model(model_id = m,
stac_id = stac_id,
team_name = registered_model_id$`Long name of the model (can include spaces)`[idx],
Expand All @@ -325,7 +336,9 @@ for (i in 1:length(config$variable_groups)){ # LOOP OVER VARIABLE GROUPS -- BUIL
table_description = summaries_description_create,
full_var_df = model_vars,
code_web_link = model_code_link,
model_keywords = model_keywords)
model_keywords = model_keywords,
stac_web_link = stac_link,
raw_json_link = json_link)

} ## end model loop

Expand Down

0 comments on commit fc387fa

Please sign in to comment.