Esempio n. 1
0
def cut(lat,lon):
	import numpy as np
	root, is_new = nc.open(localpath+"/dem.nc")
	dem = nc.getvar(root, 'dem', 'i2', lat.dimensions)
	x, y = p.pixels_from_coordinates(lat[:], lon[:], dem.shape[0], dem.shape[1])
	# In the transformation the 'y' dimension is twisted because the map is inverted.
	result = p.transform_data(dem,x,dem.shape[0] - y)
	nc.close(root)
	return result, x, y
Esempio n. 2
0
def cut_month(x, y, month):
	linke = get_month(month)
	result = p.transform_data(linke,x,y)
	return np.float32(result)
Esempio n. 3
0
def cut_month(x, y, month):
    ds = gdal.Open(path + "/tifs/" + str(month).zfill(2) + "_longlat_wgs84.tif")
    linke = ds.ReadAsArray()
    result = p.transform_data(linke, x, y)
    return np.float32(result) / 20.0