Changes in / [d8483f7:5ba04b8] in ammosreader


Ignore:
Location:
ammosreader
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ammosreader/PDW.py

    rd8483f7 r5ba04b8  
    141141        self.pdw_format_identifier = pdw_format_identifier
    142142        self.center_frequency = center_frequency #
    143         self.__is_valid = is_valid #
     143        self.is_valid = is_valid #
    144144        self.is_pulse = is_pulse #
    145145        self.level_unit = level_unit #
     
    169169                  "Center frequency: " + str(self.center_frequency) + " KHz\n")
    170170
    171         if self.__is_valid:
     171        if self.is_valid:
    172172            output += "Signal: Valid\n"
    173173        else:
     
    221221
    222222        return output
    223 
    224     def is_valid(self):
    225         return self.__is_valid
    226223
    227224    def to_json(self):
     
    229226                'FORMATIDENTIFIER': self.pdw_format_identifier,
    230227                'center frequency': self.center_frequency,
    231                 'VALID': self.__is_valid,
     228                'VALID': self.is_valid,
    232229                'PULSE': self.is_pulse,
    233230                'PULSELEVEL': self.pulse_level_or_pulse_field_strength,
  • ammosreader/PPDWContainer.py

    rd8483f7 r5ba04b8  
    1616            self.signals = signals
    1717
    18         self.name = name
    19 
    2018    def __str__(self):
    2119        return "\n".join(["Number of pulses:" + str(len(self.signals)),
    22                           "Number of invalid pulses:" + str(self.number_of_invalid_pulses()),
    2320                          "Start time:" + str(self.start_time()),
    2421                          "End time:" + str(self.end_time())])
    2522
    2623    def add(self, a_pdw):
    27         # print(a_pdw)
    2824        self.signals.append(a_pdw)
    2925
    3026    def as_pulse_dict(self):
    31         print(datetime.now())
    3227        pulse_dict = {}
    3328        pulse_dict[0] = self.signals[0].to_json()
     
    3631            pulse_dict[index]["dtoa"] = (current_pdw.time_of_arrival - pulse_dict[index]["time of arrival"]).item()/1000.0
    3732        pulse_dict[index+1]["dtoa"] = 0.0  # np.timedelta64(0, 'us')
    38         print(datetime.now())
    3933        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()])
    4634
    4735    def julian_date_string(self):
  • ammosreader/PPDWReader.py

    rd8483f7 r5ba04b8  
    2323                    break
    2424                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')
    2626                    break
    2727                self.container.add(PDW.from_bytes(current_bytes))
Note: See TracChangeset for help on using the changeset viewer.