Skip to content

Commit 486c478

Browse files
author
Jeff Whitaker
committed
add some comments
1 parent 2a242e0 commit 486c478

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/test_rotpole.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
plt.title('rotated pole data in polar stere map')
2424

2525
plt.figure()
26+
# o_lon_p, o_lat_p: true lat/lon of pole in rotated coordinate system
27+
# mapping to CF metadata convention:
28+
# grid_north_pole_longitude = normalize180(180 + lon_0), where normalize180
29+
# is a function that maps to interval [-180,180], i.e.
30+
# def normalize180(angle):
31+
# if angle > 180: angle = angle+360
32+
# if angle < -180: angle = angle+360
33+
# return angle
34+
# grid_north_pole_latitude = o_lat_p
35+
# north_pole_grid_longitude = o_lon_p (optional, assumed zero if not present)
2636
m = Basemap(projection='rotpole',lon_0=rotpole.grid_north_pole_longitude-180.,\
2737
o_lon_p=rotpole.north_pole_grid_longitude,\
2838
o_lat_p=rotpole.grid_north_pole_latitude,\
@@ -42,6 +52,8 @@
4252
o_lat_p=rotpole.grid_north_pole_latitude,\
4353
llcrnry = rlats[0,0], urcrnry = rlats[-1,-1],\
4454
llcrnrx = rlons[0,0], urcrnrx = rlons[-1,-1],resolution='c')
55+
print m.llcrnrx,m.llcrnry
56+
print m.urcrnrx,m.urcrnry
4557
x,y = m(lons,lats)
4658
m.drawcoastlines()
4759
m.contourf(x,y,data,20)

0 commit comments

Comments
 (0)