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