-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeographical_map.py
42 lines (40 loc) · 1.31 KB
/
geographical_map.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
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.io.shapereader import Reader
from cartopy.feature import ShapelyFeature
import matplotlib.pyplot as plt
from matplotlib.image import imread
import random
import numpy as np
import matplotlib.pyplot as plt
import csv
import pandas as pd
vt = pd.read_csv('VECT.dat')
vt.head()
St=vt.Est
Xv=vt.Lon
Yv=vt.Lat
Dx=vt.Vcx
Dy=vt.Vcy
N=Xv.size
fallas = r'fallas.shp'
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
ax.set_extent([-85, -65, -5, 15], crs=ccrs.PlateCarree())
shape_feature = ShapelyFeature(Reader(fallas).geometries(), ccrs.PlateCarree(), edgecolor='black', linewidth=0.5)
ax.add_feature(shape_feature)
ax.add_feature(cfeature.LAND, alpha=0.5)
ax.add_feature(cfeature.OCEAN, alpha=0.5)
ax.add_feature(cfeature.COASTLINE, color='blue', linewidth=0.3)
ax.add_feature(cfeature.BORDERS, linewidth=0.3)
ax.add_feature(cfeature.LAKES, alpha=0.5)
ax.add_feature(cfeature.RIVERS, color='gray',linewidth=0.3)
source_proj = ccrs.PlateCarree()
fmap = 'topo_base_Geomapapp.tif'
ax.imshow(imread(fmap), origin='upper', transform=source_proj, extent=[-85, -60, -5, 15])
#ax.stock_img()
plt.scatter(X,Y,s=M/2,c='r',alpha=0.5)
plt.scatter(Xv,Yv,alpha=0.5)
plt.quiver(Xv,Yv,Dx,Dy)
plt.show()
fig.savefig('mimapa.tif', format='tif', dpi=1200)