-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hackathon #28
Hackathon #28
Conversation
Can we delete the DNB hackathon files? |
Can we update the examples to fetch the data from vestas? I have attached the json schemas for the endpoints and example code here: aggregation_query_input.json import requests
import json
################ POST Timeseries Query ######################
#############################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/timeseriesquery"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
request = {
"latitude": 46.90,
"longitude": -78.286,
"startDate": "2011-01-01T00:00:00.000Z",
"endDate": "2024-01-30T15:11:51.021Z",
"vars4D": [
"wsp"
],
"vars3D": [
"t2"
],
"heights": [
21.3,
80
]
}
response = requests.post(api_url, data=json.dumps(request), headers=headers)
print("Timeseries Query: ")
print(response.json())
################ POST Threshold Query ################################################################
#######################################################################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/thresholdquery"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
request = {
"maxxlat":50.1,
"maxxlong":14.4,
"minxlat":50.0,
"minxlong":14.2,
"starttime":"2022",
"endtime":"2023",
"zHeights":[20,30,40],
"tc_min":-15,
"tc_max":15
}
response = requests.post(api_url, data=json.dumps(request), headers=headers)
print("Threshold Query: ")
print(response.json())
################ POST Aggregation Query ################################################################
#######################################################################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/aggregationquery"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
request = {
"maxxlat":50.1,
"maxxlong":14.4,
"minxlat":50.0,
"minxlong":14.2,
"starttime":"20230101",
"endtime":"20230131",
"selectedFunction":{
"MIN":{
"3DVars":["t2"]
}
}
}
response = requests.post(api_url, data=json.dumps(request), headers=headers)
print("Aggregation Query: ")
print(response.json())
################ POST Time Series Area Query ##########################################################
#######################################################################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/timeseriesareaquery"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
request = {
"minxlat":41,
"minxlong":-100,
"maxxlat":42,
"maxxlong":-99,
"starttime":"20220501",
"endtime":"20220831",
"selectedVariables":{
"4DVars":["wsp","wdir","tk"],
"zHeights":[50,150]
}
}
response = requests.post(api_url, data=json.dumps(request), headers=headers)
print("Timeseriea Area Query: ")
print(response.json())
################ Get Query Status ################################################################
##################################################################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/querystatus/4d1cc6e3-e508-4e8c-9d6c-641adb4af0b6"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
response = requests.get(api_url, headers=headers)
print("Query Status: ")
print(response.json())
################ Get Paginated Query Result ######################################################
##################################################################################################
api_url = "https://public-dev.api.vestas.com/public/vestas-climate-library/v1/queryresult/4d1cc6e3-e508-4e8c-9d6c-641adb4af0b6/1"
headers = {
"Content-Type":"application/json",
"api_key": "x5b13DOiwixsUPeCZfPTXTz26SEibL1y"
}
response = requests.get(api_url, headers=headers)
print("Query Result: ")
print(response.json())
|
The JSON for the data (the one between 50N8W – 60N12E is like this: {
"input_json": {
"selectedFunction": {
"AVG": {
"4DVars": [
"wsp",
"tk"
],
"3DVars": [
"hgt",
"t2",
"sst",
"pblh"
],
"zHeights": [
70,
140,
280
]
},
"MAX": {
"4DVars": [
"wsp"
],
"3DVars": [
"t2"
],
"zHeights": [
70,
140,
280
]
},
"MIN": {
"3DVars": [
"t2"
]
}
},
"minxlat": 50,
"minxlong": -8,
"maxxlat": 60,
"maxxlong": 12
}
}
|
Restructuring the Hackathon folder and fixing import and path to fit …
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff!
Adding the WindEurope folder and notebooks to the Hackathons folder