Skip to content

Instantly share code, notes, and snippets.

@seanmtracey
Created February 9, 2020 12:14
Show Gist options
  • Save seanmtracey/b89e21c12f734f5705c7a69f4f80bb18 to your computer and use it in GitHub Desktop.
Save seanmtracey/b89e21c12f734f5705c7a69f4f80bb18 to your computer and use it in GitHub Desktop.
from ibmpairs import paw
import pandas as pd
PAIRS_SERVER = "https://oxaihack2020.eu-gb.mybluemix.net"
PAIRS_USER = ""
PAIRS_PASS = ""
PAIRS_CREDENTIALS = ( PAIRS_USER, PAIRS_PASS )
query_json = {
"layers" : [
{"type" : "raster", "id" : "49443"}
],
"spatial" : {"type" : "point", "coordinates" : ["35.7", "139.7"]},
"temporal" : {"intervals" : [
{"start" : "2015-01-01T00:00:00Z", "end" : "2018-10-31T00:00:00Z"}
]}
}
query = paw.PAIRSQuery(query_json, PAIRS_SERVER, PAIRS_CREDENTIALS)
query.submit()
print(query)
pairs_data = pd.DataFrame(query.vdf)
print(pairs_data)
pairs_data.to_csv('data_1.csv')
# pd.DataFrame.to_csv(query.vdf, 'data.csv')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment