Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111545786
exec_panel_fitting_batch_both.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 3, 04:01
Size
2 KB
Mime Type
text/x-shellscript
Expires
Mon, May 5, 04:01 (2 d)
Engine
blob
Format
Raw Data
Handle
25915272
Attached To
R8797 solarPV
exec_panel_fitting_batch_both.sh
View Options
#!/bin/bash
## ====== Settings
#SBATCH --account=cadmos
#SBATCH --job-name=panel_fit
#SBATCH --nodes=1
#SBATCH --mem=32G
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --time=05:00:00
#SBATCH --partition=serial
#SBATCH --workdir ./output
#SBATCH --mail-type=ALL
#SBATCH --mail-user=alina.walch@epfl.ch
#SBATCH --array=1-97
#SBATCH -o panel_fit_%A_%a.out # Standard output
#SBATCH -e panel_fit_%A_%a.err # Standard error
echo STARTING AT $(date)
## == Specify here the needed modules and the virtual env
source deactivate
#module purge
#module load gcc python/3.6.5 --> conda has the python installation!
source activate py3_all
## ====== Get slurm array ID
N=${SLURM_ARRAY_TASK_ID}
echo Slurm array task ID: $N
echo
## == Specify here the commands to execute
###### INPUTS ########
CITY=vesenaz
WORKDIR=/scratch/walch/pv_linking/files_avail_area/$CITY
SCRIPT_FP=~/code/solarPV_identification/Available_area/panel_fitting_batch_new.py
POSTPROC_FP=~/code/solarPOT/Panel_fitting/postprocess_panelled_area.py
# TOTAL NUMBER OF ROOFTOP SHAPES: 9,640,000
# this makes 97 batches of size 100,000
BATCH_ID=0 ## `expr $N - 1`
BATCH_SIZE=100000
ROOF_FILE=/scratch/walch/pv_linking/files_avail_area/Avail_area_caseStudy/$CITY\_avail_area_roofs/$CITY\_avail_area_roofs.shp
## HORIZONTAL
HORIZ_DIR=$WORKDIR\/panel_stats_horizontal
VERTI_DIR=$WORKDIR\/panel_stats_vertical
OUT_DIR=$WORKDIR\/panel_stats_best
PANEL_WIDTH_H="1.6"
PANEL_HEIGHT_H=1
mkdir $WORKDIR
mkdir $HORIZ_DIR
mkdir $VERTI_DIR
mkdir $OUT_DIR
## Run. Argument to pass (in order): reference file, target file
echo Executing python script
python $SCRIPT_FP $ROOF_FILE $HORIZ_DIR $BATCH_ID $BATCH_SIZE $PANEL_WIDTH_H $PANEL_HEIGHT_H
## VERTICAL
PANEL_WIDTH_V=$PANEL_HEIGHT_H
PANEL_HEIGHT_V=$PANEL_WIDTH_H
## Run. Argument to pass (in order): reference file, target file
echo Executing python script
python $SCRIPT_FP $ROOF_FILE $VERTI_DIR $BATCH_ID $BATCH_SIZE $PANEL_WIDTH_V $PANEL_HEIGHT_V
## POSTPROCESS
echo Executing postprocessing
HORIZ_STAT=$HORIZ_DIR\/panelled_area_stats_$BATCH_ID\.csv
VERTI_STAT=$VERTI_DIR\/panelled_area_stats_$BATCH_ID\.csv
BEST_STAT=$OUT_DIR\/panelled_area_stats_$BATCH_ID\.csv
python $POSTPROC_FP $HORIZ_STAT $VERTI_STAT $BEST_STAT PANELS_$BATCH_ID\.shp
source deactivate
echo FINISHED AT $(date)
Event Timeline
Log In to Comment