RSF datatypes¶
C
pynasonde.digisonde.datatypes.rsfdatatypes — RsfHeader, RsfFreuencyGroup, RsfDataUnit, RsfDataFile
Dataclasses modeling RSF-format headers and spectral blocks.
pynasonde.digisonde.datatypes.rsfdatatypes
¶
RSF datatypes for Digisonde RSF-format files.
These dataclasses model the on-disk RSF header and frequency-group
structures. They include small helpers (__post_init__ and setup)
that convert raw numeric encodings to SI units where practical.
RsfHeader
dataclass
¶
Header describing an RSF data file or block.
Many fields are parser-specific and reflect the original RSF format
header. The __post_init__ method converts frequency and time
related fields to more convenient units (Hz, Python datetime).
Attributes:
| Name | Type | Description |
|---|---|---|
record_type |
int
|
int Numeric record type identifier. |
header_length |
int
|
int Length of the header in bytes. |
version_maker |
int
|
int Version/maker code (raw integer). |
year |
int
|
int Year of the measurement. |
doy |
int
|
int Day-of-year component. |
month |
int
|
int Month component. |
dom |
int
|
int Day-of-month component. |
hour |
int
|
int Hour component. |
minute |
int
|
int Minute component. |
second |
int
|
int Second component. |
stn_code_rx |
str
|
str Receiver station code. |
stn_code_tx |
str
|
str Transmitter station code. |
schedule |
int
|
int Schedule code. |
program |
int
|
int Program code. |
start_frequency |
float
|
float
Start frequency (converted to Hz in |
coarse_frequency_step |
float
|
float
Coarse frequency step (converted to Hz in |
stop_frequency |
float
|
float
Stop frequency (converted to Hz in |
fine_frequency_step |
float
|
float
Fine frequency step (converted to Hz in |
num_small_steps_in_scan |
int
|
int Number of small frequency steps (negative => no multiplexing). |
phase_code |
int
|
int Phase code field describing pulse/phase behaviour. |
option_code |
int
|
int Option code (antenna selection, polarization flags, etc.). |
number_of_samples |
int
|
int Encoded number of samples. |
pulse_repetition_rate |
int
|
int Pulse repetition rate (pps). |
range_start |
int
|
int Range start in km. |
range_increment |
int
|
int or float
Range increment (km); common encoded values are converted in
|
number_of_heights |
int
|
int Number of heights configured in the scan. |
delay |
int
|
int Delay in 15 km units. |
base_gain |
int
|
int Base gain code (dB-like representation with special bits). |
frequency_search |
int
|
int Frequency search enabled flag. |
operating_mode |
int
|
int Operating mode code. |
data_format |
int
|
int Data format code (MMM, Drift, PGH, RSF, etc.). |
printer_output |
int
|
int Printer output setting (none, b/w, color). |
threshold |
int
|
int or float
Threshold level (converted to dB-like value in |
constant_gain |
int
|
int Constant gain code (bitfield describing fixed gain settings). |
cit_length |
int
|
int CIT length in ms. |
journal |
str
|
str Journal / flags string (parser-specific meaning). |
bottom_height_window |
int
|
int Bottom height window (km). |
top_height_window |
int
|
int Top height window (km). |
number_of_heights_stored |
int
|
int Number of height bins actually stored. |
spare |
bytes
|
bytes Spare/reserved bytes from header. |
number_of_frequency_groups |
int
|
int Number of frequency groups that follow the header. |
date |
int
|
datetime.datetime
Python datetime synthesized from the timestamp fields in
|
Source code in pynasonde/digisonde/datatypes/rsfdatatypes.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
RsfFreuencyGroup
dataclass
¶
A single frequency-group carrying arrays of spectral values.
Attributes:
| Name | Type | Description |
|---|---|---|
pol |
str
|
str Polarization identifier. |
group_size |
int
|
int Encoded group size (parser-specific meaning). |
frequency_reading |
float
|
float
Frequency reading (converted to Hz by |
offset |
int
|
int or str
Offset code (converted to Hz or descriptive string by |
additional_gain |
float
|
float
Additional gain (converted to dB by |
seconds |
int
|
int Seconds timestamp for the group. |
mpa |
float
|
float Most probable amplitude (mpa) marker. |
amplitude |
np.array
|
np.array Amplitude array for the frequency group's heights/samples. |
dop_num |
np.array
|
np.array Doppler index array for each sample. |
phase |
np.array
|
np.array
Phase array (converted to degrees by |
azimuth |
np.array
|
np.array
Azimuth array (converted to degrees by |
height |
np.array
|
np.array Height array corresponding to amplitude samples. |
azm_directions |
np.array
|
list
Human-readable azimuth direction labels produced by |
Notes: The setup method mutates numeric arrays to convert them to
SI-friendly units (Hz, degrees, dB) and synthesizes derived fields
such as height and azm_directions.
Source code in pynasonde/digisonde/datatypes/rsfdatatypes.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
setup(threshold=0.0)
¶
Configures and converts the instance attributes to their appropriate units.
This method performs the following conversions:
* Converts azimuth from minutes to degrees by multiplying by 60.
* Converts phase from units to degrees by multiplying by 11.25.
* Converts amplitude from units to decibels (dB) by multiplying by 3.
* Converts offset to a string representation.
* Converts mpa from units to decibels (dB) by multiplying by 3.
* Converts additional_gain from units to decibels (dB) by multiplying by 3.
* Converts frequency_reading from kHz to Hz by multiplying by 10,000.
Source code in pynasonde/digisonde/datatypes/rsfdatatypes.py
RsfDataUnit
dataclass
¶
Represents a single RSF block containing header + frequency groups.
Attributes:
| Name | Type | Description |
|---|---|---|
header |
RsfHeader
|
RsfHeader Header instance with block-level metadata. |
frequency_groups |
List[RsfFreuencyGroup]
|
List[RsfFreuencyGroup]
List of frequency-group |
Note: Calling setup on the data unit will iterate through the
frequency_groups and populate per-group derived fields (height
vectors, unit conversions).
Source code in pynasonde/digisonde/datatypes/rsfdatatypes.py
setup()
¶
Configures the RSF data unit by setting up each frequency group.
This method iterates through each frequency group in the frequency_groups list
and calls the setup method on each group to perform necessary conversions and configurations.
Source code in pynasonde/digisonde/datatypes/rsfdatatypes.py
RsfDataFile
dataclass
¶
Container representing the contents of an RSF file.
Attributes:
| Name | Type | Description |
|---|---|---|
rsf_data_units |
List[RsfDataUnit]
|
List[RsfDataUnit]
List of RSF data units ( |