DFT datatypes¶
C
pynasonde.digisonde.datatypes.dftdatatypes — DopplerSpectralBlock, DopplerSpectra, DftHeader, SubCaseHeader
Dataclasses modeling DFT-format headers and spectral blocks.
pynasonde.digisonde.datatypes.dftdatatypes
¶
DFT datatypes used by the Digisonde DFT parser.
This module defines small dataclass containers that mirror the on-disk
DFT record structures used by Digisonde DFT-format files. The classes are
lightweight holders for parsed fields and provide small normalization steps
in __post_init__ where appropriate.
These types are intended to be used by the parser code under
pynasonde.digisonde.parsers.dft and by higher-level utilities that need
structured access to the parsed header and spectral data.
DopplerSpectralBlock
dataclass
¶
Top-level block containing a DFT header and associated spectra.
Attributes:
| Name | Type | Description |
|---|---|---|
header |
DftHeader
|
|
spectra_line |
List[DopplerSpectra]
|
List of |
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
DopplerSpectra
dataclass
¶
Container for a single Doppler spectrum.
Attributes:
| Name | Type | Description |
|---|---|---|
amplitude |
np.array
|
Array-like amplitude values for the Doppler bins. |
phase |
np.array
|
Array-like phase values for the Doppler bins. |
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
__post_init__()
¶
Apply small amplitude scaling used by the original format.
The parser historically scales amplitude values by 3/8 to convert to the units expected by downstream code (historical dB-like scale). This operation is performed in-place on the amplitude array when present.
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
DftHeader
dataclass
¶
Top-level header for a DFT record block.
This dataclass collects the primary header fields found at the beginning of a DFT data block. Field names follow the original parser naming where possible; values are stored as integers or small numeric types and may require interpretation by the consumer (units are parser-dependent).
Attributes:
| Name | Type | Description |
|---|---|---|
record_type |
int
|
int Numeric record type identifier. |
year |
int
|
int Year of the measurement. |
doy |
int
|
int Day-of-year timestamp component. |
hour |
int
|
int Hour of day. |
minute |
int
|
int Minute component of timestamp. |
second |
int
|
int Second component of timestamp. |
schdule |
int
|
int (Parser-specific) schedule or run identifier. |
program |
int
|
int Program id or code recorded in the header. |
drift_data_flag |
hex
|
hex Drift-data flag field (raw representation). |
journal |
hex
|
hex Journal / log field (raw representation). |
first_height_sampling_winodw |
int
|
int First height sampling window index (raw). |
height_resolution |
int
|
int Height resolution or bin size. |
number_of_heights |
int
|
int Number of height bins contained in the block. |
start_frequency |
int
|
int Start frequency of the scan (format-dependent units). |
disk_io |
hex
|
hex Disk I/O flag or raw indicator. |
freq_search_enabled |
bin
|
bin Frequency-search enabled flag (raw/bin representation). |
fine_frequency_step |
int
|
int Fine frequency step value. |
number_small_steps_scan_abs |
int
|
int Absolute number of small frequency steps. |
number_small_steps_scan |
int
|
int Number of small steps in the scan. |
start_frequency_case |
int
|
int Case-specific start frequency index. |
coarse_frequency_step |
int
|
int Coarse frequency step value. |
end_frequency |
int
|
int End frequency of the scan (format-dependent units). |
bottom_height |
int
|
int Bottom height index or value for the block. |
top_height |
int
|
int Top height index or value for the block. |
unused |
int
|
int Reserved / unused field. |
stn_id |
int
|
int Station identifier. |
phase_code |
int
|
int Phase code or modulation identifier. |
multi_antenna_sequence |
int
|
int Multi-antenna sequencing flag/identifier. |
cit_length |
int
|
int CIT (control info) length field. |
num_doppler_lines |
int
|
int Number of Doppler spectral lines per sample. |
pulse_repeat_rate |
int
|
int Pulse repeat rate of the measurement. |
waveform_type |
int
|
int Waveform type identifier. |
delay |
int
|
int Inter-pulse or processing delay. |
frequency_search_offset |
int
|
int Frequency search offset used during scanning. |
auto_gain |
int
|
int Automatic gain control setting. |
heights_to_output |
int
|
int Number of heights to output or include. |
num_of_polarizations |
int
|
int Number of polarization channels recorded. |
start_gain |
int
|
int Start gain setting for the receiver. |
subcases |
List[SubCaseHeader]
|
List[SubCaseHeader]
Optional list of |
Note: Many additional fields present in the original format are kept as attributes to preserve full fidelity. Consult the parser implementation for exact byte-to-field mappings.
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
__post_init__()
¶
Optional normalization after construction.
Parsers may choose to perform small unit conversions or sanity checks here. The method is intentionally lightweight to avoid surprising side-effects during object construction.
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
SubCaseHeader
dataclass
¶
Header for a single frequency/height subcase inside a DFT block.
Attributes:
| Name | Type | Description |
|---|---|---|
frequency |
int
|
Raw frequency value for this subcase (parser-specific units). |
height_mpa |
int
|
Height value (raw units as read from the record). |
height_bin |
int
|
Height bin index used for indexing spectral data. |
agc_offset |
int
|
AGC offset recorded for this subcase. |
polarization |
int
|
Polarization identifier for the subcase. |
Source code in pynasonde/digisonde/datatypes/dftdatatypes.py
__post_init__()
¶
Post-init hook for small normalization steps.
Parsers can populate these fields using raw binary values; if unit normalization or type conversions are required they should be applied here. The code currently contains a commented-out example of scaling frequency if needed.