Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
860 B
2
Indexable
'''
*Version: 2.0 Published: 2021/03/09* Source: [NASA POWER](https://power.larc.nasa.gov/)
POWER API Multi-Point Download
This is an overview of the process to request data from multiple data points from the POWER API.
'''

import os, json, requests

output = r""
base_url = r"https://wps.neweuropeanwindatlas.eu/api/mesoscale-atlas/v1/get-data-point?latitude=61.301902&longitude=10.458984&height=100&variable=WS10_mean&variable=rho_mean&variable=power_density_mean"


api_request_url = base_url

response = requests.get(url=api_request_url, verify=True, timeout=30.00)
with open('newa.nc', 'wb') as file:
    file.write(response.content)
print(response.content)

import netCDF4
import numpy as np

f = netCDF4.Dataset('newa.nc')

# print(f)

print(f.variables.keys()) # get all variable names
print(f.variables['rho_mean'])
print(f.variables['rho_mean'][:])