Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
etoni044 opened this issue Nov 8, 2023 · 0 comments
Open

Comments

@etoni044
Copy link
Collaborator

etoni044 commented Nov 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant