| 151 | |
| 152 | |
| 153 | def draw_map(y, plot_points, title, bds=[-180,-90,180,90]): |
| 154 | fig = plt.figure() |
| 155 | map = Basemap(*bds) |
| 156 | ax = plt.gca() |
| 157 | |
| 158 | # ax.scatter(points.theta.apply(np.rad2deg), points.phi.apply(np.rad2deg), c=points.land, s=2) |
| 159 | map.imshow(y.cpu().detach().numpy(), origin="lower", interpolation="none", cmap="RdBu_r", vmin=0, vmax=1) |
| 160 | |
| 161 | if plot_points is not None: |
| 162 | map.scatter(plot_points[:,0], plot_points[:,1], c="red") |
| 163 | |
| 164 | #map.drawcoastlines() |
| 165 | map.readshapefile("data/ne_50m_coastline/ne_50m_coastline", "coastlines") |
| 166 | |
| 167 | ax.set_xlabel("longitude") |
| 168 | ax.set_ylabel("latitude") |
| 169 | |
| 170 | if title is not None: |
| 171 | ax.set_title(title) |
| 172 | |
| 173 | return fig |
| 174 | |
| 175 | |
| 176 | def draw_globe(y, lonlats, plot_points, title): |