Skip to content

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

@etoni044

Description

@etoni044

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions