# -*- coding: utf-8 -*- """ Spyder Editor Dies ist eine temporäre Skriptdatei. """ import h5py import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs import cartopy.feature as cfeature import cartopy.io.shapereader as shpreader #from shapely.geometry import Point, Polygon #from geopandas.tools import sjoin dType = 'ASWDIR' #data type year = '2015' path = 'D:/WetterdatenPamore/' + year + '/' \ + year + '_'+ dType + '.h5' with h5py.File(path, 'r') as f: data = f[dType] lat = f['latitude'] lon = f['longitude'] refPos = (lat[0,0], lon[0,0]) posRight = (lat[0,100], lon[0,100]) posDown = (lat[100,0], lon[100,0]) print (refPos, posRight, posDown) #print(min(data)) #print(max(data)) #print(data[:15]) print(data[12,0,0]) for key in f.keys(): print(key) for att in f.attrs.keys(): print(att, f.attrs[att]) data_crs = ccrs.PlateCarree() fig = plt.figure(figsize=(15,15)) ax = fig.add_subplot(1, 1, 1, projection=ccrs.EuroPP()) ax.set_extent([0, 10, 50, 60], crs=ccrs.PlateCarree()) resolution = '10m' #ax.add_feature(cfeature.LAND) #ax.add_feature(cfeature.OCEAN) ax.add_feature(cfeature.COASTLINE.with_scale(resolution)) ax.add_feature(cfeature.BORDERS.with_scale(resolution)) #ax.add_feature(cfeature.LAKES, alpha=0.5) #ax.add_feature(cfeature.RIVERS) ax.gridlines() ax.scatter(refPos[1], refPos[0], transform=data_crs, c='black') ax.scatter(posRight[1], posRight[0], transform=data_crs, c='red') ax.scatter(posDown[1], posDown[0], transform=data_crs, c='blue') print('Top left - Lat:', lat[0,0], " Lon:", lon[0,0]) print('Top Right - Lat:', lat[0,len(lat[0]) - 1], " Lon:", lon[0,len(lon[0]) - 1]) print('Bottom left - Lat:', lat[len(lat) - 1,0], " Lon:", lon[len(lon) - 1,0]) print('Bottom Right - Lat:', lat[len(lat) - 1,len(lat[0]) - 1], " Lon:", lon[len(lon) - 1,len(lon[0]) - 1]) plt.show()