Changeset ef05d46 in ammosreader
- Timestamp:
- 08/08/22 14:39:12 (3 years ago)
- Branches:
- AmmosSource, guix
- Children:
- d8483f7
- Parents:
- e4e63a3
- Location:
- ammosreader
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ammosreader/PDW.py
re4e63a3 ref05d46 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
re4e63a3 ref05d46 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 … … 34 38 print(datetime.now()) 35 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()]) 36 46 37 47 def julian_date_string(self):
Note:
See TracChangeset
for help on using the changeset viewer.