Skip to content

Commit

Permalink
Minor fixes to example codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwards, Paul authored and PjEdwards committed Feb 28, 2024
1 parent 9780352 commit 87b2970
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 242 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The response is composed of service-related informational fields and the results
}
```

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?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 protected]&api_key=DEMO_KEY</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The response is composed of service-related informational fields and the results
}
```

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?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 protected]&api_key=DEMO_KEY</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The response is composed of service-related informational fields and the results
}
```

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?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 protected]&api_key=DEMO_KEY</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The response is composed of service-related informational fields and the results
}
```

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?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 protected]&api_key=DEMO_KEY</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The response is composed of service-related informational fields and the results
}
```

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?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 protected]&api_key=DEMO_KEY</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
title: Southeast Asia V2
title: Southeast Asia (Original)
summary: Collect and download, as CSV, a configurable set of data fields from a multi-national collection of wind stations. This data represents wind-speed, temperature, and direction values at 10m, 40m, 80m, 100m, 120m, 160m, and 200m above the surface and air pressure at the surface, 100m, and 200m above the surface for the years 2017 to 2021. The model time resolution used was 15 minutes.
detail: This API is capable of creating very large downloadable archives. Unlike a typical API, the response to this provides a request acknowledgement. The real work of creating the requested downloadable archive will continue to run on the server side. When complete, and email will be sent to the email address provided in the initial request with a link to a file to download. In addition to this two step workflow, there is also an option for users who wish to download a single CSV file in direct response to an API request. The <em>.csv</em> format may be used to download a CSV directly. This feature is restricted to use with only a single POINT, for a single year at a time.
url: /api/wind-toolkit/v2/wind/seasia-wtk-download
deprecated: true
---

# <%= current_page.data.title %> <span class="url">(<%= current_page.data.url %>)</span>
Expand Down
49 changes: 23 additions & 26 deletions source/docs/wind/wind-toolkit/wtk-bangladesh-download.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ _NOTE: when using POST to submit a request the api_key must still be included as
<div class="doc-parameter-value-field"><strong>Default:</strong> false</div>
</td>
<td class="doc-parameter-description">
Pass true to add the email address to our list of recipients for the NSRDB mailing list.
Pass true to add the email address to our list of recipients for the Wind Toolkit mailing list.
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -207,56 +207,53 @@ Examples may not reflect this specific dataset.

### JSON Output Format

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.json?api_key={{API_KEY}}&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=10&[email protected]&wkt=POINT(-179.99 -15.94)</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.json?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 protected]</code></div>

```json
```JSON
{
"inputs": {
"body": {},
"params": {},
"query": {
"api_key": "{{API_KEY}}",
"attributes": "alpha,aod,ghi,dni,dhi",
"names": "2019",
"utc": "true",
"attributes": "winddirection_180m",
"names": "2017",
"utc": "false",
"leap_day": "true",
"interval": "10",
"email": "[email protected]",
"wkt": "POINT(-179.99 -15.94)"
"wkt": "POLYGON((-130.756145509839060 48.75520578942107,-130.75571635639668 48.75520578942107,-130.75571635639668 48.75485477666326,-130.75614550983906 48.75485477666326,-130.75614550983906 48.75520578942107))"
}
},
"metadata": {
"version": "2.0.0",
"resultset": {
"count": 1
"count": 1
}
},
"status": 200,
"outputs": {
"message": "File generation in progress. An email will be sent to [email protected] when the download is ready.",
"downloadUrl": "https://mapfiles.nrel.gov/data/solar/332e3704bbdc119e0fb9c6bdafbce0eb.zip"
"downloadUrl": "https://mapfiles.nrel.gov/data/wind/ebc9bbbc34f91c65ac50707d43176c6c.zip"
},
"errors": []
}
```


### CSV Output Format
Direct streaming of CSV data is supported for single location, single year only. The following response example is truncated after the first few rows of data.

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?api_key={{API_KEY}}&wkt=POINT(-179.99 -15.94)&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=30&[email protected]</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
Source,Location ID,City,State,Country,Latitude,Longitude,Time Zone,Elevation,Local Time Zone,Clearsky DHI Units,Clearsky DNI Units,Clearsky GHI Units,Dew Point Units,DHI Units,DNI Units,GHI Units,Solar Zenith Angle Units,Temperature Units,Pressure Units,Relative Humidity Units,Precipitable Water Units,Wind Direction Units,Wind Speed,Cloud Type -15,Cloud Type 0,Cloud Type 1,Cloud Type 2,Cloud Type 3,Cloud Type 4,Cloud Type 5,Cloud Type 6,Cloud Type 7,Cloud Type 8,Cloud Type 9,Cloud Type 10,Cloud Type 11,Cloud Type 12,Fill Flag 0,Fill Flag 1,Fill Flag 2,Fill Flag 3,Fill Flag 4,Fill Flag 5,Surface Albedo Units,Version
NSRDB,0,-,b'None',b'None',-15.94,-179.99,0,0,12,w/m2,w/m2,w/m2,c,w/m2,w/m2,w/m2,Degree,c,mbar,%,cm,Degrees,m/s,N/A,Clear,Probably Clear,Fog,Water,Super-Cooled Water,Mixed,Opaque Ice,Cirrus,Overlapping,Overshooting,Unknown,Dust,Smoke,N/A,Missing Image,Low Irradiance,Exceeds Clearsky,Missing CLoud Properties,Rayleigh Violation,N/A,unknown
Year,Month,Day,Hour,Minute,Alpha,AOD,GHI,DNI,DHI
2019,1,1,0,0,1.02,0.0102,0,0,0
2019,1,1,0,45,1.02,0.0111,0,0,0
2019,1,1,1,30,1.02,0.0111,0,0,0
2019,1,1,2,15,1.04,0.0122,0,0,0
2019,1,1,3,0,1.06,0.013000000000000001,0,0,0
2019,1,1,3,45,1.07,0.0134,0,0,0
2019,1,1,4,30,1.07,0.0134,0,0,0
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
80,-9,-9,-130.756,48.75498,b'Canada'
Year,Month,Day,Hour,Minute,wind direction at 180m (deg)
2017,1,1,0,0,347.18
2017,1,1,0,5,347.3
2017,1,1,0,10,347.40000000000003
2017,1,1,0,15,347.52
2017,1,1,0,20,347.66
2017,1,1,0,25,347.79
2017,1,1,0,30,348
2017,1,1,0,35,348.18
2017,1,1,0,40,348.35
```

### POST request example in Python
Expand All @@ -266,7 +263,7 @@ import requests

url = "http://developer.nrel.gov<%= current_page.data.url %>.json?api_key=yourapikeygoeshere"

payload = "api_key={{API_KEY}}&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=10&[email protected]&wkt=POINT(-179.99 -15.94)"
payload = "api_key={{API_KEY}}&attributes=winddirection_180m&names=2017&utc=true&leap_day=true&interval=60&[email protected]&wkt=POINT(-179.99 -15.94)"

headers = {
'content-type': "application/x-www-form-urlencoded",
Expand Down
49 changes: 23 additions & 26 deletions source/docs/wind/wind-toolkit/wtk-canada-5min-download.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ _NOTE: when using POST to submit a request the api_key must still be included as
<div class="doc-parameter-value-field"><strong>Default:</strong> false</div>
</td>
<td class="doc-parameter-description">
Pass true to add the email address to our list of recipients for the NSRDB mailing list.
Pass true to add the email address to our list of recipients for the Wind Toolkit mailing list.
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -207,56 +207,53 @@ Examples may not reflect this specific dataset.

### JSON Output Format

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.json?api_key={{API_KEY}}&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=10&[email protected]&wkt=POINT(-179.99 -15.94)</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.json?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 protected]</code></div>

```json
```JSON
{
"inputs": {
"body": {},
"params": {},
"query": {
"api_key": "{{API_KEY}}",
"attributes": "alpha,aod,ghi,dni,dhi",
"names": "2019",
"utc": "true",
"attributes": "winddirection_180m",
"names": "2017",
"utc": "false",
"leap_day": "true",
"interval": "10",
"email": "[email protected]",
"wkt": "POINT(-179.99 -15.94)"
"wkt": "POLYGON((-130.756145509839060 48.75520578942107,-130.75571635639668 48.75520578942107,-130.75571635639668 48.75485477666326,-130.75614550983906 48.75485477666326,-130.75614550983906 48.75520578942107))"
}
},
"metadata": {
"version": "2.0.0",
"resultset": {
"count": 1
"count": 1
}
},
"status": 200,
"outputs": {
"message": "File generation in progress. An email will be sent to [email protected] when the download is ready.",
"downloadUrl": "https://mapfiles.nrel.gov/data/solar/332e3704bbdc119e0fb9c6bdafbce0eb.zip"
"downloadUrl": "https://mapfiles.nrel.gov/data/wind/ebc9bbbc34f91c65ac50707d43176c6c.zip"
},
"errors": []
}
```


### CSV Output Format
Direct streaming of CSV data is supported for single location, single year only. The following response example is truncated after the first few rows of data.

<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?api_key={{API_KEY}}&wkt=POINT(-179.99 -15.94)&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=30&[email protected]</code></div>
<div class="doc-example-url"><code>GET <%= current_page.data.url %>.csv?wkt=POINT(-179.99 -15.94)&attributes=winddirection_180m&names=2017&utc=false&leap_day=true&[email protected]&api_key=DEMO_KEY</code></div>

```csv
Source,Location ID,City,State,Country,Latitude,Longitude,Time Zone,Elevation,Local Time Zone,Clearsky DHI Units,Clearsky DNI Units,Clearsky GHI Units,Dew Point Units,DHI Units,DNI Units,GHI Units,Solar Zenith Angle Units,Temperature Units,Pressure Units,Relative Humidity Units,Precipitable Water Units,Wind Direction Units,Wind Speed,Cloud Type -15,Cloud Type 0,Cloud Type 1,Cloud Type 2,Cloud Type 3,Cloud Type 4,Cloud Type 5,Cloud Type 6,Cloud Type 7,Cloud Type 8,Cloud Type 9,Cloud Type 10,Cloud Type 11,Cloud Type 12,Fill Flag 0,Fill Flag 1,Fill Flag 2,Fill Flag 3,Fill Flag 4,Fill Flag 5,Surface Albedo Units,Version
NSRDB,0,-,b'None',b'None',-15.94,-179.99,0,0,12,w/m2,w/m2,w/m2,c,w/m2,w/m2,w/m2,Degree,c,mbar,%,cm,Degrees,m/s,N/A,Clear,Probably Clear,Fog,Water,Super-Cooled Water,Mixed,Opaque Ice,Cirrus,Overlapping,Overshooting,Unknown,Dust,Smoke,N/A,Missing Image,Low Irradiance,Exceeds Clearsky,Missing CLoud Properties,Rayleigh Violation,N/A,unknown
Year,Month,Day,Hour,Minute,Alpha,AOD,GHI,DNI,DHI
2019,1,1,0,0,1.02,0.0102,0,0,0
2019,1,1,0,45,1.02,0.0111,0,0,0
2019,1,1,1,30,1.02,0.0111,0,0,0
2019,1,1,2,15,1.04,0.0122,0,0,0
2019,1,1,3,0,1.06,0.013000000000000001,0,0,0
2019,1,1,3,45,1.07,0.0134,0,0,0
2019,1,1,4,30,1.07,0.0134,0,0,0
SiteID,Site Timezone,Data Timezone,Longitude,Latitude,Country
80,-9,-9,-130.756,48.75498,b'Canada'
Year,Month,Day,Hour,Minute,wind direction at 180m (deg)
2017,1,1,0,0,347.18
2017,1,1,0,5,347.3
2017,1,1,0,10,347.40000000000003
2017,1,1,0,15,347.52
2017,1,1,0,20,347.66
2017,1,1,0,25,347.79
2017,1,1,0,30,348
2017,1,1,0,35,348.18
2017,1,1,0,40,348.35
```

### POST request example in Python
Expand All @@ -266,7 +263,7 @@ import requests

url = "http://developer.nrel.gov<%= current_page.data.url %>.json?api_key=yourapikeygoeshere"

payload = "api_key={{API_KEY}}&attributes=alpha,aod,ghi,dni,dhi&names=2019&utc=true&leap_day=true&interval=10&[email protected]&wkt=POINT(-179.99 -15.94)"
payload = "api_key={{API_KEY}}&attributes=winddirection_180m&names=2017&utc=true&leap_day=true&interval=60&[email protected]&wkt=POINT(-179.99 -15.94)"

headers = {
'content-type': "application/x-www-form-urlencoded",
Expand Down
Loading

0 comments on commit 87b2970

Please sign in to comment.