4 Comments
User's avatar
Clifford Hansen's avatar

pvlib provides code, in pvlib.iotools, to read the NSRDB data into a dataframe, specifically in the psm3.py or psm4.py modules. The pvlib.iotools code should handle the column-to-pvlib variable translations and format the time index.

Expand full comment
Benedetto Grillone's avatar

That's handy! Thanks

Expand full comment
Uroš Poček's avatar

Fantastic blog I really learned a lot, thank you! Just one question, in weather_df you named the column air_temp and based on my research it should be temp_air, do you agree or am I missing something?

Expand full comment
Benedetto Grillone's avatar

Thanks Uroš for your comment! I did a little investigation and indeed the pvlib variable name for air temperature is "temp_air", not "air_temp". If you pass a dataframe with a different variable name, pvlib won’t throw an error but will default to a 20 °C temperature.

In this particular case, it doesn’t affect the results much, but in scenarios with larger temperature changes, it could make a bigger difference. Good catch!

Expand full comment