- Posts: 4
Wind Resource File - Kauai
- jtippett
- Topic Author
Less
More
24 Oct 2023 16:00 #12579
by jtippett
Wind Resource File - Kauai was created by jtippett
Hello,
I would like to use the SAM Wind Model for Kauai, HI. However, the Wind Resource File download tool does not find anything for Hawaii.
Could someone point me in the right direction for how to go about obtaining a Wind Resource File for this area?
Thanks!
John
I would like to use the SAM Wind Model for Kauai, HI. However, the Wind Resource File download tool does not find anything for Hawaii.
Could someone point me in the right direction for how to go about obtaining a Wind Resource File for this area?
Thanks!
John
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
24 Oct 2023 19:56 #12581
by pgilman
Replied by pgilman on topic Wind Resource File - Kauai
Hi John,
You can use NREL's WIND Toolkit API to download offshore wind resource data for Hawaii:
developer.nrel.gov/docs/wind/wind-toolkit/
The Download button on SAM's Wind Resource page accesses the wtk-download dataset, which does not include the offshore Hawaii data.
There may be other sources of data that I am not aware of.
Best regards,
Paul.
You can use NREL's WIND Toolkit API to download offshore wind resource data for Hawaii:
developer.nrel.gov/docs/wind/wind-toolkit/
The Download button on SAM's Wind Resource page accesses the wtk-download dataset, which does not include the offshore Hawaii data.
There may be other sources of data that I am not aware of.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- jtippett
- Topic Author
Less
More
- Posts: 4
25 Oct 2023 06:03 - 26 Oct 2023 13:23 #12585
by jtippett
Replied by jtippett on topic Wind Resource File - Kauai
Thank you, Paul. I am new to this whole process of working with an API...steep learning curve!
I am trying to get the first example GET command at developer.nrel.gov/docs/wind/wind-toolkit/offshore-hawaii-download/#examples to work.
I got ChatGPT to convert the command to Python
I changed the email in the code to mine.
That gives me the Python code below. I put it in a file and ran it using Python3 on my Mac. It generates a 404 error.
The one thing that sticks out to me is that there is no actual HTTP address for the url, it's just a path.
If you have any insight on what I should enter for the server address, (or any other advice) I would be grateful!
- John
___________
import requests
url = "https://??????/api/wind-toolkit/v2/wind/offshore-hawaii-download.json"
params = {
"wkt": "POLYGON((-130.756145509839060 48.75520578942107,-130.75571635639668 48.75520578942107,-130.75571635639668 48.75485477666326,-130.75614550983906 48.75485477666326,-130.75614550983906 48.75520578942107))",
"attributes": "winddirection_180m",
"names": "2017",
"utc": "false",
"leap_day": "true",
"email": "xxx@gmail.com"
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json() # Assuming the response is in JSON format
# Process the data as needed
else:
print(f"Request failed with status code {response.status_code}")
I am trying to get the first example GET command at developer.nrel.gov/docs/wind/wind-toolkit/offshore-hawaii-download/#examples to work.
I got ChatGPT to convert the command to Python
I changed the email in the code to mine.
That gives me the Python code below. I put it in a file and ran it using Python3 on my Mac. It generates a 404 error.
The one thing that sticks out to me is that there is no actual HTTP address for the url, it's just a path.
If you have any insight on what I should enter for the server address, (or any other advice) I would be grateful!
- John
___________
import requests
url = "https://??????/api/wind-toolkit/v2/wind/offshore-hawaii-download.json"
params = {
"wkt": "POLYGON((-130.756145509839060 48.75520578942107,-130.75571635639668 48.75520578942107,-130.75571635639668 48.75485477666326,-130.75614550983906 48.75485477666326,-130.75614550983906 48.75520578942107))",
"attributes": "winddirection_180m",
"names": "2017",
"utc": "false",
"leap_day": "true",
"email": "xxx@gmail.com"
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json() # Assuming the response is in JSON format
# Process the data as needed
else:
print(f"Request failed with status code {response.status_code}")
Last edit: 26 Oct 2023 13:23 by pgilman.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
26 Oct 2023 13:35 #12593
by pgilman
Replied by pgilman on topic Wind Resource File - Kauai
Hi John,
You might try constructing a URL to make the request before diving into Python. The example toward the bottom of the API documentation page is a good starting point. You can add " developer.nrel.gov " to the beginning of the example that starts with "api/wind-toolkit/...", and change the email address and key to yours.
You can then paste the URL into your browser, and you'll either get the file you requested or a JSON response with an error message.
Once you have a URL that works, you can then try to get things working in Python.
Best regards
Paul.
You might try constructing a URL to make the request before diving into Python. The example toward the bottom of the API documentation page is a good starting point. You can add " developer.nrel.gov " to the beginning of the example that starts with "api/wind-toolkit/...", and change the email address and key to yours.
You can then paste the URL into your browser, and you'll either get the file you requested or a JSON response with an error message.
Once you have a URL that works, you can then try to get things working in Python.
Best regards
Paul.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
31 Oct 2023 16:22 #12607
by pgilman
Replied by pgilman on topic Wind Resource File - Kauai
The different WIND Toolkit API endpoints return data in different text formats. The format SAM recognizes is returned by the following endpoints:
The following, including the Hawaii offshore one use a different format:
The "SAM CSV Format for Wind" topic in SAM's Help system describes the format: samrepo.nrelcloud.org/help/weather_format_csv_wind.htm
You should be able to edit the Hawaii file or others from the endpoints with the different format to work with SAM.
Best regards,
Paul.
Code:
seasia-wtk-download
vietnam-wtk-download
wtk-download
mexico-wtk-download
offshore-ca-download
philippines-wtk-download
The following, including the Hawaii offshore one use a different format:
Code:
offshore-great-lakes-download
offshore-gulf-of-mexico-download
offshore-hawaii-download
offshore-mid-atlantic-download
offshore-north-atlantic-download
offshore-nw-pacific-download
The "SAM CSV Format for Wind" topic in SAM's Help system describes the format: samrepo.nrelcloud.org/help/weather_format_csv_wind.htm
You should be able to edit the Hawaii file or others from the endpoints with the different format to work with SAM.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman