|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import h5py |
|
|
import numpy as np |
|
|
import matplotlib.pyplot as plt |
|
|
|
|
|
|
|
|
fileOfChoice = 'validation.h5' |
|
|
|
|
|
|
|
|
fid = h5py.File(fileOfChoice,'r') |
|
|
print('INFO: The names of variables in the file of \''+fileOfChoice+'\':') |
|
|
print fid.keys() |
|
|
|
|
|
|
|
|
print('INFO: Loading sentinel-1 data patches ...') |
|
|
s1 = np.array(fid['sen1']) |
|
|
print('INFO: Sentinel-1 data dimension:') |
|
|
print(s1.shape) |
|
|
|
|
|
print('INFO: Loading sentinel-2 data patches ...') |
|
|
s2 = np.array(fid['sen2']) |
|
|
print('INFO: Sentinel-2 data dimension:') |
|
|
print(s2.shape) |
|
|
|
|
|
print('INFO: Loading label ...') |
|
|
lab = np.array(fid['label']) |
|
|
print('INFO: Label dimension:') |
|
|
print(lab.shape) |
|
|
|
|
|
|
|
|
|
|
|
plt.subplot(121) |
|
|
plt.imshow(10*np.log10(s1[0,:,:,4]),cmap=plt.cm.get_cmap('gray')) |
|
|
plt.colorbar() |
|
|
plt.title('Sentinel-1') |
|
|
|
|
|
plt.subplot(122) |
|
|
plt.imshow(s2[0,:,:,1],cmap=plt.cm.get_cmap('gray')) |
|
|
plt.colorbar() |
|
|
plt.title('Sentinel-2') |
|
|
|
|
|
plt.show() |
|
|
|
|
|
|
|
|
|
|
|
fileOfChoice = 'validation_geo.h5' |
|
|
|
|
|
|
|
|
fid = h5py.File(fileOfChoice,'r') |
|
|
print('INFO: The names of variables in the file of \''+fileOfChoice+'\':') |
|
|
|
|
|
|
|
|
print('INFO: Loading coordinate data ...') |
|
|
coord = np.array(fid['coord']) |
|
|
print('INFO: Coordinate data dimension:') |
|
|
print(coord.shape) |
|
|
|
|
|
|
|
|
print('INFO: Loading epsg data ...') |
|
|
tfw = np.array(fid['tfw']) |
|
|
print('INFO: tfw data dimension:') |
|
|
print(tfw.shape) |
|
|
|
|
|
|
|
|
print('INFO: Loading epsg data ...') |
|
|
epsg = np.array(fid['epsg']) |
|
|
print('INFO: epsg data dimension:') |
|
|
print(epsg.shape) |
|
|
|
|
|
|