Exemplo n.º 1
0
    def trim_non_ocean_data(self, l1b):
        """ Remove leading and trailing data that is not if type ocean """

        self.log.info("- trim outer non-ocean regions")
        ocean = l1b.surface_type.get_by_name("ocean")
        first_ocean_index = get_first_array_index(ocean.flag, True)
        last_ocean_index = get_last_array_index(ocean.flag, True)
        if first_ocean_index is None or last_ocean_index is None:
            return None
        n = l1b.info.n_records-1
        is_full_ocean = first_ocean_index == 0 and last_ocean_index == n
        if not is_full_ocean:
            ocean_subset = np.arange(first_ocean_index, last_ocean_index+1)
            self.log.info("- ocean subset [%g:%g]" % (first_ocean_index, last_ocean_index))
            l1b.trim_to_subset(ocean_subset)

        return l1b
Exemplo n.º 2
0
    def trim_non_ocean_data(self, l1):
        """
        Remove leading and trailing data that is not if type ocean. 
        :param l1: The input Level-1 objects
        :return: The subsetted Level-1 objects. (Segments with no ocean data are removed from the list)
        """ """ """

        ocean = l1.surface_type.get_by_name("ocean")
        first_ocean_index = get_first_array_index(ocean.flag, True)
        last_ocean_index = get_last_array_index(ocean.flag, True)
        if first_ocean_index is None or last_ocean_index is None:
            return None
        n = l1.info.n_records - 1
        is_full_ocean = first_ocean_index == 0 and last_ocean_index == n
        if not is_full_ocean:
            ocean_subset = np.arange(first_ocean_index, last_ocean_index + 1)
            l1.trim_to_subset(ocean_subset)
        return l1