PVDegradationTools icon indicating copy to clipboard operation
PVDegradationTools copied to clipboard

CSV file with UTC Time Zone interpreted as local time in pvdeg.weather.read

Open alecote opened this issue 8 months ago • 1 comments

First of all, I would like to say that this is all great work!

Context: Using PVDegradationTools for calculating standoff distances in the context of IEC TS 63126. The tmy-2023 data used comes from a CSV file downloaded using NSRDB Viewer. The option "Convert UTC to Local Time" in NSRDB was NOT selected when downloading the file.

Issue: When using pvdeg.weather.read(file, 'CSV'), the file is read and analysis can proceed but the Time Zone metadata is not accounted for, leading to bad datetimes which then leads to bad sun positions (i.e. peak irradiance at 19h30 UTC-7 instead of 12h30 UTC-7). The issue disappears if the user selects the option "Convert UTC to Local Time" in NSRDB when downloading the CSV file.

When using pvdeg.weather.read(file, 'PSM'), the code works and the issue does not appear. Looking at the code, it looks like weather.csv_read() does not attempt to adjust the time based on the timezone.

Based on the tutorials, I could not tell which file type to use with CSV files downloaded using NSRDB Viewer.

Suggestions: 1- Provide more guidance in the tutorials and documentation when reading local files, such as the proper file type to input in weather.read() depending on the data source such as NSRDB. Should it be PSM? CSV? 2- Modify the weather.csv_read() function to look for the timezone and local time metadata and adjust the datetimes accordingly.

EDIT: I have also realized that this may not be the only issue with using data downloaded from NSRDB. There is no "wind_height" metadata, which means that temperature.temperature() discards the user input wind_factor and sets the wind_speed_factor to 1.

alecote avatar May 07 '25 19:05 alecote

Thank you for raising this issues and the suggestions. The time zone conversion has been an issue in the past and we've started work on adding some functionality to transform UTC files to local time. We'll also update the documentation, once this is available.

I'll be looking into the wind_height issue and update here as soon as there is a fix available.

martin-springer avatar May 09 '25 17:05 martin-springer