Commit 30fcf57d8a123bead6963a42124e1baefedc18f9

Authored by Jordi Inglada
1 parent 6c7638df
Exists in master

Split image for zonal stats

jobs/prepare_samples.cfg 100644 โ†’ 100755
jobs/prepare_samples.sh 100644 โ†’ 100755
jobs/zonal_stats.pbs 100644 โ†’ 100755
1 1 #!/bin/sh
2   -#PBS -N zonal_stats
3   -#PBS -l select=1:ncpus=20:mem=110gb
4   -#PBS -l walltime=20:00:00
  2 +#PBS -N refl_zonal_stats
  3 +#PBS -l select=1:ncpus=20:mem=100gb
  4 +#PBS -l walltime=100:00:00
5 5  
6 6  
7 7 . /work/OT/theia/oso/jordi/OTB/otb_superbuild/otb_superbuild-otb_develop-Release-install/config_otb_tf_py35.sh
... ... @@ -18,12 +18,24 @@ MAASSP_DIR=/work/OT/theia/oso/jordi/maassp_data
18 18 #7z x $TERLAB_ZIP -aoa -o$TERLAB_DIR
19 19 #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
20 20  
21   -#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
  21 +# The input image has 720 channels and OGR fails when creating stdev_509, so we can try to split the image in half the bands
  22 +
  23 +CH_LIST1=$(for i in $(seq 1 359);do echo Channel$i; done)
  24 +CH_LIST2=$(for i in $(seq 360 720);do echo Channel$i; done)
  25 +
  26 +otbcli_ExtractROI -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL.tif -out ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL_1.tif int16 -cl ${CH_LIST1} -ram 80000
  27 +
  28 +otbcli_ZonalStatistics -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL_1.tif -inbv -10000 -inzone.vector.in $TERLAB_SHP -inzone.vector.reproject 1 -out.vector.filename ${MAASSP_DIR}/zonal_stats_refl_1.shp -ram 80000
  29 +
  30 +otbcli_ExtractROI -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL.tif -out ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL_2.tif int16 -cl ${CH_LIST2} -ram 80000
  31 +
  32 +otbcli_ZonalStatistics -in ${MAASSP_DIR}/tiles/T31TCJ/Sentinel2_ST_REFL_2.tif -inbv -10000 -inzone.vector.in $TERLAB_SHP -inzone.vector.reproject 1 -out.vector.filename ${MAASSP_DIR}/zonal_stats_refl_2.shp -ram 80000
  33 +
22 34  
23 35 #### DEM
24   -ALTIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ALT_R1.TIF
25   -ASPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ASP_R1.TIF
26   -SLPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_SLP_R1.TIF
27   -DEMIMG=${MAASSP_DIR}/tiles/T31TCJ/DEM_${TILE}.tif
28   -otbcli_ConcatenateImages -il ${ALTIMG} ${ASPIMG} ${SLPIMG} -out ${DEMIMG} -ram 30000
29   -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
  36 +# ALTIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ALT_R1.TIF
  37 +# ASPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_ASP_R1.TIF
  38 +# SLPIMG=${DEM_DIR}/S2__TEST_AUX_REFDE2_${TILE}_0001_SLP_R1.TIF
  39 +# DEMIMG=${MAASSP_DIR}/tiles/T31TCJ/DEM_${TILE}.tif
  40 +# otbcli_ConcatenateImages -il ${ALTIMG} ${ASPIMG} ${SLPIMG} -out ${DEMIMG} -ram 30000
  41 +# 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
... ...