Yes, we have realized recently that sometimes the output from the tool is not properly formatted for SMOKE’s 20 digits.
We need to add a formatter for the export process. We are looking into it.
Yes, we have realized recently that sometimes the output from the tool is not properly formatted for SMOKE’s 20 digits.
We need to add a formatter for the export process. We are looking into it.
Ok. In the mean time, I made a quick R script to shorten the surrogate ratios. The surrogates now run in SMOKE without a grdmat error.
(postDB is the directory where your post Surrogate Tool DB files are located, SMOKEready is the directory of your formatted output files)Processing: postTool_SMOKEprep.R…
# script to shorten surrogate ratios in AGPRO files from surrogatesTool DB in preparation for SMOKE
library(tidyverse)
options(scipen = 9999)
# # 1.3 km Wasatch Front
griddesc <- "#GRID wf13udaq -1332000.000000 -80000.000000 1333.333333 1333.333333 108 207 1 LAMBERT meters 33.000000 45.000000 -97.000000 -97.000000 40.000000"
files <- list.files("postDB")
for(i in 1:length(files)){
t <- read.table(paste("postDB/",files[i],sep=""),comment.char = "#",header=F,col.names = c("srg","costcy","col","row","val","v1","v2","v3"),sep="\t") %>%
select(srg:val)
t$val <- as.numeric(format(round(as.numeric(t$val),20)))
names(t) <- NULL
fileexport <- paste("SMOKEready/", files[i], sep="")
cat(griddesc,"\n",file= fileexport)
write.table(t,fileexport,sep=" ",append=T,row.names = F)
}
Awesome – great work!