NREL / bifacialvf

Bifacial PV View Factor model for system performance calculation
https://bifacialvf.readthedocs.io
Other
29 stars 18 forks source link

Using PSM3 TMY weather data from NSRDB - error & temporary solution #55

Open etoni044 opened 10 months ago

etoni044 commented 10 months ago

I have encountered an issue when trying to use TMY data downloaded from the NSRDB in PSM3 format. I am attempting to load the data with readInputTMY:

TMYfile = 'C:\\Users\\etonita\\Documents\\WeatherFiles\\Golden_CO_tmy-2022.csv'
myTMY3, meta = bifacialvf.readInputTMY(TMYfile)

This results in the following error:

File ~\AppData\Local\anaconda3\Lib\site-packages\pvlib\iotools\tmy.py:205 in read_tmy3 meta['altitude'] = float(meta['altitude']) ValueError: could not convert string to float: 'Longitude'

A work-around I have implemented is to use pvlib to load in the TMY data and rename the meta variables according to what bifacialvf is looking for:

myTMY3, meta = pvlib.iotools.read_psm3(TMYfile,map_variables=True)
meta['TZ']=meta['Time Zone']
meta['city']=meta['City']
myTMY3["DNI"]=myTMY3["dni"]
myTMY3["DHI"]=myTMY3["dhi"]
myTMY3["GHI"]=myTMY3["ghi"]

This solves the issue.