Skip to content

Constants

constants

Module used to store constants used in the package. These dictate some default behaviors and configurations.

ALLOWED_AVAILABILITY_OBJECT_TYPES = ['wind_turbine', 'solar_inverter'] module-attribute

Types of objects that can have availability values.

ALLOWED_ENERGY_LOSSES_OBJECT_MODELS = ['wind_farm', 'solar_farm'] module-attribute

Types of objects that can have energy losses values.

ALLOWED_ENERGY_OBJECT_TYPES = ['spe', 'solar_inverter', 'wind_turbine'] module-attribute

Types of objects that can have energy values.

ALLOWED_RESOURCE_OBJECT_MODELS = {'wind_speed': ['wind_farm'], 'solar_irradiance_poa': ['solar_farm']} module-attribute

Types of objects that can have resource values.

The keys are the names of the resource types and the values are the types of objects that can have that resource.

ALLOWED_TRACKER_AVAILABILITY_OBJECT_TYPES = ['tracker_motor'] module-attribute

Types of objects that can have tracker availability values.

BLADE_GAP_GAMESA_ALLOWED_SENSOR_NAMES = Literal['Blade A', 'Blade B', 'Blade C'] module-attribute

Names of the allowed sensors for Gamesa blade gap data.

DEFAULT_DATABASE = 'performance_db' module-attribute

Default database for the database connection.

DEFAULT_HOST = '100.64.141.14' module-attribute

Default host for the database connection.

DEFAULT_PASSWORD module-attribute

Default password for the database connection.

DEFAULT_PORT = 6432 module-attribute

Default port for the database connection. Using 6432 to go through pgBouncer.

DEFAULT_SCHEMA = 'performance' module-attribute

Default schema for the database connection.

DEFAULT_TIME_ZONE = 'America/Sao_Paulo' module-attribute

Default time zone for the database connection.

DEFAULT_USER = 'performance' module-attribute

Default user for the database connection.

DTYPES_CHECKS = {'BOOL': lambda x: isinstance(x, bool), 'INTEGER': lambda x: isinstance(x, int), 'JSON LIST': lambda x: isinstance(x, list) and all((isinstance(y, dict)) for y in x), 'JSON': lambda x: isinstance(x, dict), 'REAL': lambda x: isinstance(x, float), 'TEXT LIST': lambda x: isinstance(x, list) and all((isinstance(y, str)) for y in x), 'TEXT': lambda x: isinstance(x, str), 'TIMESTAMP': lambda x: isinstance(x, datetime), 'TIMESTAMPTZ': lambda x: isinstance(x, datetime)} module-attribute

Dict mapping the possible dtypes and a function that checks if a value is of that type.

The keys must be the name of the data types as they are in the database. The values must be a function that receives a value and returns True if it is of the given type.

VIBRATION_CONFIG = {'GE': {'models': ['GE103-1.X', 'GE100-1.X'], 'sensors': {'Vibration': {'Planetary': {'Normal': 'ge_cms_gearbox_sensor_1_high_resolution_spectrum', 'Envelope': 'ge_cms_gearbox_sensor_1_sync_enveloped_spectrum', 'ComponentType': 'Gearbox'}, 'LSS': {'Normal': 'ge_cms_gearbox_sensor_2_high_resolution_spectrum', 'Envelope': 'ge_cms_gearbox_sensor_2_sync_enveloped_spectrum', 'ComponentType': 'Gearbox'}, 'HSS': {'Normal': 'ge_cms_gearbox_sensor_3_high_resolution_spectrum', 'Envelope': 'ge_cms_gearbox_sensor_3_sync_enveloped_spectrum', 'ComponentType': 'Gearbox'}, 'Generator RS': {'Normal': 'ge_cms_generator_inboard_high_resolution_spectrum', 'Envelope': 'ge_cms_generator_inboard_sync_enveloped_spectrum', 'ComponentType': 'Generator'}, 'Generator GS': {'Normal': 'ge_cms_generator_outboard_high_resolution_spectrum', 'Envelope': 'ge_cms_generator_outboard_sync_enveloped_spectrum', 'ComponentType': 'Generator'}, 'Main Bearing': {'Normal': 'ge_cms_main_bearing_high_resolution_spectrum', 'Envelope': 'ge_cms_main_bearing_sync_enveloped_spectrum', 'ComponentType': 'Main Shaft'}, 'Tower Sway Axial': {'Normal': 'ge_cms_tower_sway_ts_axial_spectrum', 'Envelope': None, 'ComponentType': 'Tower'}, 'Tower Sway Transverse': {'Normal': 'ge_cms_tower_sway_ts_transverse_spectrum', 'Envelope': None, 'ComponentType': 'Tower'}}}}, 'Gamesa': {'models': ['G97-2.07'], 'sensors': {'Vibration': {'1 - Generator GS - Radial': {'Low': 'cms_sensor_01_time_series_low', 'High': 'cms_sensor_01_time_series_high', 'Filter': 'cms_sensor_01_time_series_filter'}, '2 - Planetary - Axial': {'Low': 'cms_sensor_02_time_series_low', 'High': 'cms_sensor_02_time_series_high', 'Filter': 'cms_sensor_02_time_series_filter'}, '3 - Main Bearing GS - Radial': {'Low': 'cms_sensor_03_time_series_low', 'High': 'cms_sensor_03_time_series_high', 'Filter': 'cms_sensor_03_time_series_filter'}, '4 - HSS - Radial': {'Low': 'cms_sensor_04_time_series_low', 'High': 'cms_sensor_04_time_series_high', 'Filter': 'cms_sensor_04_time_series_filter'}, '5 - Main Bearing RS - Axial': {'Low': 'cms_sensor_05_time_series_low', 'High': 'cms_sensor_05_time_series_high', 'Filter': 'cms_sensor_05_time_series_filter'}, '6 - HSS - Axial': {'Low': 'cms_sensor_06_time_series_low', 'High': 'cms_sensor_06_time_series_high', 'Filter': 'cms_sensor_06_time_series_filter'}, '7 - Generator RS - Axial': {'Low': 'cms_sensor_07_time_series_low', 'High': 'cms_sensor_07_time_series_high', 'Filter': 'cms_sensor_07_time_series_filter'}, '8 - Generator RS - Radial': {'Low': 'cms_sensor_08_time_series_low', 'High': 'cms_sensor_08_time_series_high', 'Filter': 'cms_sensor_08_time_series_filter'}}, 'Blade Gap': {'Blade A': {'Acceleration - X': 'gamesa_blade_a_gap_accel_x', 'Acceleration - Y': 'gamesa_blade_a_gap_accel_y', 'Position - X': 'gamesa_blade_a_gap_pos_x', 'Position - Y': 'gamesa_blade_a_gap_pos_y'}, 'Blade B': {'Acceleration - X': 'gamesa_blade_b_gap_accel_x', 'Acceleration - Y': 'gamesa_blade_b_gap_accel_y', 'Position - X': 'gamesa_blade_b_gap_pos_x', 'Position - Y': 'gamesa_blade_b_gap_pos_y'}, 'Blade C': {'Acceleration - X': 'gamesa_blade_c_gap_accel_x', 'Acceleration - Y': 'gamesa_blade_c_gap_accel_y', 'Position - X': 'gamesa_blade_c_gap_pos_x', 'Position - Y': 'gamesa_blade_c_gap_pos_y'}}}}} module-attribute

Configurations related to vibration data acquisition.

The keys are the names of the manufacturers. The values are dictionaries with the following keys:

  • models: list of models of turbines from the manufacturer
  • sensors: dictionary with the sensors that can be used to acquire vibration data. There are two main keys:
    • Vibration: for vibration data
      • For GE turbines, for each sensor the keys are:
        • Normal: name of the raw data definition for the normal spectrum
        • Envelope: name of the raw data definition for the enveloped spectrum
        • ComponentType: type of component that the sensor is related to
      • For Gamesa turbines, for each sensor the keys are:
        • Low: name of the raw data definition for the low acquisition frequency time series
        • High: name of the raw data definition for the high acquisition frequency time series
        • Filter: name of the raw data definition for the filtered time series
    • Blade Gap: for blade gap data
      • For Gamesa turbines, for each sensor the keys are:
        • Acceleration - X: name of the raw data definition for the acceleration in the X axis
        • Acceleration - Y: name of the raw data definition for the acceleration in the Y axis
        • Position - X: name of the raw data definition for the position in the X axis
        • Position - Y: name of the raw data definition for the position in the Y axis

VIBRATION_GAMESA_ALLOWED_SENSOR_NAMES = Literal['1 - Generator GS - Radial', '2 - Planetary - Axial', '3 - Main Bearing GS - Radial', '4 - HSS - Radial', '5 - Main Bearing RS - Axial', '6 - HSS - Axial', '7 - Generator RS - Axial', '8 - Generator RS - Radial'] module-attribute

Names of the allowed sensors for vibration data in Gamesa turbines.

VIBRATION_GE_ALLOWED_SENSOR_NAMES = Literal['Planetary', 'LSS', 'HSS', 'Generator RS', 'Generator GS', 'Main Bearing', 'Tower Sway Axial', 'Tower Sway Transverse'] module-attribute

Names of the allowed sensors for vibration data in GE turbines.

WATERFALL_LOSSES = ['Availability BoP', 'Availability Asset', 'Asset Curtailment', 'Park Curtailment'] module-attribute

Waterfall KPI Losses (with considered order).