Project

General

Profile

Download (3.88 KB) Statistics
| Branch: | Revision:
1
#Check of mismatched data in overlap zone for AsterGDEM2
2

    
3
#Datasets:    c=N60E005
4
#             a=N59E005    b=N59E006
5

    
6
import os
7
import sys
8
import osgeo
9
from osgeo import gdal
10
from osgeo.gdalconst import *
11

    
12
a= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N59E005_dem.tif', GA_ReadOnly)
13

    
14
b= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N59E006_dem.tif', GA_ReadOnly)
15

    
16
c= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N60E005_dem.tif', GA_ReadOnly)
17

    
18
arraya=a.ReadAsArray(0,0,a.RasterXSize,a.RasterYSize)
19
arrayb=b.ReadAsArray(0,0,b.RasterXSize,b.RasterYSize)
20
arrayc=c.ReadAsArray(0,0,b.RasterXSize,c.RasterYSize)
21

    
22
for i in range(0,3600):
23
   if arraya[i,3600] != arrayb[i,0]:
24
       print i
25

    
26
for i in range(0,3600):
27
   if arraya[i,3600] != arrayb[i,0]:
28
       print arraya[i,3600]
29

    
30
for i in range(0,3600):
31
   if arraya[i,3600] != arrayb[i,0]:
32
       print arrayb[i,0]
33

    
34
arraya[553,3600]
35
arrayb[553,0]
36

    
37
for i in range (0,3600):
38
   if arraya[0,i]!= arrayc[3600,i]:
39
      print i
40

    
41
for i in range (0,3600):
42
   if arraya[0,i]!= arrayc[3600,i]:
43
      print arraya[0,i]
44

    
45
for i in range (0,3600):
46
   if arraya[0,i]!= arrayc[3600,i]:
47
      print arrayc[3600,i]
48

    
49
#---------------------------------------------------------------------------
50
gdalinfo /data/project/organisms/DEM/asterGdem2/ASTGTM2_N59E005_dem.tif
51
gdalinfo /data/project/organisms/SRTM_90m_ASCII_v4.1/srtm_01_15.tif 
52
gdalinfo /data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_01_15.asc 
53
gdalinfo /data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_01_16.asc 
54
gdalinfo /data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_02_15.asc
55

    
56
#----------------------------------------------------------------------------
57
#Check of mismatched data in overlap zone for SRTM 90m
58

    
59
#Datasets:    q=12_03    r=13_03
60
#             s=12_04
61

    
62
q= gdal.Open ('/data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_12_03.asc', GA_ReadOnly)
63
r= gdal.Open ('/data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_13_03.asc', GA_ReadOnly)
64
s= gdal.Open ('/data/project/organisms/DEM/cgiarSrtm/SRTM_90m_ASCII_4_1/srtm_12_04.asc', GA_ReadOnly)
65

    
66
arrayq=q.ReadAsArray(0,0,q.RasterXSize,q.RasterYSize)
67
arrayr=r.ReadAsArray(0,0,r.RasterXSize,r.RasterYSize)
68
arrays=s.ReadAsArray(0,0,s.RasterXSize,s.RasterYSize)
69

    
70
for i in range (0,6000):
71
   if arrayq[i,6000]!= arrayr[i,0]:
72
      print i
73

    
74
for i in range (0,6000):
75
   if arrayq[i,6000]!= arrayr[i,0]:
76
      print arrayq[i,6000]
77

    
78
for i in range (0,6000):
79
   if arrayq[i,6000]!= arrayr[i,0]:
80
      print arrayr[i,0]
81

    
82
for i in range (0,6000):
83
   if arrayq[6000,i]!= arrays[0,i]:
84
      print i
85

    
86
for i in range (0,6000):
87
   if arrayq[6000,i]!= arrays[0,i]:
88
      print arrayq[6000,i]
89

    
90
for i in range (0,6000):
91
   if arrayq[6000,i]!= arrays[0,i]:
92
      print arrays[0,i]
93

    
94
#No errors- do a few manual checks- ALL CAME OUT OK 
95

    
96
arrayq[6000,5120]
97
arrays[0,5120]
98

    
99
#---------------------------------------------------------------------------------------
100
a= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N66E068_dem.tif', GA_ReadOnly)
101

    
102
b= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N66E067_dem.tif', GA_ReadOnly)
103

    
104
c= gdal.Open ('/data/project/organisms/DEM/asterGdem2/ASTGTM2_N67E068_dem.tif', GA_ReadOnly)
105

    
106
arraya=a.ReadAsArray(0,0,a.RasterXSize,a.RasterYSize)
107
arrayb=b.ReadAsArray(0,0,b.RasterXSize,b.RasterYSize)
108
arrayc=c.ReadAsArray(0,0,b.RasterXSize,c.RasterYSize)
109

    
110
for i in range(0,3600):
111
   if arrayb[i,3600] != arraya[i,0]:
112
       print i
113

    
114
for i in range(0,3600):
115
   if arrayb[i,3600] != arraya[i,0]:
116
       print arraya[i,3600]
117

    
118
for i in range(0,3600):
119
   if arrayb[i,3600] != arraya[i,0]:
120
       print arrayb[i,0]
121

    
122
arraya[553,3600]
123
arrayb[553,0]
124

    
125
for i in range (0,3600):
126
   if arraya[0,i]!= arrayc[3600,i]:
127
      print i
128

    
129
for i in range (0,3600):
130
   if arraya[0,i]!= arrayc[3600,i]:
131
      print arraya[0,i]
132

    
133
for i in range (0,3600):
134
   if arraya[0,i]!= arrayc[3600,i]:
135
      print arrayc[3600,i]
136

    
(3-3/5)