diff --git a/oops/backplane/limb.py b/oops/backplane/limb.py index c7817574..a04d61b0 100755 --- a/oops/backplane/limb.py +++ b/oops/backplane/limb.py @@ -30,7 +30,7 @@ def limb_altitude(self, event_key, zmin=None, zmax=None, scaled=False): radius = body.surface.radii.max() if zmin is not None: zmin = zmin * radius - if zmin is not None: + if zmax is not None: zmax = zmax * radius key = ('limb_altitude', event_key, zmin, zmax) @@ -159,7 +159,7 @@ def limb_latitude(self, event_key, lat_type='centric'): return self.register_backplane(key, latitude) #=============================================================================== -def limb_clock_angle(self, event_key): +def limb_clock_angle(self, event_key, zmin=None, zmax=None, scaled=False): """Angular location around the limb, measured clockwise from the projected north pole. @@ -168,8 +168,16 @@ def limb_clock_angle(self, event_key): limb_altitude backplane key, in which case this backplane inherits the mask of the given backplane array. + zmin lower limit on altitude; lower values are masked. + zmax upper limit on altitude. + scaled if True, zmin and zmax are in units of the maximum body radius. """ + # Get the altitude backplane + altitude_key = ('limb_altitude', event_key, zmin, zmax) + altitude = limb_altitude(self, event_key, zmin=zmin, zmax=zmax, scaled=scaled) + + # Create the clock angle backplane (event_key, backplane_key) = self._event_and_backplane_keys(event_key, LIMB_BACKPLANES, default='LIMB') @@ -194,8 +202,13 @@ def limb_clock_angle(self, event_key): event = polar_surface.apply_coords_to_event(event, obs=self.obs_event, axes=2, derivs=self.ALL_DERIVS) + clock_angle = event.coord2 + + # copy altitude mask + if np.any(altitude.mask): + clock_angle = clock_angle.remask_or(altitude.mask) - return self.register_backplane(key, event.coord2) + return self.register_backplane(key, clock_angle) ################################################################################ diff --git a/oops/hosts/galileo/ssi/__init__.py b/oops/hosts/galileo/ssi/__init__.py index f1b34dac..3a9ca054 100755 --- a/oops/hosts/galileo/ssi/__init__.py +++ b/oops/hosts/galileo/ssi/__init__.py @@ -11,7 +11,6 @@ import pdsparser import oops -from oops.hosts import pds3 from oops.hosts.galileo import Galileo from filecache import FCPath @@ -42,7 +41,7 @@ def from_file(filespec, filespec = FCPath(filespec) # Load the PDS label - label = pds3.get_label(filespec) + label = pdsparser.PdsLabel.from_file(filespec).as_dict() # Load the data array local_path = filespec.retrieve() @@ -211,6 +210,8 @@ def __init__(self, meta_dict): self.target = meta_dict['TARGET_NAME'] # Telemetry mode + if 'TELEMETRY_FORMAT_ID' not in meta_dict: + meta_dict['TELEMETRY_FORMAT_ID'] = 'NONE' self.mode = meta_dict['TELEMETRY_FORMAT_ID'] # Window @@ -366,9 +367,12 @@ def initialize(planets=None, asof=None, SSI.fovs['HCM'] = fov_full # Inference based on inspection # hmmm, actually C0248807700R.img is 800x200 # maybe this is just a cropped full fov + SSI.fovs['NONE'] = fov_full # Inference based on inspection # Construct the SpiceFrame - _ = oops.frame.SpiceFrame("GLL_SCAN_PLATFORM") + # SSI images are spaced as closely as 1 unit in the file name, which + # corresponds to 80 clock ticks. Therefore, we use a tolerance of +/-40 + _ = oops.frame.SpiceType1Frame("GLL_SCAN_PLATFORM", -77, 40) # Load kernels Galileo.load_kernels()