captest.util.detect_solar_noon

captest.util.detect_solar_noon(data, ghi_col='ghi_mod_csky', default='12:30')

Estimate a single representative solar-noon clock time from clear-sky GHI.

Groups data[ghi_col] by the clock time of each timestamp (hour and minute, ignoring date), takes the mean of each clock-time bucket, and returns the bucket with the largest mean formatted as "HH:MM".

Used by plotting helpers that split observations into morning and afternoon at solar noon.

Parameters:
  • data (pandas.DataFrame) – DataFrame with a DatetimeIndex. Must contain ghi_col for the idxmax-based detection to apply.

  • ghi_col (str, default "ghi_mod_csky") – Column to use as the clear-sky GHI signal. ghi_mod_csky is the column added to CapData.data by captest.io.load_data when a site dictionary is provided.

  • default (str, default "12:30") – Fallback clock-time string returned when ghi_col is absent from data or when data is empty.

Returns:

Clock time formatted as "HH:MM".

Return type:

str

Warns:

UserWarning – Emitted when ghi_col is missing from data.columns or the index is empty; the default is then returned.