pyart.aux_io.read_rainbow_iq#
- pyart.aux_io.read_rainbow_iq(filename, field_names=None, additional_metadata=None, file_field_names=False, exclude_fields=None, include_fields=None, *, pulses_per_ray=None, max_rays=None, start_pulse=0, stop_pulse=None, pulse_filter=None, rng_min=None, rng_max=None, latitude=None, longitude=None, altitude=None, frequency=None, scan_type='other', fixed_angle=None, range_reference='start', time_mode='auto', start_time=None, counter_policy='mask', archive_byteorder='auto', frame_byteorder='auto', angle_scale=0.0054931640625, include_channel_masks=False, mask_rx_flags=0, max_pulses_per_ray=4096, max_memory_bytes=10737418240, max_frame_bytes=67108864, max_uncompressed_bytes=4294967296, combine_streams=False, transition_weighting='linear', sigmoid_steepness=8.0)#
Read selected GDRX6 RX pulses into one MeteoSwiss RadarSpectra.
- Parameters:
filename (str or pathlib.Path) – IQRecord .iqr archive, or raw concatenated GDRX6 pulse frames.
field_names (dict, optional) – Map IQ_H/IQ_V to Py-ART names (defaults: IQ_hh_ADU/IQ_vv_ADU), and optionally RX_CHANNEL_H/RX_CHANNEL_V. None mappings omit fields.
additional_metadata (dict of dict, optional) – Passed to Py-ART FileMetadata; keyed by output variable/field names.
file_field_names (bool) – Use IQ_H/IQ_V and RX_CHANNEL_H/RX_CHANNEL_V as output field names.
exclude_fields, include_fields (sequence of str, optional) – Filter final field names using Py-ART FileMetadata conventions.
pulses_per_ray (int, optional) – Maximum consecutive pulses per output ray. None uses CPI toggle bit 5, RX CPI-start bit 7 and homogeneous PRF-batch boundaries. Explicit counts still respect those boundaries and discontinuities. The final short ray is retained; missing padding is masked.
max_rays (int, optional) – Limit the number of output rays. Recommended for initial inspection.
start_pulse, stop_pulse (int) – Half-open interval of decoded RX pulse ordinals, before pulse_filter. Earlier pulses are visited for clock reconstruction, not retained.
pulse_filter (callable(dict) -> bool, optional) – Select pulse headers, for example by pulse_width_us or range_step_km. Missing transmitted pulses split runs. Removing sibling frames with repeated counters does not split a consecutive selected sequence.
rng_min, rng_max (float, optional) – Inclusive range limits in meters, applied after range centering.
latitude, longitude, altitude (float, optional) – Site location in degrees/degrees/meters MSL. Missing values are masked. Proprietary states.* keys are not guessed.
frequency (float, optional) – Actual RF carrier frequency in Hz, needed for a Doppler velocity axis. Header TX frequencies are preserved but may describe receiver IF; they are not silently used as the transmitted RF carrier.
scan_type ({‘other’, ‘ppi’, ‘sector’, ‘rhi’, ‘vpt’}) – One selected acquisition segment is represented as one sweep. Split a volume into sweeps externally using known scan settings.
fixed_angle (float, optional) – Sweep target angle in degrees; otherwise derived from valid ray angles.
range_reference ({‘start’, ‘center’}) – ‘start’: header range_start describes the near edge (the archive convention); add half a gate for RadarSpectra center coordinates. ‘center’: header range_start already describes gate centers.
time_mode ({‘auto’, ‘gps’, ‘reconstruct’}) – auto uses GPS-valid pulse timestamps, otherwise an approximate clock from archive start time, pulse counters and preceding pulse PRF. gps requires every pulse timestamp to be valid. reconstruct ignores GPS and uses the anchor for all pulses. GDRX6 seconds are treated as Unix UTC seconds. Reconstructed times are explicitly marked.
start_time (aware datetime, ISO string or float, optional) – Unix UTC anchor of the FIRST RX pulse, before all selection. Overrides the archive start anchor, but not valid GPS in auto mode.
counter_policy ({‘mask’, ‘raise’}) – Without valid GPS, ‘mask’ reuses the preceding time for repeated counters (assuming sibling representations of one transmitted pulse), retaining all frames. Backward/very large counter jumps mask absolute time until valid GPS returns. Rays split across discontinuities; no missing interval is invented. ‘raise’ rejects either event with details. A processing-reset flag with continuous counters only splits the ray.
archive_byteorder, frame_byteorder ({‘auto’, ‘little’, ‘big’}) – Independently choose envelope and GDRX6 word byte orders.
angle_scale (float) – Degrees per angle ADU, default 360/65536 (a conventional assumption).
include_channel_masks (bool) – Add per-sample high/low receiver-channel selection fields.
mask_rx_flags (int) – Mask entire IQ pulses whose RX flags intersect this bitmask; default zero preserves the received data, apart from non-finite values.
max_pulses_per_ray (int) – Guard for absent CPI markers. Raises instead of inventing boundaries.
max_memory_bytes (int) – Conservative working-array budget, not an OS-level RAM guarantee. For larger files use iter_rainbow_spectra; dense padding counts too.
max_frame_bytes, max_uncompressed_bytes (int) – Format/allocation limits. Large inflated items are spooled to disk.
- Returns:
radar (pyart.core.radar_spectra.RadarSpectra) – Complex64 masked IQ fields shaped (nrays, ngates, npulses_max). No FFT is applied. Uniform rays have fftshift frequency coordinates; nonuniform/staggered rays have masked coordinates. Extra attributes: rainbow_archive_header, rainbow_pulse_metadata (ray x pulse), and rainbow_uniform_prt. Generic Py-ART writers/subsetters may not preserve these extra attributes: keep the source archive.