Page MenuHomec4science

create_regions.sh
No OneTemporary

File Metadata

Created
Wed, Apr 30, 14:38

create_regions.sh

#!/bin/bash
##== User input
REGION_CONTROL_FILE=/scratch/walch/grassgis/files/CH_split_region_16.txt
LOCATION=CH_LV03
DOM_RESOLUTION=2
DOM=DOM_2m
GRASS_DATABASE=/scratch/walch/grassgis
## == Specify here the needed modules
module purge
module use /ssoft/playground/rmsilva/spack/share/spack/lmod/linux-rhel7-x86_E5v4_Mellanox/openblas/0.2.20-3jwiins/gcc/6.4.0/
module load gcc python/2.7.14 grass
## == Main loop
echo STARTING AT $(date)
echo
LOCATION_PATH=$GRASS_DATABASE\/$LOCATION
while read REGION_ID NORTH SOUTH EAST WEST; do
MAP_NAME=region_$REGION_ID
echo Trying to open location $LOCATION_PATH\/$MAP_NAME
grass74 -c -e $LOCATION_PATH\/$MAP_NAME --exec g.region -p n=$NORTH s=$SOUTH e=$EAST w=$WEST res=$DOM_RESOLUTION zoom=$DOM align=$DOM save=$MAP_NAME --overwrite
done < $REGION_CONTROL_FILE
echo
echo FINISHED AT $(date)

Event Timeline