sluyspy.solar_panels module
Solar-panel functions for the sluyspy package
- sluyspy.solar_panels.read_detailed_log(file_name='Current/detailed-log.csv', last_only=None, header=None, sun_position=False, rem_cols=True, no_p0rows=False, no_elec=False, no_cond=True)[source]
Read solar-panel detailed-log.csv and select the useful data.
- Parameters:
file_name (str) – Name of the input file (optional; default=None -> detailed-log.csv).
header (int) – Number of lines to consider as header and skip (optional; default: 0).
last_only (int) – Number of last lines to read. This tails the last lines into a separate file and reads that.
sun_position (bool) – Add (compute) Sun position to the data (slow! - optional; default: False).
rem_cols (bool) – Remove default columns (constants, duplicates, uninteresting).
no_p0rows (bool) – Remove rows without power (P=0; Relay=closed; Cond!=OK).
no_elec (bool) – Remove electricity details (some P,V,I, f).
no_cond (bool) – Remove condition/status columns (Cond, Relay, Tinv).
- Returns:
DataFrame containing solar-panel data.
- Return type:
(pandas.DataFrame)
- sluyspy.solar_panels.write_day_file(df, subdir='', prefix=None, ext='csv', verbosity=0)[source]
Write one day of (e.g.) minutely solar-panel data to daily file named ‘subdir/prefix-yyyymmdd.ext’.
- Parameters:
df (pandas.DataFrame) – Pandas DataFrame with columns datetime, Pac and Etot.
subdir (str) – Subdirectory to save file in, with trailing slash.
prefix (str) – File name prefix (defaults to name of the plant, followed by a hyphen).
ext (str) – File extension to use.
verbosity (int) – Verbosity (0-2; defaults to 0).