sunpeek.components.physical.Plant#
- class sunpeek.components.physical.Plant(name=None, owner=None, operator=None, description=None, plant_measurement_accuracy=None, location_name=None, latitude=None, longitude=None, elevation=None, fluid_solar=None, fluidvol_total=None, arrays=None, sensor_map=None, raw_sensors=None, **kwargs)#
Bases:
Component
Implements large solar thermal plant as the overarching component on which the kernel methods are applied.
- Variables:
name (
str
) – Plant name. Must be unique within HarvestIT ‘plant’ database.owner (
str
, optional) – Name of plant owner.operator (
str
, optional) – Name of plant operator.description (
str
, optional) – Description of the plant, its components, hydraulic setup and other relevant information.location_name (
str
, optional) – Name of the location. Example: ‘Graz, Austria’latitude (
pint Quantity
) – Geographical latitude. Positive is north of the equator. See `pvlib Location`_.longitude (
pint Quantity
) – Geographical longitude. Positive is east of the prime meridian. See `pvlib Location`_.elevation (
pint Quantity
, optional) – Location elevation, e.g. Q(440, ‘m’). If available, used to improve pvlib’s solar position calculation.data_upload_defaults (
DataUploadDefaults,
) – Defaults for parsing raw data files for this plant. Defaults to an all null DataUploadDefaultsfluid_solar (
Fluid object
) – Fluid in the solar circuit. Optional for the PC (Performance Check) method (but stated in the standard report, see Annex A1 in ISO standard 24194), required for the D-CAT (Dynamic Collector Array Test) method.fluidvol_total (
pint Quantity
, optional) – Total fluid content of the solar side (including all pipes, collectors etc).tp (
Sensor
) – Total thermal power of the plant, including all its collector arrays.vf (
Sensor
) – Total volume flow in the solar circuit of the plant, for all collector arrays.mf (
Sensor
) – Total mass flow in the solar circuit of the plant, for all collector arrays.te_amb (
Sensor
) – Ambient air temperature representative for the plant.ve_wind (
Sensor
, optional) – Wind speed / wind velocity representative for the plant.rh_amb (
Sensor
, optional) – Ambient relative humidity representative for the plant.te_dew_amb (
Sensor
, optional, orvirtual Sensor
) – Dew point temperature representative for the plant. Is calculated as a virtual sensor if both te_amb and rh_amb have data (are not None).pr_amb (
Sensor
, optional) – Ambient air pressure representative for the plant.te_in (
Sensor
, optional) – Inlet / return temperature of the plant; this is the temperature after the heat exchanger, sent back to the collector arrays.te_out (
Sensor
, optional) – Outlet / flow temperature of the plant; this is the temperature received by all collector arrays together, before the fluid enters the heat exchanger.rd_ghi (
virtual Sensor
) – Global horizontal irradiance. Calculated by a radiation model from in_global, in_beam, in_diffuse, in_dni.rd_bhi (
virtual Sensor
) – Direct / beam horizontal irradiance. Calculated by a radiation model from in_global, in_beam, in_diffuse, in_dni.rd_dhi (
virtual Sensor
) – Diffuse horizontal irradiance. Calculated by a radiation model from in_global, in_beam, in_diffuse, in_dni.sun_azimuth (
virtual Sensor
) – Solar azimuth angle.sun_zenith (
virtual Sensor
) – Solar zenith angle.sun_apparent_zenith (
virtual Sensor
) – Apparent solar zenith angle.sun_elevation (
virtual Sensor
) – Solar elevation / altitude angle.sun_apparent_elevation (
virtual Sensor
) – Apparent solar elevation / altitude angle.rd_dni (
virtual Sensor
) – Direct normal irradiance. Calculated by a radiation model from in_global, in_beam, in_diffuse, in_dni.rd_dni_extra (
virtual Sensor
) – Extraterrestrial solar radiation.linke_turbidity (
virtual Sensor
) – Linke turbidity calculated for specific location and date.rd_ghi_clearsky (
virtual Sensor
) – Clear sky global horizontal irradiance based on Linke turbidity, calculated with pvlib.clearsky.ineichenrd_dni_clearsky (
virtual Sensor
) – Clear sky direct normal irradiance (DNI) based on Linke turbidity, calculated with pvlib.clearsky.ineichenrel_airmass (
virtual Sensor
) – Relative airmass.abs_airmass (
virtual Sensor
) – Absolute airmass.calculate (These sensors start with _ because they don't really belong to the plant, they are just input Sensor to)
.rd_dhi (the proper Plant.rd_ghi, .rd_bhi,)
in_global (
Sensor
, optional) – Global radiation sensor to be used to calculate horizontal radiation components for the plant. The sensor may be installed at a non-zero tilt angle, in that case the horizontal radiation components will be calculated by a radiation model.in_beam (
Sensor
, optional) – Direct / beam radiation sensor to be used to calculate horizontal radiation components for the plant. The sensor may be installed at a non-zero tilt angle, in that case the horizontal radiation components will be calculated by a radiation model.in_diffuse (
Sensor
, optional) – Diffuse radiation sensor to be used to calculate horizontal radiation components for the plant. The sensor may be installed at a non-zero tilt angle, in that case the horizontal radiation components will be calculated by a radiation model.in_dni (
Sensor
, optional) – Direct normal irradiance (DNI) sensor to be used to calculate horizontal radiation components for the plant.
References
Methods
__init__
([name, owner, operator, ...])A simple constructor that allows initialization from kwargs.
add_array
(arrays)Convenience method for adding items to plant.arrays.
add_component_attr
(name[, unit, minimum, ...])add_operational_event
(start[, end, tz, ...])all_subclasses
([c])define_component_attrs
()delete_all_data
()get_component_attribute
(name)get_default_unit
(name)Return default unit of a class attribute defined as ComponentParam.
get_raw_names
([include_virtuals, only_virtuals])get_raw_sensor
(raw_name[, raise_if_not_found])Get component's slot names for (possibly or always) real (not virtual) sensors
has_virtual_slot_named
(slot_name)Assert component has a (possibly or always) virtual sensor slot named slot_name.
is_attrib_missing
(attrib_name)Return True if component attribute is None or not a ComponentParam holding a Quantity.
is_ignored
(timestamp)Checks if a timestamp is in an ignored range
is_real_sensor_missing
(slot_name, check_mode)Like is_sensor_missing, but additionally checks if sensor in named slot is real (not virtual).
is_sensor_missing
(slot_name, check_mode)Return True if component slot has no sensor mapped or sensor is not ready for calculations.
map_sensor
(sensor, slot_name)Maps sensor to slot_name of given component, including some sanity checks.
map_vsensor
(slot_name, feedback)Create virtual Sensor and map it to component.slot_name, or map None if it cannot be calculated.
register_callback
(callback_type, func)reset_cache
()set_component_attribute
(name, value, array_type)set_default_context
([datasource])Create and set default context as Context with parquet datasource.
set_sensors
(**kwargs)Maps one or multiple sensors (by calling
map_sensor()
) and handles configuring virtual sensors.update_sensors
(is_remove)- add_array(arrays)#
Convenience method for adding items to plant.arrays. Equivalent to plant.arrays += array or plant.arrays.append(array).
- add_operational_event(start, end=None, tz=None, description=None, ignored_range=False)#
- Parameters:
start (
A datetime object
, or a string. If the string does not contain a df_timezone like'2022-1-1 00:00+1'
,
) – then the tz argument must also be specified.end (
A datetime object
, or a string. If the string does not contain a df_timezone like'2022-1-2 00:00+1'
,
) – then the tz argument must also be specified.tz (A df_timezone string like
'Europe/Vienna'
orany pytz time zone
,like pytz.FixedOffset(60)
)description (
str
) – A description of the event or reason for ignored range.ignored_range (
bool
) – If data in the period specified in the event should be ignored
- Return type:
- classmethod get_default_unit(name)#
Return default unit of a class attribute defined as ComponentParam.
- Return type:
- classmethod get_real_slots()#
Get component’s slot names for (possibly or always) real (not virtual) sensors
- has_virtual_slot_named(slot_name)#
Assert component has a (possibly or always) virtual sensor slot named slot_name.
- property ignored_ranges: List[Interval]#
Gets a list of time ranges to be ignored from the plant’s
operational_events
- is_attrib_missing(attrib_name)#
Return True if component attribute is None or not a ComponentParam holding a Quantity.
- Return type:
- is_ignored(timestamp)#
Checks if a timestamp is in an ignored range
- Parameters:
timestamp (
datetime.datetime
orpandas.Timestamp
orstr
)- Return type:
- is_real_sensor_missing(slot_name, check_mode)#
Like is_sensor_missing, but additionally checks if sensor in named slot is real (not virtual).
- Return type:
- is_sensor_missing(slot_name, check_mode)#
Return True if component slot has no sensor mapped or sensor is not ready for calculations.
- Return type:
- map_sensor(sensor, slot_name)#
Maps sensor to slot_name of given component, including some sanity checks.
- map_vsensor(slot_name, feedback)#
Create virtual Sensor and map it to component.slot_name, or map None if it cannot be calculated.
- Parameters:
slot_name (
str
,slot / channel name
ofthe component self
towhich the virtual sensor will be mapped.
)feedback (
CoreMethodFeedback
,problems reported at config time
,prior
tovsensor calculation.
)
- set_default_context(datasource=None)#
Create and set default context as Context with parquet datasource. Does not upload or affect any data.
- set_sensors(**kwargs)#
Maps one or multiple sensors (by calling
map_sensor()
) and handles configuring virtual sensors.