Changes in / [d8483f7:5ba04b8] in ammosreader
- Location:
- ammosreader
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ammosreader/PDW.py
rd8483f7 r5ba04b8 141 141 self.pdw_format_identifier = pdw_format_identifier 142 142 self.center_frequency = center_frequency # 143 self. __is_valid = is_valid #143 self.is_valid = is_valid # 144 144 self.is_pulse = is_pulse # 145 145 self.level_unit = level_unit # … … 169 169 "Center frequency: " + str(self.center_frequency) + " KHz\n") 170 170 171 if self. __is_valid:171 if self.is_valid: 172 172 output += "Signal: Valid\n" 173 173 else: … … 221 221 222 222 return output 223 224 def is_valid(self):225 return self.__is_valid226 223 227 224 def to_json(self): … … 229 226 'FORMATIDENTIFIER': self.pdw_format_identifier, 230 227 'center frequency': self.center_frequency, 231 'VALID': self. __is_valid,228 'VALID': self.is_valid, 232 229 'PULSE': self.is_pulse, 233 230 'PULSELEVEL': self.pulse_level_or_pulse_field_strength, -
ammosreader/PPDWContainer.py
rd8483f7 r5ba04b8 16 16 self.signals = signals 17 17 18 self.name = name19 20 18 def __str__(self): 21 19 return "\n".join(["Number of pulses:" + str(len(self.signals)), 22 "Number of invalid pulses:" + str(self.number_of_invalid_pulses()),23 20 "Start time:" + str(self.start_time()), 24 21 "End time:" + str(self.end_time())]) 25 22 26 23 def add(self, a_pdw): 27 # print(a_pdw)28 24 self.signals.append(a_pdw) 29 25 30 26 def as_pulse_dict(self): 31 print(datetime.now())32 27 pulse_dict = {} 33 28 pulse_dict[0] = self.signals[0].to_json() … … 36 31 pulse_dict[index]["dtoa"] = (current_pdw.time_of_arrival - pulse_dict[index]["time of arrival"]).item()/1000.0 37 32 pulse_dict[index+1]["dtoa"] = 0.0 # np.timedelta64(0, 'us') 38 print(datetime.now())39 33 return pulse_dict 40 41 def number_of_invalid_pulses(self):42 return sum(not each.is_valid() for each in self.signals)43 44 def without_invalids(self):45 return PPDWContainer(self.name, [each for each in self.signals if each.is_valid()])46 34 47 35 def julian_date_string(self): -
ammosreader/PPDWReader.py
rd8483f7 r5ba04b8 23 23 break 24 24 if self.cursor + 32 >= len(self.content): 25 # print('Can not read all 32 bytes of next PDW . EOF')25 # print('Can not read all 32 bytes of next PDW') 26 26 break 27 27 self.container.add(PDW.from_bytes(current_bytes))
Note:
See TracChangeset
for help on using the changeset viewer.