Loading ale/__init__.py +1 −0 Original line number Diff line number Diff line from . import drivers from . import formatters from .drivers import load, loads ale/base/data_naif.py +11 −10 Original line number Diff line number Diff line Loading @@ -76,10 +76,8 @@ class NaifSpice(): @property def target_frame_id(self): frame_id, frame_name, found = spice.cidfrm(self.target_id) if not found: raise ValueError("No reference frame could be found for target ID {}.".format(self.target_id)) return frame_id frame_info = spice.cidfrm(self.target_id) return frame_info[0] @property def sensor_frame_id(self): Loading Loading @@ -132,7 +130,7 @@ class NaifSpice(): 'NONE', self.target_name) return [sun_state[:4].tolist()], [sun_state[3:6].tolist()], self.center_ephemeris_time return [sun_state[:4].tolist()], [sun_state[3:6].tolist()], [self.center_ephemeris_time] @property def sensor_position(self): Loading Loading @@ -180,16 +178,16 @@ class NaifSpice(): body_times = np.array(self.ephemeris_time) for i, time in enumerate(self.ephemeris_time): sensor2j2000 = spice.pxform( self.sensor_frame_id, j2000_id, spice.frmnam(self.sensor_frame_id), spice.frmnam(j2000_id), time) q_sensor = spice.m2q(sensor2j2000) sensor_quats[i,:3] = q_sensor[1:] sensor_quats[i,3] = q_sensor[0] body2j2000 = spice.pxform( self.target_frame_id, j2000_id, spice.frmnam(self.target_frame_id), spice.frmnam(j2000_id), time) q_body = spice.m2q(body2j2000) body_quats[i,:3] = q_body[1:] Loading Loading @@ -241,7 +239,10 @@ class NaifSpice(): @property def ephemeris_stop_time(self): if self.spacecraft_clock_stop_count: return spice.scs2e(self.spacecraft_id, self.spacecraft_clock_stop_count) else: return spice.str2et(self.utc_stop_time.strftime("%Y-%m-%d %H:%M:%S")) @property def center_ephemeris_time(self): Loading ale/base/label_pds3.py +14 −12 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ class Pds3Label(): Returns the exposure duration in seconds from the PDS3 label. """ # The EXPOSURE_DURATION may either be stored as a (value, unit) or just a value if 'EXPOSURE_DURATION' in self.label: try: unit = self.label['EXPOSURE_DURATION'].units unit = unit.lower() Loading @@ -240,8 +241,9 @@ class Pds3Label(): # With no units, assume milliseconds except: # NOTE: If the key does not exist at all, this will cause an error about exception within an exception return self.label['EXPOSURE_DURATION'] * 0.001 else: return self.line_exposure_duration # Consider expanding this to handle units Loading ale/base/type_sensor.py +2 −2 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ class LineScanner(): 2d list of scan rates in the form: [[start_line, line_time, exposure_duration], ...] """ t0_ephemeris = self.ephemeris_start_time - self.center_ephemeris_time return [[float(self.starting_detector_line)], [t0_ephemeris], [self._line_exposure_duration]] return [[0.5], [t0_ephemeris], [self.exposure_duration]] @property def ephemeris_time(self): return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, self.image_lines) return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, self.image_lines / 64) class Framer(): @property Loading ale/drivers/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ from abc import ABC import datetime # dynamically load drivers __all__ = [os.path.splitext(os.path.basename(d))[0] for d in glob(os.path.join(os.path.dirname(__file__), '*_driver.py'))] __all__ = [os.path.splitext(os.path.basename(d))[0] for d in glob(os.path.join(os.path.dirname(__file__), '*_drivers.py'))] __driver_modules__ = [importlib.import_module('.'+m, package='ale.drivers') for m in __all__] drivers = dict(chain.from_iterable(inspect.getmembers(dmod, lambda x: inspect.isclass(x) and "_driver" in x.__module__) for dmod in __driver_modules__)) Loading Loading
ale/__init__.py +1 −0 Original line number Diff line number Diff line from . import drivers from . import formatters from .drivers import load, loads
ale/base/data_naif.py +11 −10 Original line number Diff line number Diff line Loading @@ -76,10 +76,8 @@ class NaifSpice(): @property def target_frame_id(self): frame_id, frame_name, found = spice.cidfrm(self.target_id) if not found: raise ValueError("No reference frame could be found for target ID {}.".format(self.target_id)) return frame_id frame_info = spice.cidfrm(self.target_id) return frame_info[0] @property def sensor_frame_id(self): Loading Loading @@ -132,7 +130,7 @@ class NaifSpice(): 'NONE', self.target_name) return [sun_state[:4].tolist()], [sun_state[3:6].tolist()], self.center_ephemeris_time return [sun_state[:4].tolist()], [sun_state[3:6].tolist()], [self.center_ephemeris_time] @property def sensor_position(self): Loading Loading @@ -180,16 +178,16 @@ class NaifSpice(): body_times = np.array(self.ephemeris_time) for i, time in enumerate(self.ephemeris_time): sensor2j2000 = spice.pxform( self.sensor_frame_id, j2000_id, spice.frmnam(self.sensor_frame_id), spice.frmnam(j2000_id), time) q_sensor = spice.m2q(sensor2j2000) sensor_quats[i,:3] = q_sensor[1:] sensor_quats[i,3] = q_sensor[0] body2j2000 = spice.pxform( self.target_frame_id, j2000_id, spice.frmnam(self.target_frame_id), spice.frmnam(j2000_id), time) q_body = spice.m2q(body2j2000) body_quats[i,:3] = q_body[1:] Loading Loading @@ -241,7 +239,10 @@ class NaifSpice(): @property def ephemeris_stop_time(self): if self.spacecraft_clock_stop_count: return spice.scs2e(self.spacecraft_id, self.spacecraft_clock_stop_count) else: return spice.str2et(self.utc_stop_time.strftime("%Y-%m-%d %H:%M:%S")) @property def center_ephemeris_time(self): Loading
ale/base/label_pds3.py +14 −12 Original line number Diff line number Diff line Loading @@ -230,6 +230,7 @@ class Pds3Label(): Returns the exposure duration in seconds from the PDS3 label. """ # The EXPOSURE_DURATION may either be stored as a (value, unit) or just a value if 'EXPOSURE_DURATION' in self.label: try: unit = self.label['EXPOSURE_DURATION'].units unit = unit.lower() Loading @@ -240,8 +241,9 @@ class Pds3Label(): # With no units, assume milliseconds except: # NOTE: If the key does not exist at all, this will cause an error about exception within an exception return self.label['EXPOSURE_DURATION'] * 0.001 else: return self.line_exposure_duration # Consider expanding this to handle units Loading
ale/base/type_sensor.py +2 −2 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ class LineScanner(): 2d list of scan rates in the form: [[start_line, line_time, exposure_duration], ...] """ t0_ephemeris = self.ephemeris_start_time - self.center_ephemeris_time return [[float(self.starting_detector_line)], [t0_ephemeris], [self._line_exposure_duration]] return [[0.5], [t0_ephemeris], [self.exposure_duration]] @property def ephemeris_time(self): return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, self.image_lines) return np.linspace(self.ephemeris_start_time, self.ephemeris_stop_time, self.image_lines / 64) class Framer(): @property Loading
ale/drivers/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ from abc import ABC import datetime # dynamically load drivers __all__ = [os.path.splitext(os.path.basename(d))[0] for d in glob(os.path.join(os.path.dirname(__file__), '*_driver.py'))] __all__ = [os.path.splitext(os.path.basename(d))[0] for d in glob(os.path.join(os.path.dirname(__file__), '*_drivers.py'))] __driver_modules__ = [importlib.import_module('.'+m, package='ale.drivers') for m in __all__] drivers = dict(chain.from_iterable(inspect.getmembers(dmod, lambda x: inspect.isclass(x) and "_driver" in x.__module__) for dmod in __driver_modules__)) Loading