Facebook
From can, 1 Month ago, written in Python.
Embed
Download Paste or View Raw
Hits: 133
  1. # Check that downsampled data covers the same lat/lon extents as original data, but is truly taking a subset of the locations
  2. _, orig_lons, orig_lats = sample_raster_data(tif_bytes_out, interval=1)
  3. # Plot the raster data and sampled points
  4. plt.scatter(orig_lons, orig_lats, color='blue', alpha=1, s=1)
  5. plt.scatter(longitudes, latitudes, color='red', s=1, alpha=1)
  6. plt.gca().set_xlim(left=orig_lons.min(), right=orig_lons.min()+0.002)
  7. plt.gca().set_ylim(bottom=orig_lats.min(), top=orig_lats.min()+0.08)
  8. plt.show()
  9.  
  10. plt.figure()
  11. plt.scatter(orig_lons, orig_lats, color='blue', s=.001)
  12. plt.scatter(longitudes, latitudes, color='red', s=.001)
  13. plt.show()