Skip to content

Commit

Permalink
Revert to multisite mapping approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianyu Li committed Mar 8, 2024
1 parent b326828 commit 9136c43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/assim.sequential/R/Analysis_sda_block.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ build.block.xy <- function(settings, block.list.all, X, obs.mean, obs.cov, t) {
PEcAn.logger::logger.warn("The zero variances in Pf is being replaced by one fifth of the minimum variance in those matrices respectively.")
}
#distance calculations and localization
site.locs <- settings %>% map(~.x[['run']] ) %>%
site.locs <- settings$run %>%
purrr::map('site') %>%
purrr::map_dfr(~c(.x[['lon']],.x[['lat']]) %>% as.numeric)%>%
t %>%
Expand Down
4 changes: 2 additions & 2 deletions modules/assim.sequential/R/sda.enkf_MultiSite.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ sda.enkf.multisite <- function(settings,
#Here I'm trying to make a temp config list name and put it into map to iterate
if(multi.site.flag){
conf.settings<-settings
site.ids <- conf.settings %>% map(~.x[['run']] ) %>% purrr::map('site') %>% purrr::map('id') %>% base::unlist() %>% base::as.character()
site.ids <- conf.settings$run %>% purrr::map('site') %>% purrr::map('id') %>% base::unlist() %>% base::as.character()
# a matrix ready to be sent to spDistsN1 in sp package - first col is the long second is the lat and row names are the site ids
site.locs <- conf.settings %>% map(~.x[['run']] ) %>% purrr::map('site') %>% purrr::map_dfr(~c(.x[['lon']],.x[['lat']]) %>% as.numeric)%>%
site.locs <- conf.settings$run %>% purrr::map('site') %>% purrr::map_dfr(~c(.x[['lon']],.x[['lat']]) %>% as.numeric)%>%
t %>%
`colnames<-`(c("Lon","Lat")) %>%
`rownames<-`(site.ids)
Expand Down

0 comments on commit 9136c43

Please sign in to comment.