Core Types and Volume Helpers

Core Types (CfRadial 2.1)

Daisho.VolumeType
Volume

Top-level CfRadial 2.1 container. Required global attrs/vars are spec-mandated; everything else is optional. sweeps is a Vector{SweepGroup}. The struct is immutable; field addition mutates SweepGroup.fields (its OrderedDict), which is allowed.

source
Daisho.SweepGroupType
SweepGroup

A single sweep. Time axis runs over time, range axis over range. fields is an OrderedDict{String,Field} keyed by canonical name. Optional sub-groups (georeference, radar_monitoring, spectra) hang off here.

source
Daisho.FieldType
Field(data, metadata)

A single radar field on a sweep, with data::AbstractMatrix of shape (time, range) already in physical units.

source
Daisho.FieldMetadataType
FieldMetadata

Per-field metadata mirroring the CfRadial 2.1 §5.6 attribute table.

Three mutually exclusive gate states (CfRadial 2.1 / ODIM vocabulary):

  • true missing — gate not measured. Sentinel: fill_value (CF _FillValue).
  • undetect — gate scanned, no detectable signal. Sentinel: undetect (ODIM _Undetect).
  • valid — gate scanned, signal detected (a real measured value).

Both sentinels can be present, both can be absent.

extra_attrs is the catch-all for non-spec attrs encountered in real files. The reader populates it; update_cfradial preserves it through to disk. write_cfradial drops extra_attrs unless write_extras=true.

source
Daisho.GeoreferenceType
Georeference

Per-ray georeference for mobile platforms. lat/lon/alt are required; everything else is optional. extra_vars passes through non-spec variables.

source
Daisho.RadarMonitoringType
RadarMonitoring

Per-ray radar monitoring. All fields optional; extra_vars passes through non-spec variables (e.g. measuredtransmitpower_h reported under a non-canonical name).

source
Daisho.RadarParametersType
RadarParameters

Volume-level static radar parameters. extra_vars passes through anything not enumerated here (e.g. transmit/receive sub-system tags).

source
Daisho.RadarCalibrationType
RadarCalibration(entries, calib_index)

Volume-level calibration table. entries holds one RadarCalibrationEntry per pulse-width / mode; calib_index (optional) is a per-ray index across the volume.

source
Daisho.SpectrumGroupType
SpectrumGroup

Type stub for CfRadial spectrum groups (§6). Reader/writer support is not implemented.

source
Daisho.LidarMonitoringType
LidarMonitoring

Type stub for CfRadial lidar monitoring. Reader/writer support is not implemented; the type exists so that Volume and SweepGroup schemas remain closed.

source

Volume Helpers

Daisho.add_field!Function
add_field!(sweep::SweepGroup, name, data, metadata=FieldMetadata())

Add a field to a sweep. data must be (n_rays, n_gates) matching the sweep's time × range axes.

source
Daisho.remove_field!Function
remove_field!(sweep::SweepGroup, name) -> Bool

Remove a field by name. Returns true if removed, false if it wasn't present.

source
Daisho.n_raysFunction
n_rays(sweep::SweepGroup) -> Int
n_rays(volume::Volume) -> Int

Total number of rays. For a SweepGroup, length(sweep.time). For a Volume, the sum across sweeps.

source
Daisho.field_namesFunction
field_names(sweep::SweepGroup) -> Vector{String}
field_names(volume::Volume) -> Vector{String}

Canonical field names. For a sweep, in the order they appear in sweep.fields. For a volume, the union across sweeps in alphabetical order.

source
Daisho.has_fieldFunction
has_field(sweep::SweepGroup, name) -> Bool
has_field(volume::Volume, name) -> Bool

Check for presence of a field. For a volume, returns true if any sweep has it.

source

Legacy radar Compatibility

Helpers to convert between the CfRadial 2.1 Volume type and the legacy radar struct.

Daisho.as_volumeFunction
as_volume(r::radar; field_names::Vector{String}, sweep_modes=nothing,
          instrument_name="", scan_name=r.scan_name,
          field_metadata=Dict{String,FieldMetadata}()) -> Volume

Reverse direction. Reconstruct a Volume from a legacy radar struct given the canonical field names corresponding to r.moments columns. Sweep boundaries come from r.swpstart / r.swpend.

source
Daisho.as_legacy_radarFunction
as_legacy_radar(volume::Volume; field_names=nothing) -> (radar, field_names)

Flatten a Volume into the legacy radar struct and return it alongside the ordered list of canonical field names that match the moments-matrix columns.

When field_names is nothing (default), columns are laid out in alphabetical order of the volume's fields (legacy behavior, preserved for backwards compatibility).

When field_names is supplied, columns are laid out in that exact order. Fields named but not present in any sweep produce a column of missing.

Mobile-platform per-ray velocities (eastward_velocity, northward_velocity, vertical_velocity) are copied from sweep.georeference into the legacy ew/ns/w_platform arrays when present; otherwise those arrays are zeros.

Assumes all sweeps share the same range axis.

source