zonal_stats.pbs 1.51 KB
#!/bin/sh
#PBS -N zonal_stats
#PBS -l select=1:ncpus=20:mem=110gb
#PBS -l walltime=20:00:00


. /work/OT/theia/oso/jordi/OTB/otb_superbuild/otb_superbuild-otb_develop-Release-install/config_otb_tf_py35.sh

TERLAB_DIR=/work/OT/theia/oso/shapes/TERLAB/
DPT=31
TILE=T31TCJ
DEM_DIR=/work/OT/theia/oso/sensorsDatas/MNT_S2_N2/S2__TEST_AUX_REFDE2_${TILE}_0001.DBL.DIR
TERLAB_FILE=RPG_TERLAB_DEP${DPT}_2017
TERLAB_ZIP=$TERLAB_DIR/$TERLAB_FILE.7z
TERLAB_SHP=$TERLAB_DIR/SURFACES-2017-PARCELLES-GRAPHIQUES-CONSTATEES_0${DPT}_20180210.shp
MAASSP_DIR=/work/OT/theia/oso/jordi/maassp_data

#7z x $TERLAB_ZIP -aoa -o$TERLAB_DIR
#otbcli_ZonalStatistics -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_MASK.tif -inbv -10000 -inzone.vector.in $TERLAB_SHP -inzone.vector.reproject 1 -out.vector.filename ${MAASSP_DIR}/zonal_stats_mask.shp -ram 30000

#otbcli_ZonalStatistics -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL.tif -inbv -10000 -inzone.vector.in $TERLAB_SHP -inzone.vector.reproject 1 -out.vector.filename ${MAASSP_DIR}/zonal_stats_refl.shp -ram 30000

#### DEM
ALTIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ALT_R1.TIF
ASPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ASP_R1.TIF
SLPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_SLP_R1.TIF
DEMIMG=${MAASSP_DIR}/tiles/T31TCJ/DEM_${TILE}.tif
otbcli_ConcatenateImages -il ${ALTIMG} ${ASPIMG} ${SLPIMG} -out ${DEMIMG} -ram 30000
otbcli_ZonalStatistics -in ${DEMIMG} -inbv -10000 -inzone.vector.in $TERLAB_SHP -inzone.vector.reproject 1 -out.vector.filename ${MAASSP_DIR}/zonal_stats_dem.shp -ram 30000