core
The ProcessedDataset class orchestrates the six-step ADCP processing pipeline.
It maintains an immutable copy of the original dataset and delegates each step
to a dedicated Runner class, so the original data is never modified.
ProcessedDataset
import pyadps
from pyadps.processing import ProcessedDataset
ds = pyadps.read('deployment.000')
proc = ProcessedDataset(ds)
Pipeline Methods
All pipeline methods return self, enabling method chaining.
Method |
Description |
|---|---|
|
Snap drifted timestamps; fill time gaps |
|
Roll/pitch checks; sound speed correction |
|
Correlation, echo, error velocity, percent good, false target |
|
Trim ends, side-lobe cut, manual cut, regrid |
|
Thresholds, magnetic correction, despike, flatline |
|
Add custom metadata to the dataset |
|
Apply all steps from a |
|
Return the processed |
Output Methods
Method |
Description |
|---|---|
|
Finalise and save the full dataset |
|
Save u/v/w velocity components only |
|
Build a dataset with any combination of velocity/echo/correlation/percent good |
|
Save any combination of velocity/echo/correlation/percent good to one file |
|
Finalise and save using paths from a config |
|
Save all applied settings to |
|
Return settings as an INI-formatted string |
Utility Methods
Method |
Description |
|---|---|
|
Restore working dataset to the original state |
|
Current mask statistics (total, valid, masked counts) |
|
Print a formatted QC pipeline summary |
Class Methods
Method |
Description |
|---|---|
|
Read a binary file and return an initialised |
|
Shorthand for |
Chained Workflow
result = (
ProcessedDataset(ds)
.apply_time_axis(snap=True, snap_freq='h')
.apply_sensor_health(roll=True, roll_threshold=15.0)
.apply_signal_quality(correlation=64, echo_intensity=40)
.apply_profile_operation(cut_bins_side_lobe=True, water_depth=50.0)
.apply_velocity_check(cutoff_u=2500, cutoff_v=2500, cutoff_w=500)
.finalize()
)
result.to_netcdf('processed.nc')
Selective Export
export_to_netcdf() writes any combination of velocity, echo intensity,
correlation, and percent good to a single file — the processed-data
equivalent of the raw-file page’s “Select Data Components to Download”.
Velocity is split into separate u/v/w variables; the other components keep
their native (beam, cell/depth, time) shape.
# Velocity + echo intensity only
proc.export_to_netcdf('export.nc', include_velocity=True, include_echo=True)
# Every component
proc.export_to_netcdf(
'export.nc',
include_velocity=True,
include_echo=True,
include_correlation=True,
include_percent_good=True,
)
# Short u/v/w names instead of the CF-style defaults (zonal_velocity, etc.)
# — CF Convention governs attribute values (standard_name, units), not
# variable names, so this stays fully CF-compliant either way.
proc.export_to_netcdf(
'export.nc',
velocity_names={'u': 'u', 'v': 'v', 'w': 'w'},
)
Use get_export_dataset(...) instead to get the xarray.Dataset back
without writing a file.
Config-Based Workflow
# Apply all steps from a saved config
proc = ProcessedDataset(ds)
proc.apply_config('config.ini').finalize()
# Or read file and config in one step
proc = ProcessedDataset.from_ini('config.ini')
proc.apply_config(proc.config)
proc.export_config('run_record.ini')
CutRegion
For manual bin cutting, CutRegion defines a rectangular region by cell
and ensemble index bounds. None means no limit on that dimension.
from pyadps.processing.core import CutRegion
proc.apply_profile_operation(
cut_bins_manual=[
CutRegion(min_cell=0, max_cell=3), # First 4 cells, all ensembles
CutRegion(min_ensemble=0, max_ensemble=50), # First 50 ensembles, all cells
]
)
See Also
sensor_health — SensorHealthRunner details
signal_quality — SignalQualityRunner details
profile_operation — ProfileOperationRunner details
velocity_check — VelocityCheckRunner details
config — ProcessingConfig reference