Skip to content

Commit

Permalink
Add plots for the other continents.
Browse files Browse the repository at this point in the history
  • Loading branch information
juseg committed Mar 22, 2023
1 parent 7ba5f36 commit d1281c8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
51 changes: 44 additions & 7 deletions examples/vectors/plot_modelling_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ def plot_domain(ax, crs, name, properties):
west, south, east, north = bounds
vertices = [(west, south), (east, south), (east, north), (west, north)]
polygon = shapely.geometry.Polygon(vertices)
domain = geopandas.GeoSeries(polygon).set_crs(
f'+proj=laea +lat_0={lat} +lon_0={lon} +ellps=WGS84')
centroid = domain.centroid.to_crs(crs)
domain_crs = f'+proj=laea +lat_0={lat} +lon_0={lon} +ellps=WGS84'
domain = geopandas.GeoSeries(polygon).set_crs(domain_crs)
domain.to_crs(crs).plot(ax=ax, ec='tab:red', fc='none')
ax.annotate(
name, xy=(centroid.x, centroid.y), xytext=(0, 12),
textcoords='offset points', ha='center')


def plot_domains(ax, crs):
Expand Down Expand Up @@ -61,7 +57,48 @@ def plot_domains_map(crs='+proj=lonlat'):

# %%
# North America
plot_domains_map(crs='+proj=laea +lat_0=55 +lon_0=-133 +ellps=WGS84 +units=m')
plot_domains_map(crs='+proj=laea +lat_0=54 +lon_0=-133 +ellps=WGS84')
plt.title('Modelling domains (North America)')
plt.xlim(-3000e3, 3000e3)
plt.ylim(-2000e3, 2000e3)
plt.show()

# %%
# South America
plot_domains_map(crs='+proj=laea +lat_0=-24 +lon_0=-58 +ellps=WGS84')
plt.title('Modelling domains (South America)')
plt.xlim(-6000e3, 6000e3)
plt.ylim(-4500e3, 4500e3)
plt.show()

# %%
# Europe
plot_domains_map(crs='+proj=laea +lat_0=56 +lon_0=21 +ellps=WGS84')
plt.title('Modelling domains (Europe)')
plt.xlim(-3000e3, 3000e3)
plt.ylim(-2000e3, 2000e3)
plt.show()

# %%
# Africa
plot_domains_map(crs='+proj=laea +lat_0=3 +lon_0=35 +ellps=WGS84')
plt.title('Modelling domains (Africa)')
plt.xlim(-3000e3, 3000e3)
plt.ylim(-2000e3, 2000e3)
plt.show()

# %%
# Asia
plot_domains_map(crs='+proj=laea +lat_0=55 +lon_0=105 +ellps=WGS84')
plt.title('Modelling domains (Asia)')
plt.xlim(-4500e3, 4500e3)
plt.ylim(-3000e3, 3000e3)
plt.show()

# %%
# Oceania
plot_domains_map(crs='+proj=laea +lat_0=-43 +lon_0=158 +ellps=WGS84')
plt.title('Modelling domains (Oceania)')
plt.xlim(-3000e3, 3000e3)
plt.ylim(-2000e3, 2000e3)
plt.show()
6 changes: 3 additions & 3 deletions hyoga/core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@
'Carpathians': (45, 24, [-100e3, -100e3, 100e3, 100e3]),
'Rodna': (48, 25, [-100e3, -100e3, 100e3, 100e3]),
'Apennine': (42, 14, [-100e3, -100e3, 100e3, 100e3]),
'Kackar': (41, 41, [-90e3, -40e3, 90e3, 40e3]),
'Caucasus': (43, 43, [-440e3, -150e3, 440e3, 150e3]),

# Africa
'Rwenzori': (0, 30, [-100e3, -100e3, 100e3, 100e3]),
'Bale': (7, 40, [-70e3, -50e3, 20e3, 50e3]),

# Asia & Oceania
'Kackar': (41, 41, [-90e3, -40e3, 90e3, 40e3]),
'Caucasus': (43, 43, [-440e3, -150e3, 440e3, 150e3]),
'Alborz': (36, 51, [-90e3, -50e3, 90e3, 50e3]),
'Urals': (66, 63, [-100e3, -100e3, 100e3, 100e3]),
'Kerguelen': (-49, 69, [-100e3, -100e3, 100e3, 100e3]),
'Himalaya': (34, 87, [-1820e3, -950e3, 1770e3, 850e3]),
'Altai': (50, 89, [-400e3, -400e3, 400e3, 400e3]),
Expand All @@ -71,7 +72,6 @@
'TienShan': (42, 80, [-300e3, -300e3, 300e3, 300e3]),
'Transbaikal': (56, 114, [-500e3, -370e3, 500e3, 420e3]),
'Stanovoy': (55, 130, [-100e3, +000e3, 300e3, 200e3]),
'Dzhugdzhur': (57, 137, [-100e3, +000e3, 300e3, 200e3]),
'Verkhoyansk': (67, 130, [-250e3, -250e3, 250e3, 250e3]),
'YamAlin': (52, 135, [-100e3, -200e3, 100e3, 200e3]),
'Tasmania': (-42, 146, [-30e3, -20e3, 30e3, 20e3]),
Expand Down

0 comments on commit d1281c8

Please sign in to comment.