-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdmr_data_headers.py
264 lines (243 loc) · 11.2 KB
/
dmr_data_headers.py
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# -*- coding: utf-8 -*-
"""
Created on 17th of Jan., 2018
@author: gmiliar (George Ch. Miliaresis)
Dimensonality reduction for DEMs (SVR.DEM) by G.Ch. Miliaresis
Ver. 2017.02 winpython implementation, (https://winpython.github.io/)
Details in https://github.com/miliaresis
https://sites.google.com/site/miliaresisg/
----------------------------------------------------------------
TO LOAD your data, define a header in the file svr_data_headers.py.
-------------------------------------------------------------------------
"""
def phead(xy, ML, x2, x3, Lmn, Lmx, Rmn, Rmx, LDIR, T, cm):
"""PRINT DATA HEADER.
DATA files stored in a subdir named data within the dir where the
3 scripts are stored.
The tif image filenames (in the data dir) are fixed :
MASK [0, 1 for data], & 01, 02, 03 for the 3 DEMs (ALOS, SRTM, ASTER)
THE NAMES ARE CASE SENSITIVE and they are
determined automatically from the script (as well as the dimension of
the feature space -> length of tics list), so you should preserve them
in your data dir.
"""
Headers_ALL = ['dataDEM2', 'dataDEM1', 'dataDEM3', 'dataDEM4', 'dataDEM5',
'dataDEM6', 'dataDEM7', 'dataDEM8']
print('Labels for x-axis, y-axis of images/histograms:\n ', ML)
print('Geographic extent of data: ', xy)
print('AXES legends & Tables headers for rows & columns',
'\n ', x2, '\n ', x3)
print('Domain of histograms, data: ', Lmn, Lmx, ' Rdata: ', Rmn, Rmx, ' m')
print('Subdir with images or vector files= ', LDIR)
print('Clustering method: ', cm)
print('Method for TIF file import: ', T)
print('\nData headers available: ', Headers_ALL)
def dataDEM1(clustering_options, tiff_import_options):
"""ALOS, SRTM, ASTER GDEMs (3 DEMS), SE Zagros Ranges"""
print('\n---> ALOS, SRTM, ASTER GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.2362, 54.6810, 27.1107, 27.5555]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G']
x3 = ['ALOS', 'SRTM', 'ASTER']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 301
Lmax = 2210
Rmin = -25
Rmax = 25
# clustering method: Kmeans
clustermethod = clustering_options[0]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM2(clustering_options, tiff_import_options):
"""ALOS, SRTM, ASTER, NED GDEMs (4 DEMs) """
print('\n---> ALOS, SRTM, ASTER, NED GDEMs, 1 arcsec, Lat/Lon,WGS84,EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [-117.2068, -116.7065, 36.0866, 36.5869]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G', 'N']
x3 = ['ALOS', 'SRTM', 'ASTER', 'NED']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = -156
Lmax = 2500
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data2'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM3(clustering_options, tiff_import_options):
"""ALOS(median,average), SRTM,ASTER DEMS, SE Zagros Ranges"""
print('\n---> ALOS, SRTM, ASTER GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.16158, 54.69491, 27.03999, 27.57332]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G']
x3 = ['ALOS', 'SRTM', 'ASTER']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 205
Lmax = 2208
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data3'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM4(clustering_options, tiff_import_options):
"""ALOS(median,average), SRTM,ASTER DEMS, SE Zagros Ranges, great area"""
print('\n---> ALOS, SRTM, ASTER GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.17698, 54.95448, 27.02163, 27.71580]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G']
x3 = ['ALOS', 'SRTM', 'ASTER']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 132
Lmax = 2209
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data4'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM5(clustering_options, tiff_import_options):
"""ALOS(median,average), SRTM,ASTER DEMS, SE Zagros Ranges, great area
only ALOS-median & SRTM are considered <- 2 dimensional test for DATA4"""
print('\n---> ALOS, SRTM, GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.17698, 54.95448, 27.02163, 27.71580]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S']
x3 = ['ALOS', 'SRTM']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 132
Lmax = 2209
Rmin = -25
Rmax = 25
# clustering method: 0 for Kmeans or 1 for Kmeans refined by NBG
clustermethod = clustering_options[0]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data4'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM6(clustering_options, tiff_import_options):
"""ALOS(median,average),SE Zagros Ranges, great area, only ALOS-median &
ALOS-average are considered <- 2 dimensional test for DATA4"""
print('\n---> ALOS median & mean GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.17698, 54.95448, 27.02163, 27.71580]
# tics for axes of figures and cross-correlation matrix
x2 = ['M', 'A']
x3 = ['median', 'average']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 132
Lmax = 2209
Rmin = -25
Rmax = 25
# clustering method: 0 for Kmeans or 1 for Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data5'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM7(clustering_options, tiff_import_options):
"""ALOS, SRTM, ASTER, GDEMs (3 DEMs of death valley) """
print('\n---> ALOS,SRTM,ASTER GDEMs, Death Valley 1as-Lat/Lon,WGS84,EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [-117.2068, -116.7065, 36.0866, 36.5869]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G']
x3 = ['ALOS', 'SRTM', 'ASTER']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = -156
Lmax = 2500
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data7'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM8(clustering_options, tiff_import_options):
"""ALOS(median), SRTM DEMS, SE Zagros Ranges, great area"""
print('\n---> ALOS, SRTM, ASTER GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.17698, 54.95448, 27.02163, 27.71580]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S']
x3 = ['ALOS', 'SRTM']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 132
Lmax = 2209
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'data4'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
def dataDEM9(clustering_options, tiff_import_options):
"""ALOS(median,average), SRTM,ASTER DEMS, SE Zagros Ranges, great area"""
print('\n---> ALOS, SRTM, ASTER GDEMs, 1 arc sec, Lat/Lon, WGS84, EGM96')
# Main figure labels (title, x-axis, y-axis)
ML = ['H, m', 'Longitude,DD', 'Latitude, DD']
# Geograhic extent (X-LON-min, X-LON-max, Y-LAT-min, Y-LAT-max)
xy = [54.17698, 54.95448, 27.02163, 27.71580]
# tics for axes of figures and cross-correlation matrix
x2 = ['A', 'S', 'G']
x3 = ['ALOS', 'SRTM', 'ASTER']
# Histograms domain for data (eg. DEM) & reconstructed data (eg. DEM)
Lmin = 132
Lmax = 2209
Rmin = -25
Rmax = 25
# clustering method: Kmeans refined by NBG
clustermethod = clustering_options[1]
# PIL Library is used for TIF file import
T = tiff_import_options[0]
# Sub-directory for image files or vector matrix
LDIR = 'test'
phead(xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)
return (xy, ML, x2, x3, Lmin, Lmax, Rmin, Rmax, LDIR, T, clustermethod)