Skip to content
Snippets Groups Projects
Commit ccbc008c authored by Francesco Sabatini's avatar Francesco Sabatini
Browse files

aligned cluster functions

parent 2316c845
Branches
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA, ...@@ -37,6 +37,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA,
} }
print("myfunction defined as") print("myfunction defined as")
myfunction <- get(myfunction)
print(myfunction) print(myfunction)
print("go parallel") print("go parallel")
...@@ -53,7 +54,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA, ...@@ -53,7 +54,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA,
} else { } else {
out <- sp::over(x=header.shp, y=mypredictor) out <- sp::over(x=header.shp, y=mypredictor)
toassign <- header.shp[which(is.na(out[,1])),] toassign <- header.shp[which(is.na(out[,1])),]
print(paste(length(toassign), "plots not matched directely - seek for NN")) print(paste(length(toassign), "plots not matched directly - seek for NN"))
if(length(toassign)>0){ if(length(toassign)>0){
nearest <- foreach(i=1:length(toassign), .packages=c('raster'), .combine=rbind) %dopar% { nearest <- foreach(i=1:length(toassign), .packages=c('raster'), .combine=rbind) %dopar% {
......
#!/bin/bash
#$ -S /bin/bash
#$ -N PredictorExtract
#$ -o /work/$USER/$JOB_NAME-$JOB_ID-$TASK_ID.log
#$ -j y
#$ -l h_rt=00:30:00:00
#$ -l h_vmem=1G
#$ -pe smp 5-32
#$ -cwd
#$ -t 1-99
module load GCC/8.3.0
module load OpenMPI/3.1.4
module load R/3.6.2
filename="$1"
shift
output=/data/splot/_data_splot3/output_pred/$(basename $filename .shp)-$SGE_TASK_ID.csv
Rscript \
cli_A98.r \
--cores ${NSLOTS:-1} \
--typp "shp" \
--chunk.i "$SGE_TASK_ID" \
--chunkn 99 \
/data/splot/_data_splot3/header.shp.shp \
robust.mean \
"$output" \
"$filename"
...@@ -18,15 +18,15 @@ module load R ...@@ -18,15 +18,15 @@ module load R
filename="$1" filename="$1"
shift shift
output=/data/splot/_data_splot3/output_pred/$(basename $"filename" .shp)_sd.csv output=/data/splot/_data_splot3/output_pred/$(basename $filename .tif)_sd.csv
Rscript \ Rscript \
cli_A98.r \ cli_A98.r \
--cores $"{NSLOTS:-1}" \ --cores ${NSLOTS:-1} \
--typp "raster" \ --typp "shp" \
--chunk.i 1 \ --chunk.i 1 \
--chunkn 1 \ --chunkn 1 \
/data/splot/_data_splot3/header.shp.shp \ /data/splot/_data_splot3/header.shp.shp \
robust.sd \ "NA" \
"$output" \ "$output" \
"$filename" "$filename"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment