Esempio n. 1
0
    def field_obs_mission_cassini_spacecraft_clock_count2(self):
        partition = self._index_col('SPACECRAFT_CLOCK_CNT_PARTITION')
        count = self._index_col('SPACECRAFT_CLOCK_STOP_COUNT')
        sc = str(partition) + '/' + str(count)
        sc = self._fix_cassini_sclk(sc)
        try:
            sc_cvt = opus_support.parse_cassini_sclk(sc)
        except Exception as e:
            self._log_nonrepeating_error(f'Unable to parse Cassini SCLK "{sc}": {e}')
            return None

        sc1 = self.field_obs_mission_cassini_spacecraft_clock_count1()
        if sc1 is not None and sc_cvt < sc1:
            self._log_nonrepeating_warning(
                f'spacecraft_clock_count1 ({sc1}) and spacecraft_clock_count2 '+
                f'({sc_cvt}) are in the wrong order - setting to count1')
            sc_cvt = sc1
        else:
            image_number = self._index_col('IMAGE_NUMBER')
            sc2_int = int(sc_cvt)
            if int(image_number) != sc2_int:
                self._log_nonrepeating_warning(
                     f'spacecraft_clock_count2 ({sc_cvt}) and COISS IMAGE_NUMBER '+
                     f'({image_number}) don\'t match')

        return sc_cvt
Esempio n. 2
0
 def field_obs_mission_cassini_spacecraft_clock_count1(self):
     sc = '1/' + self._index_col('SPACECRAFT_CLOCK_START_COUNT')
     sc = self._fix_cassini_sclk(sc)
     try:
         sc_cvt = opus_support.parse_cassini_sclk(sc)
     except Exception as e:
         self._log_nonrepeating_error(
             f'Unable to parse Cassini SCLK "{sc}": {e}')
         return None
     return sc_cvt
Esempio n. 3
0
 def field_obs_mission_cassini_spacecraft_clock_count1(self):
     sc = self._index_col('SPACECRAFT_CLOCK_START_COUNT')
     sc = self._fix_cassini_sclk(sc)
     if not sc.startswith('1/') or sc[2] == ' ':
         self._log_nonrepeating_warning(
             f'Badly formatted SPACECRAFT_CLOCK_START_COUNT "{sc}"')
         return None
     try:
         sc_cvt = opus_support.parse_cassini_sclk(sc)
     except Exception as e:
         self._log_nonrepeating_warning(
             f'Unable to parse Cassini SCLK "{sc}": {e}')
         return None
     return sc_cvt
Esempio n. 4
0
 def field_obs_mission_cassini_spacecraft_clock_count1(self):
     sc = self._supp_index_col('SPACECRAFT_CLOCK_START_COUNT')
     if sc == 'UNK':
         return None
     # COVIMS_8001 SCLKs are in some weird units where the number to the right
     # of the decimal can be > 255, so we just round down
     if '.' in sc:
         sc = sc.split('.')[0] + '.000'
     try:
         sc_cvt = opus_support.parse_cassini_sclk(sc)
     except Exception as e:
         self._log_nonrepeating_error(
             f'Unable to parse Cassini SCLK "{sc}": {e}')
         return None
     return sc_cvt
Esempio n. 5
0
    def field_obs_mission_cassini_spacecraft_clock_count2(self):
        sc = '1/' + self._index_col('SPACECRAFT_CLOCK_STOP_COUNT')
        sc = self._fix_cassini_sclk(sc)
        try:
            sc_cvt = opus_support.parse_cassini_sclk(sc)
        except Exception as e:
            self._log_nonrepeating_error(
                f'Unable to parse Cassini SCLK "{sc}": {e}')
            return None

        sc1 = self.field_obs_mission_cassini_spacecraft_clock_count1()
        if sc1 is not None and sc_cvt < sc1:
            self._log_warning(
                f'spacecraft_clock_count1 ({sc1}) and spacecraft_clock_count2 '
                + f'({sc_cvt}) are in the wrong order - setting to count1')
            sc_cvt = sc1

        return sc_cvt
Esempio n. 6
0
    def field_obs_mission_cassini_spacecraft_clock_count2(self):
        sc = self._supp_index_col('SPACECRAFT_CLOCK_STOP_COUNT')
        if sc == 'UNK':
            return None
        # COVIMS_8001 SCLKs are in some weird units where the number to the right
        # of the decimal can be > 255, so we just round up
        if '.' in sc:
            sc = sc.split('.')[0] + '.000'
        try:
            sc_cvt = opus_support.parse_cassini_sclk(sc) + 1  # Round up
        except Exception as e:
            self._log_nonrepeating_error(
                f'Unable to parse Cassini SCLK "{sc}": {e}')
            return None

        sc1 = self.field_obs_mission_cassini_spacecraft_clock_count1()
        if sc1 is not None and sc_cvt < sc1:
            self._log_nonrepeating_warning(
                f'spacecraft_clock_count1 ({sc1}) and spacecraft_clock_count2 '
                + f'({sc_cvt}) are in the wrong order - setting to count1')
            sc_cvt = sc1

        return sc_cvt