Bearing Frequencies
Bearing Frequencies reads defines a common interface for reading bearing frequencies data from the data source.
It is used by the AssetDataReader classes to read bearing frequencies data for the asset, and by the Measurement class to read the bearing frequencies data for the single measurement without the asset context.
The interface requires only one method to be implemented:
get_bearing_data(manufacturer: str, model: str)
where manufacturer and model are the bearing manufacturer and model respectively.
There are two main implementations of that interface: PowertrainBearingFrequenciesDatabase and LocalBearingFrequenciesDatabase. Check [API] bellow for more details.
API
smartanalytics.raw_data.readers.bearing_frequencies.IBearingFrequenciesDatabase
Bases: ABC
This is an interface for a database that provides bearing frequencies.
smartreport.v3.readers.bearing_frequencies.powertrain.PowertrainBearingFrequenciesDatabase
Bases: IBearingFrequenciesDatabase
Implementation of the IBearingFrequenciesDatabase interface to provide bearing frequency data by querying the Powertrain Report API. This is done via the PowertrainReportAPIClient, which is passed in during initialization.
It includes logic to remove certain suffixes in the bearing model number and to use a default manufacturer when the provided manufacturer is not recognized. The bearing frequency data is cached to optimize performance for repeated queries.
get_bearing_frequencies(manufacturer, model)
Gets the bearing frequencies for a given manufacturer and model. If the manufacturer is not recognized, it will use the default manufacturer if it is set. It also strips certain suffixes from the model number before querying the API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manufacturer
|
str
|
The name of the bearing manufacturer. If this is not recognized, the default manufacturer will be used if set. |
required |
model
|
str
|
The model number of the bearing. Certain suffixes (e.g., "ZZ") will be stripped from the end of the model number |
required |
Returns:
| Type | Description |
|---|---|
BearingFreqData
|
A BearingFreqData object containing the bearing frequencies (BSF, BPFI, BPFO) for the specified |
BearingFreqData
|
manufacturer and model. If no data is found, an empty BearingFreqData object will be returned. |
smartanalytics.raw_data.readers.bearing_frequencies.LocalBearingFrequenciesDatabase
Bases: IBearingFrequenciesDatabase