Skip to content

Commit 18c46fc

Browse files
[DOC] Update TOC with stages and steps (#17)
1 parent b1f5792 commit 18c46fc

4 files changed

Lines changed: 124 additions & 16 deletions

File tree

docs/source/index.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ Contents
2323
:caption: Methods for Instruments
2424

2525
Data Acquisition <methods/acquisition>
26-
Standardisation <methods/standardisation>
27-
Trim to Deployment <methods/trimming>
28-
Automatic QC <methods/auto_qc>
29-
Apply Calibration <methods/calibration>
26+
Standardisation (Stage 1) <methods/standardisation>
27+
Trim to Deployment (Stage 2) <methods/trimming>
28+
Automatic QC (Stage 3) <methods/auto_qc>
29+
Apply Calibration (Stage 4) <methods/calibration>
3030
Convert to OceanSites <methods/conversion>
3131

3232
.. toctree::
3333
:maxdepth: 1
3434
:caption: Methods for Moorings
3535

36-
Grid in Time <methods/time_gridding>
37-
Grid Vertically <methods/vertical_gridding>
38-
Concatenate Deployments <methods/concatenation>
36+
Grid in Time (Step 1) <methods/time_gridding>
37+
Grid Vertically (Step 2) <methods/vertical_gridding>
38+
Combine Deployments (Step 3) <methods/concatenation>
3939

4040
.. toctree::
4141
:maxdepth: 1

docs/source/methods/time_gridding.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@ The time gridding processor includes several quality control features:
247247
- **Comprehensive logging**: Detailed processing logs for debugging and validation
248248

249249
7. Time-Domain Filtering Details
250-
=================================
251-
252-
7.1. Filtering Applications
253-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250+
----------------------------------------------
254251

255252
Time-domain filtering is particularly useful for:
256253

@@ -264,7 +261,7 @@ But it is not necessarily appropriate for:
264261
- **High-frequency process studies**: Where tidal and inertial signals are of interest
265262
- **Short-term deployments**: Where filtering may remove significant portions of the record
266263

267-
7.2. RAPID Array Context: De-tiding for Long-term Records
264+
7.1. RAPID Array Context: De-tiding for Long-term Records
268265
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
269266

270267
The filtering implementation is based on the RAPID array processing workflow, where **2-day low-pass Butterworth filtering** (6th order) was applied to remove tidal and inertial variability from year-long mooring records.
@@ -296,8 +293,8 @@ The Python implementation in :mod:`oceanarray.time_gridding` provides equivalent
296293
- **Modern formats**: NetCDF output with CF conventions
297294
- **Gap-aware processing**: Intelligent handling of data gaps
298295

299-
7.3. Filter Implementation Details
300-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296+
7.2. Filter Implementation Details (not yet implemented)
297+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
301298

302299
**Gap Handling**
303300

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2. Trimming to Deployed period
2+
==============================
3+
4+
This document outlines the **trimming** step in the oceanarray processing workflow. Trimming refers to the process of isolating the valid deployment period from a time series—typically corresponding to the interval between instrument deployment and recovery. It also produces summary plots.
5+
6+
This step may need to be run several times, adjusting the start and end of the deployment periods.
7+
8+
It corresponds to **Stage 2** from RAPID data processing and management, which uses as input the RDB format and outputs (in RDB format) the `*.use`` file.
9+
10+
1. Overview
11+
-----------
12+
13+
Raw mooring records often contain extraneous data before deployment or after recovery (e.g., deck recording, values during ascent/descent, post-recovery handling). These segments must be trimmed to retain only the time interval when the instrument was collecting valid in-situ measurements at the nominal depth during deployment. In this stage:
14+
15+
- Visualised to identify data issues (e.g., deployment start/end spikes only)
16+
- Optionally low-pass filtered (e.g., 2-day Butterworth)
17+
- Inspected manually
18+
- Optionally adjusted:
19+
- Revised trimming bounds
20+
- Prepared for further processing (e.g., gridding)
21+
22+
2. Purpose
23+
----------
24+
25+
- Remove non-oceanographic data before deployment and after recovery
26+
- Ensure temporal consistency across instruments on the same mooring
27+
- Define the usable deployment interval for each instrument
28+
- Generate summary plots for review and archiving
29+
30+
31+
3. Input
32+
--------
33+
34+
- Standardised `xarray.Dataset` containing raw time series (`TIME`, `TEMPERATURE`, etc.)
35+
- Metadata indicating deployment and recovery times, either:
36+
- Attached to the dataset (e.g., `ds.attrs["start_time"]`)
37+
- Auxiliary logs (optional): info.dat with mooring latitude and longitude, and deployment times (anchor away) and recovery times (all gear on deck)
38+
39+
4. Output
40+
---------
41+
42+
- Trimmed `xarray.Dataset` with:
43+
- `TIME` restricted to deployment period
44+
- Attributes updated with `trimmed = True` and `start_time`, `end_time`
45+
- Summary plots (e.g., `.png` or `.pdf` of raw and filtered time series)
46+
- Updated deployment metadata (e.g., revised start/end time if needed) in `info.dat` or similar human-readable format
47+
48+
49+
Common plots include:
50+
51+
- Full record: `TEMPERATURE`, `CONDUCTIVITY`, `PRESSURE`
52+
- 2-day Butterworth filtered versions
53+
54+
55+
5. Example
56+
----------
57+
58+
.. code-block:: python
59+
60+
from oceanarray.methods.trimming import trim_to_deployment
61+
62+
ds_trimmed = trim_to_deployment(ds_std, start="2021-01-05T20:00", end="2023-02-25T17:00")
63+
64+
.. code-block:: text
65+
66+
<xarray.Dataset>
67+
Dimensions: (TIME: 104576)
68+
Coordinates:
69+
* TIME (TIME) datetime64[ns] ...
70+
Data variables:
71+
TEMPERATURE (TIME) float32 ...
72+
PRESSURE (TIME) float32 ...
73+
Attributes:
74+
start_time: 2021-01-05T20:00
75+
end_time: 2023-02-25T17:00
76+
trimmed: True
77+
78+
6. Implementation Notes
79+
-----------------------
80+
81+
- Deployment periods should be specified in UTC or provided in the mooring `*info.dat` file as in the RAPID data processing and management framework.
82+
- Start and end times may come from cruise logs or recovery reports
83+
- Optionally: implement automatic detection of stable deployment periods (e.g., threshold in pressure)
84+
85+
7. FAIR Considerations
86+
----------------------
87+
88+
- Trimmed intervals should be **documented transparently** in dataset attributes
89+
- Retain untrimmed data for provenance if needed
90+
- Enhances **reusability** and **accuracy** in further processing
91+
92+
See also: :doc:`standardisation`
93+
94+
Legacy Script (RAPID)
95+
---------------------
96+
97+
The RAPID script shows how the Seabird format data were changed into the RDB format.
98+
99+
100+
101+
- `microcat_raw2use_003.m <../_static/code/microcat_raw2use_003.m>`__
102+
103+
This script was part of the original RAPID processing chain used to convert MicroCAT `.asc` or `.cnv` output to `.raw` files in RODB format. It includes parsing logic, metadata extraction from `info.dat`, time adjustment, and basic diagnostic plotting.
104+
105+
106+
107+
.. literalinclude:: ../_static/code/microcat_raw2use_003.m
108+
:language: matlab
109+
:lines: 1-40
110+
:linenos:
111+
:caption: Excerpt from `microcat_raw2use_003.m`

docs/source/methods/vertical_gridding.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
Vertical Gridding
3-
=================
2+
Step 2: Vertical Gridding
3+
==========================
44

55
For a tall mooring with multiple instruments at different depths, vertical gridding can be used to create an evenly spaced (in pressure or depth coordinates) profile of measured properties.
66

0 commit comments

Comments
 (0)