Skip to content

Commit

Permalink
Better mimic NCL's satellite projection (#609)
Browse files Browse the repository at this point in the history
* Update NCL_sat_1.py to use a satellite projection equivalent

* Better mimic NCL's satellite projection

* formatting
  • Loading branch information
kafitzgerald authored Jul 8, 2024
1 parent 3f3e7bf commit 9fe8b5a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
7 changes: 5 additions & 2 deletions Gallery/MapProjections/NCL_sat_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@
# Set figure size
fig = plt.figure(figsize=(8, 8))

# Set global axes with an orthographic projection
proj = ccrs.Orthographic(central_longitude=270, central_latitude=45)
# Set global axes with a nearside perspective projection (equivalent to NCL's
# satellite projection)
proj = ccrs.NearsidePerspective(central_longitude=270.0,
central_latitude=45.0,
satellite_height=12742000)
ax = plt.axes(projection=proj)
ax.set_global()

Expand Down
7 changes: 5 additions & 2 deletions Gallery/MapProjections/NCL_sat_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@
# Set figure size
fig = plt.figure(figsize=(8, 8))

# Set global axes with an orthographic projection
proj = ccrs.Orthographic(central_longitude=270, central_latitude=45)
# Set global axes with a nearside perspective projection (equivalent to NCL's
# satellite projection)
proj = ccrs.NearsidePerspective(central_longitude=270.0,
central_latitude=45.0,
satellite_height=12742000)
ax = plt.axes(projection=proj)
ax.set_global()

Expand Down
8 changes: 4 additions & 4 deletions Gallery/MapProjections/NCL_sat_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

plt.figure(figsize=(8, 8))

# Create an axis with an orthographic projection
ax = plt.axes(projection=ccrs.Orthographic(central_longitude=-35,
central_latitude=60),
anchor='C')
# Create an axis with an orthographic projection (equivalent to NCL's satellite
# projection where mpSatelliteDistF <= 1.0)
ax = plt.axes(
projection=ccrs.Orthographic(central_longitude=-35, central_latitude=60))

# Set extent of map
ax.set_extent((-80, -10, 30, 80), crs=ccrs.PlateCarree())
Expand Down

0 comments on commit 9fe8b5a

Please sign in to comment.