Difference between revisions of "File:Parallel Mesh Generation Around the world.png"
From crtc.cs.odu.edu
(→Additional Assets) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | = Additional Assets = | ||
Script to generate it : | Script to generate it : | ||
− | + | <div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;"> | |
<syntaxhighlight lang="python" > | <syntaxhighlight lang="python" > | ||
import cartopy.crs as ccrs | import cartopy.crs as ccrs | ||
Line 36: | Line 37: | ||
plt.show() | plt.show() | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | </div> | ||
+ | |||
+ | Sample data: | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;"> | ||
+ | <syntaxhighlight lang="python" > | ||
+ | places = dict() | ||
+ | |||
+ | # Paris,Saclay INRIA | ||
+ | lat = 48.73668 | ||
+ | lon = 2.180034 | ||
+ | x = lon -25 | ||
+ | y = lat -5 | ||
+ | places['INRIA'] = [lon,lat,x,y] | ||
+ | |||
+ | #Swansea | ||
+ | lat = 51.6214 | ||
+ | lon = -3.9436 | ||
+ | x = lon - 35 | ||
+ | y = lat +2 | ||
+ | places['Swansea'] = [lon,lat,x,y] | ||
+ | |||
+ | # London Imperial | ||
+ | lat = 51.5074 | ||
+ | lon = -0.1278 | ||
+ | x = lon -40 | ||
+ | y = lat + 8 | ||
+ | places['Imperial'] = [ lon,lat,x,y] | ||
+ | |||
+ | # Belgium, Université catholique de Louvain | ||
+ | lat = 50.85045 | ||
+ | lon = 4.34878 | ||
+ | x = lon -45 | ||
+ | y = lat -3 | ||
+ | places['UCLouvain'] = [lon,lat,x,y] | ||
+ | |||
+ | #Fairfax | ||
+ | lat = 38.8321946 | ||
+ | lon = -77.308036 | ||
+ | x = lon +7 | ||
+ | y = lat -3 | ||
+ | places['GMU'] = [lon,lat,x,y] | ||
+ | |||
+ | #Troy | ||
+ | lat = 42.7302 | ||
+ | lon = -73.6788 | ||
+ | x = lon +15 | ||
+ | y = lat -5 | ||
+ | places['RPI'] = [lon,lat,x,y] | ||
+ | |||
+ | # NASA LaRC | ||
+ | lon = -76.385486 | ||
+ | lat = 37.096157 | ||
+ | x = lon +15 | ||
+ | y = lat -8 | ||
+ | places['LaRC'] = [lon,lat,x,y] | ||
+ | |||
+ | # ODU | ||
+ | lat= 36.8466667 | ||
+ | lon = -76.2855556 | ||
+ | x = lon +15 | ||
+ | y = lat -15 | ||
+ | places['ODU'] = [lon,lat,x,y] | ||
+ | |||
+ | # St. Louis | ||
+ | lat = 38.627003 | ||
+ | lon = -90.199402 | ||
+ | x = lon -15 | ||
+ | y = lat +5 | ||
+ | places['Boeing'] = [lon,lat,x,y] | ||
+ | |||
+ | # UTexas , Austin | ||
+ | lat = 30.2672 | ||
+ | lon = -97.7431 | ||
+ | x = lon - 25 | ||
+ | y = lat - 15 | ||
+ | places['UTexas'] = [lon,lat,x,y] | ||
+ | |||
+ | # Alburquerque | ||
+ | lat = 35.106766 | ||
+ | lon =-106.629181 | ||
+ | x = lon -15 | ||
+ | y = lat +5 | ||
+ | places['Sandia'] = [lon,lat,x,y] | ||
+ | |||
+ | # British Columbia , vancouver | ||
+ | lat = 49.2827 | ||
+ | lon = -123.1207 | ||
+ | x= lon +10 | ||
+ | y = lat +2 | ||
+ | places['UBC'] = [ lon,lat,x,y] | ||
+ | |||
+ | # Santiago Chile | ||
+ | lon = -70.6666667 | ||
+ | lat = -33.45 | ||
+ | x = lon -30 | ||
+ | y = lat | ||
+ | places['UChile'] = [lon,lat,x,y] | ||
+ | |||
+ | </syntaxhighlight> | ||
+ | |||
+ | </div> |
Latest revision as of 21:42, 10 September 2018
Additional Assets
Script to generate it :
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
fig=plt.figure(figsize=[15,10])
ax = plt.axes(projection=ccrs.Robinson())
ax.add_feature(cfeature.LAND,facecolor='lightgrey')
#ax.add_feature(cfeature.OCEAN)
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.BORDERS)
# make the map global rather than have it zoom in to
# the extents of any plotted data
#ax.set_global()
#ax.set_extent([-160,160,-90,90])
#https://stackoverflow.com/a/25421922
transform = ccrs.PlateCarree()._as_mpl_transform(ax)
for key, value in places.items():
print(key)
lon,lat,x,y = value
# add marker
plt.plot(lon,lat, marker='D',color='red',markersize=3,transform=ccrs.Geodetic())
# add text
plt.annotate(key,xy=(lon,lat), xytext=(x,y),arrowprops=dict(arrowstyle="->",color='red'),xycoords=transform)
# Save the plot by calling plt.savefig() BEFORE plt.show()
#plt.savefig('map.svg')
plt.savefig('map.png',dpi=200,bbox_inches='tight')
plt.show()
Sample data:
places = dict()
# Paris,Saclay INRIA
lat = 48.73668
lon = 2.180034
x = lon -25
y = lat -5
places['INRIA'] = [lon,lat,x,y]
#Swansea
lat = 51.6214
lon = -3.9436
x = lon - 35
y = lat +2
places['Swansea'] = [lon,lat,x,y]
# London Imperial
lat = 51.5074
lon = -0.1278
x = lon -40
y = lat + 8
places['Imperial'] = [ lon,lat,x,y]
# Belgium, Université catholique de Louvain
lat = 50.85045
lon = 4.34878
x = lon -45
y = lat -3
places['UCLouvain'] = [lon,lat,x,y]
#Fairfax
lat = 38.8321946
lon = -77.308036
x = lon +7
y = lat -3
places['GMU'] = [lon,lat,x,y]
#Troy
lat = 42.7302
lon = -73.6788
x = lon +15
y = lat -5
places['RPI'] = [lon,lat,x,y]
# NASA LaRC
lon = -76.385486
lat = 37.096157
x = lon +15
y = lat -8
places['LaRC'] = [lon,lat,x,y]
# ODU
lat= 36.8466667
lon = -76.2855556
x = lon +15
y = lat -15
places['ODU'] = [lon,lat,x,y]
# St. Louis
lat = 38.627003
lon = -90.199402
x = lon -15
y = lat +5
places['Boeing'] = [lon,lat,x,y]
# UTexas , Austin
lat = 30.2672
lon = -97.7431
x = lon - 25
y = lat - 15
places['UTexas'] = [lon,lat,x,y]
# Alburquerque
lat = 35.106766
lon =-106.629181
x = lon -15
y = lat +5
places['Sandia'] = [lon,lat,x,y]
# British Columbia , vancouver
lat = 49.2827
lon = -123.1207
x= lon +10
y = lat +2
places['UBC'] = [ lon,lat,x,y]
# Santiago Chile
lon = -70.6666667
lat = -33.45
x = lon -30
y = lat
places['UChile'] = [lon,lat,x,y]
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 21:41, 10 September 2018 | 2,372 × 1,226 (542 KB) | Ctsolakis (talk | contribs) | ||
18:21, 6 September 2018 | 1,794 × 1,557 (319 KB) | Ctsolakis (talk | contribs) | |||
18:06, 6 September 2018 | 1,794 × 1,581 (323 KB) | Ctsolakis (talk | contribs) |
- You cannot overwrite this file.
File usage
There are no pages that link to this file.