binary_reader
High-level reader for RDI ADCP binary files. Returns xarray.Dataset objects
ready for analysis.
This is the primary entry point for loading ADCP data. It wraps pd0_parser and automatically handles metadata extraction, coordinate assignment, and accessor registration.
Functions
Function |
Description |
|---|---|
|
Load complete dataset — primary entry point |
|
File structure and data type mapping |
|
Static instrument configuration (36 raw + 25 decoded fields) |
|
Per-ensemble sensor data (48 raw + 46 decoded + 2 composite fields) |
|
Velocity array — shape |
|
Correlation array — shape |
|
Echo intensity array — range 0–255 (multiply by 0.45 for dB) |
|
Percent good array — range 0–100 |
|
Status diagnostic bit flags |
Usage
import pyadps
# Load the complete dataset
ds = pyadps.read('deployment.000')
# Load specific components only — useful for large files
ds = pyadps.read('deployment.000', data_types=['Velocity', 'Correlation'])
data_types options: 'FixedLeader', 'VariableLeader', 'Velocity',
'Correlation', 'Echo', 'PercentGood', 'Status'.
VariableLeader is always included because it provides the time coordinate.
Key Defaults
Parameter |
Default |
Effect |
|---|---|---|
|
|
RDI missing value (−32768) replaced with |
|
|
A 3D QC mask variable is created from missing values |
|
|
Decoded fields (frequency, heading in degrees, etc.) are included |
|
|
Time is the first dimension |
|
|
Cell index used; set |
Time Utilities
Two time axis utilities are available for correcting irregular timestamps.
These are most conveniently accessed through ProcessedDataset.apply_time_axis()
in the processing module, but can also be called directly:
from pyadps.processing.time_axis import snap_time_axis, fill_time_gaps
# Snap drifted timestamps to the nearest hour
ds_snapped, success, msg = snap_time_axis(ds, freq='h', tolerance='5min')
# Fill missing ensembles so the time axis is uniform
ds_filled = fill_time_gaps(ds_snapped, method='auto')
See Also
pd0_parser — Low-level binary parsing
accessors — Domain-specific accessor methods
Processing Module — Quality control pipeline