diff --git a/code/A98_PredictorsExtract.R b/code/A98_PredictorsExtract.R index b13dd91afc9806dbdf420fc3ccac4f97976d37f5..7af6d9fed6faeb13a76fb141d90fd05f6b86ec20 100644 --- a/code/A98_PredictorsExtract.R +++ b/code/A98_PredictorsExtract.R @@ -37,6 +37,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA, } print("myfunction defined as") + myfunction <- get(myfunction) print(myfunction) print("go parallel") @@ -53,7 +54,7 @@ PredExtr <- function(x.shp, myfunction=NA, output=NA, } else { out <- sp::over(x=header.shp, y=mypredictor) 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){ nearest <- foreach(i=1:length(toassign), .packages=c('raster'), .combine=rbind) %dopar% { diff --git a/code/submit-A98-array.sh b/code/submit-A98-array.sh new file mode 100644 index 0000000000000000000000000000000000000000..fc226854de76656621c43c475925f1afc6434418 --- /dev/null +++ b/code/submit-A98-array.sh @@ -0,0 +1,37 @@ +#!/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" diff --git a/code/submit-A98.sh b/code/submit-A98.sh index 645049079fd9c9ecec42ab54dc836379be74ba49..8f5550fa6aedccb5c346aa460d88f84e6076bef0 100644 --- a/code/submit-A98.sh +++ b/code/submit-A98.sh @@ -18,15 +18,15 @@ module load R filename="$1" 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 \ cli_A98.r \ - --cores $"{NSLOTS:-1}" \ - --typp "raster" \ + --cores ${NSLOTS:-1} \ + --typp "shp" \ --chunk.i 1 \ --chunkn 1 \ /data/splot/_data_splot3/header.shp.shp \ - robust.sd \ + "NA" \ "$output" \ "$filename"