Timestamp alignment

In time series analysis, a timestamp marks a period in time that represents the average, sum, or similar aggregation of observations within that period. The placement of the timestamp depends on alignment: with hourly data, the average of all values from 10:00–11:00 could be timestamped at 10:00 (left-aligned), 10:30 (center-aligned), or 11:00 (right-aligned).

Examples of hourly irradiance data over one day with timestamps aligned left, center, and right:

image.png

image.png

image.png

Realignment

Timestamp alignment can be changed by shifting timestamps by half or a full period, without modifying the values themselves. Example: hourly left aligned to hourly center aligned by shifting timestamps by 30min to the right.

Resampling

Resampling in time series analysis is the process of changing the data’s frequency by either aggregating values over larger intervals, known as down-sampling (e.g. 30min to hourly), or by estimating new values at smaller intervals, known as up-sampling (e.g. hourly to .30min).

<aside> 💡

Only for center-aligned data the values at the original timestamps do not need to be adjusted before resampling. For left- or right-aligned data, direct resampling would produce points that no longer represent the underlying data.

</aside>

The images below show the result of up-sampling hourly data to 30-minute data. Left image: if the data is center-aligned, data points can be directly interpolated and still accurately represent the underlying data. Right image: if the data is left (or right) aligned, timestamps must first be shifted by half a period, interpolation performed, and then shifted back by half the new period; otherwise, the resampled values would not represent the data correctly.

image.png

image.png

Timestamp alignment in pvlib & pandas and datasources

This may create a systematic time shift between the data and the solar position calculation. Around midday the effect is small, since solar angles change slowly, but during the morning and evening when solar elevation changes rapidly, the misalignment can be significant. For example, a timestamp labeled 06:00 in Pandas represents the interval from 06:00 to 07:00, but pvlib evaluates it as if it were the midpoint at 06:00. This mismatch means that the solar angles no longer line up with the data they are supposed to represent, leading to errors in analyses that are most noticeable near sunrise and sunset.

Conventions and conversions in pvradar.sdk

Definition of timestamps grid

In pvradar, the timestamp grid is defined by: