# engineoilpressure1j1939 - SPN 100

## High-Level Explanation

This signal contains the gauge pressure of the lubricating oil in the engine, in kilopascals. Note that this signal has a resolution of 4 kPA, meaning all values are divisible by 4. Also note that this is the gauge pressure, meaning the pressure over the ambient atmospheric pressure, as in [engineexhaustbank1pressure1j1939-spn-1209](https://docs.dimo.org/dimo-explorer/field-descriptions-in-detail/j1939-heavy-truck/engine-signals/engineexhaustbank1pressure1j1939-spn-1209 "mention"). For reference, 1 kilopascal is equal to 0.145038 pounds per square inch (PSI), so the raw signal can be converted to PSI as in:

{% code overflow="wrap" lineNumbers="true" %}

```python
gdf['engineoilpressure1j1939_psi'] = gdf['engineoilpressure1j1939']*0.145038
```

{% endcode %}

## Enables

To determine some signal values when the maximum oil pressure, per day, the following code can be used. Here, the average speed for the 40 minute time window (20 minutes before and 20 minutes after the time with the highest engine pressure) is calculated:

<pre class="language-python" data-overflow="wrap" data-line-numbers><code class="lang-python">gdf['year_month_day'] = gdf['timestamp'].map(lambda x: x.strftime('%Y_%m_%d'))
avgs = []
<strong>for t in gdf.loc[gdf.groupby('year_month_day')['engineoilpressure1j1939'].idxmax().dropna().values]['timestamp']:
</strong>    avgs.append(gdf.loc[np.abs(gdf['timestamp'] - t) &#x3C; np.timedelta64(20,'m')]['wheelbasedvehiclespeedj1939'].mean())
</code></pre>

Similarly, here, the average engine speed (see [enginespeedj1939-spn-190-to-review](https://docs.dimo.org/dimo-explorer/field-descriptions-in-detail/j1939-heavy-truck/engine-signals/enginespeedj1939-spn-190-to-review "mention")) for a two hour time window (one hour before and one after the time with the highest engine pressure) is calculated:

{% code overflow="wrap" lineNumbers="true" %}

```python
avgs = []
for t in gdf.loc[gdf.groupby('year_month_day')['engineoilpressure1j1939'].idxmax().dropna().values]['timestamp']:
    avgs.append(gdf.loc[np.abs(gdf['timestamp'] - t) < np.timedelta64(1,'h')]['enginespeedj1939'].mean())
```

{% endcode %}

## Enabled By

## Known Quirks

## Visualizations with Explanations
