Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. # ======== DEMO Script to download Landsat 8 data for India for 1st half Jan 2018 ===========
  2.  
  3. # get all the product IDs for India for 1 time period
  4. result = landsat_search(min_date = "2018-01-01", max_date = "2018-01-16", country = "India")
  5.  
  6. # inputting espa creds
  7. espa_creds("yourusername", "yourpassword")
  8.  
  9. # getting available products
  10. prods = espa_products(result$product_id)
  11. prods = prods$master
  12.  
  13. # placing an espa order
  14. result_order = espa_order(result$product_id, product = c("sr","sr_ndvi"),
  15. projection = "lonlat",
  16. order_note = "All India Jan 2018")
  17. order_id = result_order$order_details$orderid
  18.  
  19. # getting order status
  20. durl = espa_status(order_id = order_id, getSize = TRUE)
  21. downurl = durl$order_details
  22. paste0("Total Size of Order: ", round(sum(downurl$size)/(1000^3), 2), "GB")
  23.  
  24. # download; after the order is complete
  25. landsat_download(download_url = downurl$product_dload_url, dest_file = getwd())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement