Skip to content

Commit 8a1d5a7

Browse files
committed
Align SLSTR to OLCI
1 parent 753184d commit 8a1d5a7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

S3_proc.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,29 @@ for folder in $(ls ${inpath} | grep S3._OL_1_EFR); do
9898
-Ds3tbx.reader.olci.pixelGeoCoding=true \
9999
-e || (log_err "gpt error"; exit 1)
100100
log_info "gpt: Finished"
101-
101+
102102
log_info "Renaming..."
103103
# GPT bug means we can't write out band.tif, but have to use some other name.
104104
# I chose "band_x.tif". Here we work around that bug.
105105
for f in $(ls ${dest}/*_x*); do mv ${f} "${f//_x}"; done
106106

107+
log_info "Aligning SLSTR to OLCI..."
108+
extent=$(gdalinfo ${dest}/SZA.tif \
109+
| awk '/(Upper Left)|(Lower Right)/' \
110+
| awk '{gsub(/,|\)|\(/," ");print $3 " " $4}' \
111+
| sed ':a;N;$!ba;s/\n/ /g' \
112+
| awk '{print $1 " " $4 " " $3 " " $2}')
113+
pixsize=$(gdalinfo ${dest}/SZA.tif |grep "Pixel Size"| cut -d"(" -f2| tr ')' ' ' | tr ',' ' ')
114+
parallel "gdalwarp -te ${extent} -te_srs EPSG:3413 -tr ${pixsize} ${dest}/{}.tif ${dest}/{%}.tif; " \
115+
"mv ${dest}/{%}.tif ${dest}/{}.tif" \
116+
::: cloud_an cloud_an_137 confidence_an confidence_an_cloud
117+
107118
log_info "Compressing..."
108119
for f in $(cd ${dest}; ls *.tif); do
109120
gdal_translate -q -co "COMPRESS=DEFLATE" ${dest}/${f} ${dest}/${f}_tmp.tif
110121
mv ${dest}/${f}_tmp.tif ${dest}/${f}
111122
done
112-
123+
113124
# log_info "Begin sice..."
114125
# timing
115126
# ./sice.py ${dest}

0 commit comments

Comments
 (0)