def populate_obs_mission_voyager_spacecraft_clock_count2(**kwargs): metadata = kwargs['metadata'] supp_index_row = metadata['supp_index_row'] if supp_index_row is None: return None partition = import_util.safe_column(supp_index_row, 'SPACECRAFT_CLOCK_PARTITION_NUMBER') stop_time = supp_index_row['SPACECRAFT_CLOCK_STOP_COUNT'] sc = str(partition) + '/' + stop_time try: sc_cvt = opus_support.parse_voyager_sclk(sc) except Exception as e: import_util.log_nonrepeating_error( f'Unable to parse Voyager SCLK "{sc}": {e}') return None voyager_row = metadata['obs_mission_voyager_row'] sc1 = voyager_row['spacecraft_clock_count1'] if sc1 is not None and sc_cvt < sc1: import_util.log_warning( f'spacecraft_clock_count1 ({sc1}) and spacecraft_clock_count2 ({sc_cvt}) ' +f'are in the wrong order - setting to count1') sc_cvt = sc1 return sc_cvt
def field_obs_mission_voyager_spacecraft_clock_count1(self): sc = self._some_index_or_label_col('SPACECRAFT_CLOCK_START_COUNT') if self._col_in_some_index_or_label('SPACECRAFT_CLOCK_PARTITION_NUMBER'): partition = self._some_index_or_label_col('SPACECRAFT_CLOCK_PARTITION_NUMBER') sc = str(partition) + '/' + sc try: sc_cvt = opus_support.parse_voyager_sclk(sc) except Exception as e: self._log_nonrepeating_error(f'Unable to parse Voyager SCLK "{sc}": {e}') return None return sc_cvt
def populate_obs_mission_voyager_spacecraft_clock_count1(**kwargs): metadata = kwargs['metadata'] supp_index_row = metadata['supp_index_row'] if supp_index_row is None: return None partition = import_util.safe_column(supp_index_row, 'SPACECRAFT_CLOCK_PARTITION_NUMBER') start_time = supp_index_row['SPACECRAFT_CLOCK_START_COUNT'] sc = str(partition) + '/' + start_time try: sc_cvt = opus_support.parse_voyager_sclk(sc) except Exception as e: import_util.log_nonrepeating_error( f'Unable to parse Voyager SCLK "{sc}": {e}') return None return sc_cvt
def field_obs_mission_voyager_spacecraft_clock_count2(self): sc = self._some_index_or_label_col('SPACECRAFT_CLOCK_STOP_COUNT') if self._col_in_some_index_or_label('SPACECRAFT_CLOCK_PARTITION_NUMBER'): partition = self._some_index_or_label_col('SPACECRAFT_CLOCK_PARTITION_NUMBER') sc = str(partition) + '/' + sc try: sc_cvt = opus_support.parse_voyager_sclk(sc) except Exception as e: self._log_nonrepeating_error(f'Unable to parse Voyager SCLK "{sc}": {e}') return None sc1 = self.field_obs_mission_voyager_spacecraft_clock_count1() if sc1 is not None and sc_cvt < sc1: self._log_nonrepeating_warning( f'spacecraft_clock_count1 ({sc1}) and '+ f'spacecraft_clock_count2 ({sc_cvt}) '+ 'are in the wrong order - setting to count1') sc_cvt = sc1 return sc_cvt