paint.util.utils

Functions

calculate_azimuth_and_elevation(→ tuple[numpy.ndarray, ...)

Calculate the azimuth and elevation given sun positions.

heliostat_id_to_name(→ str)

Convert a heliostat id to its name.

localize_utc(→ pandas.Series)

Parse local datetime strings and localize them as UTC.

localize_utc_single(→ str)

Parse a single UTC datetime string and return it in the appropriate format, without time zone conversion.

to_utc_single(→ str)

Parse a single local datetime string and convert to UTC.

Module Contents

paint.util.utils.calculate_azimuth_and_elevation(df: pandas.DataFrame) tuple[numpy.ndarray, numpy.ndarray]

Calculate the azimuth and elevation given sun positions.

Parameters

dfpd.DataFrame

The pandas dataframe containing the sun positions.

Returns

np.ndarray

The calculated azimuth in degrees.

np.ndarray

The calculated elevation in degrees.

paint.util.utils.heliostat_id_to_name(heliostat_id: int | str) str

Convert a heliostat id to its name.

Parameters

heliostat_idint | str

The heliostat ID to be converted.

Returns

str

The heliostat name derived from the heliostat ID.

paint.util.utils.localize_utc(time_series: pandas.Series) pandas.Series

Parse local datetime strings and localize them as UTC.

Parameters

time_seriespd.Series

The series containing the local datetime strings.

Returns

pd.Series

The corresponding UTC datetime objects.

paint.util.utils.localize_utc_single(datetime_str: str, file_name_format: bool = False) str

Parse a single UTC datetime string and return it in the appropriate format, without time zone conversion.

Parameters

datetime_strstr

UTC datetime string.

file_name_formatbool

Whether the file name format for the time should be used or not (Default: False).

Returns

str

The formatted UTC datetime string.

paint.util.utils.to_utc_single(datetime_str: str, local_tz: str = 'Europe/Berlin', file_name_format: bool = False) str

Parse a single local datetime string and convert to UTC.

Parameters

datetime_strstr

Local datetime.

local_tzstr

Local timezone (Default: Europe/Berlin).

file_name_formatbool

Whether the file name format for the time conversion should be used or not (Default: False).

Returns

str

The corresponding UTC datetime string.