Skip to content

Instantly share code, notes, and snippets.

import os
import json
import requests
from requests.auth import HTTPBasicAuth
# API Key stored as an env variable
PLANET_API_KEY = os.getenv('PL_API_KEY') # replace PL_API_KEY with Planet API key in quotes
item_type = "PSScene4Band"
download_link = activation_status_result.json()["location"]
print(download_link)
links = result.json()[u"analytic"]["_links"]
self_link = links["_self"]
activation_link = links["activate"]
# Request activation of the 'analytic' asset:
activate_result = \
requests.get(
activation_link,
auth=HTTPBasicAuth(PLANET_API_KEY, '')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def plot_image(i, predictions_array, true_label, img):
predictions_array, true_label, img = predictions_array[i], true_label[i], img[i]
plt.grid(False)
plt.xticks([])
plt.yticks([])
plt.imshow(img, cmap=plt.cm.binary)
predicted_label = np.argmax(predictions_array)
if predicted_label == true_label:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@parulnith
parulnith / Widgets.ipynb
Created December 18, 2018 06:17
Desktop/Hello World Folder/Widgets.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.