Changeset 0b489f2 in ammosreader
- Timestamp:
- 08/14/23 13:35:49 (22 months ago)
- Branches:
- guix
- Children:
- 7bc034f
- Parents:
- d2736bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ammosreader/PDW.py
rd2736bb r0b489f2 49 49 is_valid = bool(int(fourth_entry_bit_string[0])) 50 50 is_pulse = bool(int(fourth_entry_bit_string[1])) 51 level_unit = int(fourth_entry_bit_string[2])51 level_unit = bool(int(fourth_entry_bit_string[2])) 52 52 signal_start_missing = bool(int(fourth_entry_bit_string[3])) 53 53 signal_end_missing = bool(int(fourth_entry_bit_string[4])) … … 79 79 df_quality = int(seventh_entry_bit_string[2:9], 2) 80 80 # FIXME: You have to scale me from -90 to 90 in 0.1 degree steps 81 elevation = int(seventh_entry_bit_string[9:20], 2) 81 elevation = int(seventh_entry_bit_string[9:20], 2) / 10 82 82 # FIXME: You have to check me for a range from 0.0 to 359.9 in steps of 0.1 83 83 azimuth = 0.1 * (int(seventh_entry_bit_string[20:32], 2)) … … 216 216 output += "DF quality: " + str(self.df_quality) + " %\n" 217 217 218 if self.elevation == 102 4:218 if self.elevation == 102.4: 219 219 output += "Elevation: Unknown\n" 220 220 else: … … 232 232 def is_valid(self): 233 233 return self.__is_valid 234 235 def to_datacrunch_json(self): 236 import uuid 237 return {'TOA': int(self.time_of_arrival), 238 'FORMAT': self.pdw_format_identifier, 239 'CENTER_FREQUENCY': self.center_frequency, 240 'VALID_FLAG': self.__is_valid, 241 'PULSE_FLAG': self.is_pulse, 242 'LU_FLAG': self.level_unit, 243 'SNS_FLAG': self.signal_start_missing, 244 'SNE_FLAG': self.signal_end_missing, 245 'LEVEL': self.pulse_level_or_pulse_field_strength, 246 'PULSE_WIDTH': self.pulse_width, 247 'BANDWIDTH': self.frequency_shift_or_bandwidth, 248 'IN_OUT_FLAG': self.region_of_interest, 249 'DF_CONFIDENCE': self.azimuth_confidence, 250 'MODULATION': self.modulation, 251 'SECTOR': self.sector, 252 'POL': self.polarity, 253 'DF_QUALITY': self.df_quality, 254 'ELEVATION': self.elevation, 255 'AZIMUTH': self.azimuth, 256 'CHANNEL': self.channel 257 'UUID': uuid.uuid4() 258 } 234 259 235 260 def to_json(self):
Note:
See TracChangeset
for help on using the changeset viewer.