diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26a582c..d592958 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: files: requirements-dev.txt - repo: https://github.com/keewis/blackdoc - rev: v0.3.9 + rev: v0.4.1 hooks: - id: blackdoc @@ -39,7 +39,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.12 + rev: v0.12.2 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/README.md b/README.md index 11794b3..65e0091 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ and then, from pathlib import Path import ctd -path = Path('tests', 'data', 'CTD') -fname = path.joinpath('g01l06s01.cnv.gz') +path = Path("tests", "data", "CTD") +fname = path.joinpath("g01l06s01.cnv.gz") down, up = ctd.from_cnv(fname).split() -ax = down['t090C'].plot_cast() +ax = down["t090C"].plot_cast() ``` ![Bad Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_01.png) @@ -45,22 +45,19 @@ ax = down['t090C'].plot_cast() We can do [better](https://www.go-ship.org/Manual/McTaggart_et_al_CTD.pdf): ```python -temperature = down['t090C'] +temperature = down["t090C"] fig, ax = plt.subplots(figsize=(5.5, 6)) temperature.plot_cast(ax=ax) -temperature.remove_above_water()\ - .despike()\ - .lp_filter()\ - .press_check()\ - .interpolate(method='index', - limit_direction='both', - limit_area='inside')\ - .bindata(delta=1, method='interpolate')\ - .smooth(window_len=21, window='hanning') \ - .plot_cast(ax=ax) -ax.set_ylabel('Pressure (dbar)') -ax.set_xlabel('Temperature (°C)') +temperature.remove_above_water().despike().lp_filter().press_check().interpolate( + method="index", limit_direction="both", limit_area="inside" +).bindata(delta=1, method="interpolate").smooth( + window_len=21, window="hanning" +).plot_cast( + ax=ax +) +ax.set_ylabel("Pressure (dbar)") +ax.set_xlabel("Temperature (°C)") ``` ![Good Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_02.png)