Skip to content

Commit 1af575b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 272cf9c commit 1af575b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,31 @@ and then,
3333
from pathlib import Path
3434
import ctd
3535

36-
path = Path('tests', 'data', 'CTD')
37-
fname = path.joinpath('g01l06s01.cnv.gz')
36+
path = Path("tests", "data", "CTD")
37+
fname = path.joinpath("g01l06s01.cnv.gz")
3838

3939
down, up = ctd.from_cnv(fname).split()
40-
ax = down['t090C'].plot_cast()
40+
ax = down["t090C"].plot_cast()
4141
```
4242

4343
![Bad Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_01.png)
4444

4545
We can do [better](https://www.go-ship.org/Manual/McTaggart_et_al_CTD.pdf):
4646

4747
```python
48-
temperature = down['t090C']
48+
temperature = down["t090C"]
4949

5050
fig, ax = plt.subplots(figsize=(5.5, 6))
5151
temperature.plot_cast(ax=ax)
52-
temperature.remove_above_water()\
53-
.despike()\
54-
.lp_filter()\
55-
.press_check()\
56-
.interpolate(method='index',
57-
limit_direction='both',
58-
limit_area='inside')\
59-
.bindata(delta=1, method='interpolate')\
60-
.smooth(window_len=21, window='hanning') \
61-
.plot_cast(ax=ax)
62-
ax.set_ylabel('Pressure (dbar)')
63-
ax.set_xlabel('Temperature (°C)')
52+
temperature.remove_above_water().despike().lp_filter().press_check().interpolate(
53+
method="index", limit_direction="both", limit_area="inside"
54+
).bindata(delta=1, method="interpolate").smooth(
55+
window_len=21, window="hanning"
56+
).plot_cast(
57+
ax=ax
58+
)
59+
ax.set_ylabel("Pressure (dbar)")
60+
ax.set_xlabel("Temperature (°C)")
6461
```
6562

6663
![Good Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_02.png)

0 commit comments

Comments
 (0)