RSF — Parse and Inspect Raw Sounding File¶
Low-Level RSF Walkthrough
Load a single DPS4D .RSF file, parse all blocks and frequency
groups into structured Python dataclasses, and inspect headers and echo data
programmatically.
This page explains examples/digisonde/rsf.py.
Call Flow¶
RsfExtractor(filepath, ...)opens the.RSFfile and resolves optional metadata tables (station codes, frequency tables)..extract()iterates over all 4096-byte blocks, decoding the RSF Header and Frequency Groups intoRsfDataUnitobjects stored inrsf_data.rsf_data_units.- Inspect
rsf_data_units[i].headerfor block-level metadata (timestamp, frequency, height settings) andfrequency_groups[j]for per-height echo data (amplitude, phase, Doppler number, direction bits). .to_pandas()flattens all parsed units into a tidy DataFrame suitable for plotting or downstream analysis.
Key Code¶
1) Load and Extract¶
from pynasonde.digisonde.parsers.rsf import RsfExtractor
extractor = RsfExtractor(
"/path/to/KR835_2023287000000.RSF",
extract_time_from_name=True, # parse timestamp from filename
extract_stn_from_name=True, # parse station URSI code from filename
)
extractor.extract()
2) Inspect Header and Frequency Groups¶
# First block header: timestamp, frequency, height parameters
h = extractor.rsf_data.rsf_data_units[0].header
print(f"Date: {h.date}")
print(f"Frequency: {h.frequency_group} MHz")
# First frequency group: one height profile of echoes
fg = extractor.rsf_data.rsf_data_units[0].frequency_groups[0]
print(f"Amplitude values: {fg.amplitude[:8]}")
print(f"Direction bits: {fg.azimuth[:8]}")
3) Convert to DataFrame¶
df = extractor.to_pandas()
print(df[["datetime", "frequency", "height_km", "amplitude", "azimuth"]].head(10))
Run¶
Related Files¶
examples/digisonde/rsf.pypynasonde/digisonde/parsers/rsf.pypynasonde/digisonde/datatypes/rsfdatatypes.py