captest.clearsky.get_tz_index
- captest.clearsky.get_tz_index(time_source, loc)
Create DatetimeIndex with timezone aligned with location dictionary.
Handles generating a DatetimeIndex with a timezone for use as an agrument to pvlib ModelChain prepare_inputs method or pvlib Location get_clearsky method.
- Parameters:
time_source (Dataframe, Series, or DatetimeIndex) – If passing a Dataframe or Series, the index of the dataframe will be used. If the index does not have a timezone, the timezone will be set using the timezone in the passed loc dictionary. If passing a DatetimeIndex with a timezone, it will be returned directly. If passing a DatetimeIndex without a timezone, the timezone will be set using the timezone in the passed loc dictionary.
- Return type:
DatetimeIndex with timezone