pvdeg.weather.roll_tmy#

pvdeg.weather.roll_tmy(weather_df: DataFrame, meta: dict) DataFrame[source]#

Wrap ends of TMY UTC DataFrame to align with local time.

Aligns with local time based on timezone offset.

Parameters:#

weather_dfpd.DataFrame

The input DataFrame containing TMY data with a UTC datetime index.

metadict

Metadata dictionary containing at least the ‘tz’ key, representing timezone offset in hours (e.g., -8 for UTC-8).

Returns:#

pd.DataFrame

The rolled DataFrame aligned to local times with a new datetime index spanning a typical year.

Raises:#

ValueError

If the timezone offset is not a multiple of the data frequency or if the frequency cannot be inferred.