-
Notifications
You must be signed in to change notification settings - Fork 1
/
Processing_Polarisation_VV_v2.1.sh
100 lines (99 loc) · 7.36 KB
/
Processing_Polarisation_VV_v2.1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
#### Version log
#### v2: - added terrain flatteing TC for UTM WGS84 map projection
#### - added the FTC generation only for APGB (38-45, 65-72, 90-97)
#### v2.1 - added conversion from linear to dB for UTM-WGS84
#### ==================
#### Polarisation VV
#### ==================
#### Terrain Flattening only with External DEM in SAR geometry
if [ "${SELDEM}" = "APGB" ]; then
echo "Terrain Flattening of beta0"
SNAP_TF_EXTDEM "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR}" "${SLICE_ROOTNAME}" "VV" "CAL" "Beta0" "${SLICE_LOG}"
fi
#### Creation of folder GEO for storing geocoded outputs
export SLICE_VV_OUTDIR_GEO="${SLICE_VV_OUTDIR}/GEO" ## variable for output dir $SLICE_OUTDIR/VV
echo "SLICE_VV_OUTDIR_GEO = ${SLICE_VV_OUTDIR}/GEO" >> ${SLICE_LOG}
mkdir $(echo "${SLICE_VV_OUTDIR}/GEO") ## generation of directory /GEO
#### Geocoding according to CRS selection
if [ "${CRS}" = "OSGB1936" ]; then
echo "CRS=OSGB1936"
#### OSGB 1936
####=================================####
### Absolute Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_OSGB1936 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "TC" "${SLICE_LOG}"
SNAP_ML_TC_OSGB1936 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "TC" "${SLICE_LOG}"
###=================================####
### Radiometrically Normalised (Kellndorfer) Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_RNKELL_OSGB1936 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "${SLICE_LOG}"
SNAP_ML_TC_RNKELL_OSGB1936 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "${SLICE_LOG}"
### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC" "${SLICE_LOG}"
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC_${Spk}" "${SLICE_LOG}"
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC_${Spk}" "${SLICE_LOG}"
###=================================####
### Terrain Flattening Radiometrically Normalisation (Small) Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff) only for APGB DEM
if [ "${SELDEM}" = "APGB" ]; then
SNAP_ML_TC_OSGB1936 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0_APGB_FLAT" "Gamma0" "FTC" "${SLICE_LOG}"
### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC_${Spk}" "${SLICE_LOG}"
fi
####=================================####
elif [ "${CRS}" = "EPSG29902" ]; then
echo "CRS=EPSG29902"
#### EPSG29902
####=================================####
#### Absolute Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_EPSG29902 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "TC" "${SLICE_LOG}"
SNAP_ML_TC_EPSG29902 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "TC" "${SLICE_LOG}"
###=================================####
### Radiometrically Normalised (Kellndorfer) Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_RNKELL_EPSG29902 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "${SLICE_LOG}"
SNAP_ML_TC_RNKELL_EPSG29902 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "${SLICE_LOG}"
### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC" "${SLICE_LOG}"
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC_${Spk}" "${SLICE_LOG}"
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC_${Spk}" "${SLICE_LOG}"
###=================================####
### Terrain Flattening Radiometrically Normalisation (Small) Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff) only for APGB DEM
if [ "${SELDEM}" = "APGB" ]; then
SNAP_ML_TC_EPSG29902 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0_APGB_FLAT" "Gamma0" "FTC" "${SLICE_LOG}"
### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC_${Spk}" "${SLICE_LOG}"
fi
elif [ "${CRS}" = "UTMWGS84" ]; then
echo "UTM WGS84"
####=================================####
#### Absolute Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_UTMWGS84 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "TC" "${SLICE_LOG}"
SNAP_ML_TC_UTMWGS84 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "TC" "${SLICE_LOG}"
####=================================####
#### Radiometrically Normalised (Kellndorfer) Sigma0 and Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff)
SNAP_ML_TC_RNKELL_UTMWGS84 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Sigma0" "${SLICE_LOG}"
SNAP_ML_TC_RNKELL_UTMWGS84 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "CAL" "Gamma0" "${SLICE_LOG}"
#### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC" "${SLICE_LOG}"
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Sigma0" "RTC_${Spk}" "${SLICE_LOG}"
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "RTC_${Spk}" "${SLICE_LOG}"
####=================================####
### Terrain Flattening Radiometrically Normalisation (Small) Gamma0 Multilooked (optional) and Terrain Corrected (output as Geotiff) only for APGB DEM
if [ "${SELDEM}" = "APGB" ]; then
SNAP_ML_TC_UTMWGS84 "${SLICE_VV_OUTDIR}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0_APGB_FLAT" "Gamma0" "FTC" "${SLICE_LOG}"
### Speckle filtering
SNAP_SpeckleFiltering "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC" "${SLICE_LOG}"
### Coversion from linear to dB
SNAP_ConvLinToDb "${SLICE_VV_OUTDIR_GEO}" "${SLICE_VV_OUTDIR_GEO}" "${SLICE_ROOTNAME}" "VV" "Gamma0" "FTC_${Spk}" "${SLICE_LOG}"
fi
else
echo "Other CRS"
fi