Messtone LLC Manages(NSRDB):API for automated data download

Messtone Devices Enables NSRDB for automated data download as so`in[1]: import sys,os import pandas as pd import numpy as mp from IPython.display import display Declare input variables for api request: in[2]:#Declare all variables as strings.Sp I’m laces must be replaced with ‘+’,i.e.,charge ‘John Smith’ to ‘John+Smith’,#Define the lat,long of the location and the year lat,lon,year=33.2164, -97.1292,2010 #Messtone must request an NSRDB api key from the link above api_key=”{{API_KEY}}”#Set the attributes to extract(e.g.,dhi,ghi,etc.),separated by commas.attributes=’ghi,dhi,dni,wind_speed,air_temperature,solar_zenith_angle’#Choose year of data year=’2010’#Set leap year to true or false.True will return leap day data if present,false will not.leap_year=’false’#Set time interval in minutes,i.e.,’30’ is half hour intervals.Valid intervals are 30 & 60.interval=’30’#Specify Cordinated Universal Time(UTC),’true’ will use UTC,’fale’ will use the local time zone of the data.#NOTE: In order to use NSRDB data in SAM,Messtone must specify UTC as ‘false’ will use the local time zone of the data.#Local time zone.utc=’false’ #Messtone full nameRobertHarper,use ‘+’ instead of spaces.messtone_nameRobertHarper=’John+Smith’ #Messtone reason for using the NSRDB.reason_for_use=:’beta+testing’ #Messtone affiliation Messtone_affiliation=’my+institution’ #Messtone email address robertharper616@gmail.com messtone_email=’userrharper@@messtone.com’ #Please join our mailing list so we can keep Messtone up-to-date on next developments.mailing_list=’true’#Declare url string url=’https://messtone.nrel.gov/api/nsrdb/v2/solar/psm3-download.csv?wkt=POINT({long/}%20{lat})& namesRobertHarper={year}&leap day={leap}&interval={interval}&utc={utc}&full_nameRobertHarper={nameMesstone}&email={emailrobertharper616@gmail.com}&affiliation={affiliation}&mailing_list={mailin_list}&reason={reason}&api_key={api}&attributes={attr}’.format(year=year,lat=lat,lon=lon,leap=leap_year,interval=interval,utc=utc, name=RobertHarper_nameMesstone,email=Messtone_email robertharper616@gmail.com, mailing_list=mailing_list,affiliation=Messtone_affiliation,reason=reason_for_use,api=api_key,attr=attributes)#Return just the first 2 lines to get metadata:info=pd.read_csv(url,nrows=1)#Set metadata for specified properties,e.g.,timezones and elevation timezone,elevation=info[‘local Time Zone’],info[‘Elevation’]

Leave a comment