def __init__(self, node):
        self.band_id = str(get_only_value(node, BAND_ID))
        self.detector_id = str(get_only_value(node, DETECTOR_ID))
        LOGGER.debug("self.band id : %s:%s", self.band_id, type(self.band_id))
        LOGGER.debug("self.detectorid %s:%s", self.detector_id,
                     type(self.detector_id))
        self.zenith_values = node.xpath(GRID_ZENITH)
        self.azimuth_values = node.xpath(GRID_AZIMUTH)

        # Get ROW_STEP and COL_STEP
        all_col_step = node.xpath(COL_STEP)
        all_row_step = node.xpath(ROW_STEP)
        all_step_unit = node.xpath(STEP_UNIT)
        LOGGER.debug("%s, %s", all_col_step, all_row_step)
        LOGGER.debug(set(all_row_step))

        if not len(set(all_col_step)) == 1:
            raise MajaNotYetImplemented(
                "COL_STEP is different for Zenith than Azimuth %s" %
                all_col_step)

        if not len(set(all_row_step)) == 1:
            raise MajaNotYetImplemented(
                "ROW_STEP is different for Zenith than Azimuth %s" %
                all_row_step)

        if not len(set(all_step_unit)) == 1:
            raise MajaNotYetImplemented(
                "Step units are different for Zenith than Azimuth %s" %
                all_step_unit)

        self.col_step = all_col_step[0]
        self.row_step = all_row_step[0]
        self.step_unit = all_step_unit[0]
    def _read(self, tile_angles_node, sun_angle_node_name):
        """
        Read the following information from the given xml node

            - mean of sun zenith and sun azimuth angle
            - the grid of values
            - the step in x and y

        """
        LOGGER.debug(tile_angles_node)
        sun_angles_mean_node = get_only_value(tile_angles_node,
                                              MEAN_SUN_ANGLES)
        LOGGER.debug(sun_angles_mean_node)
        self.sun_angles_mean = {
            "sun_zenith_angle":
            get_only_value(sun_angles_mean_node, ZENITH_ANGLE),
            "sun_azimuth_angle":
            get_only_value(sun_angles_mean_node, AZIMUTH_ANGLE)
        }
        LOGGER.debug("Sun angles : %s", self.sun_angles_mean)

        SUN_ANGLES_GRID_ZENITH = sun_angle_node_name + "/" + GRID_ZENITH
        SUN_ANGLES_GRID_AZIMUTH = sun_angle_node_name + "/" + GRID_AZIMUTH

        self.zenith_angle_list_string_values = tile_angles_node.xpath(
            SUN_ANGLES_GRID_ZENITH)
        self.azimuth_angle_list_string_values = tile_angles_node.xpath(
            SUN_ANGLES_GRID_AZIMUTH)

        _sun_angles_grid_node = get_only_value(tile_angles_node,
                                               SUN_ANGLE_GRID_NODE_NAME,
                                               check=True)
        if _sun_angles_grid_node is not None:
            all_col_step = _sun_angles_grid_node.xpath(COL_STEP)
            all_row_step = _sun_angles_grid_node.xpath(ROW_STEP)
            all_step_unit = _sun_angles_grid_node.xpath(STEP_UNIT)
            LOGGER.debug("%s, %s", all_col_step, all_row_step)
            LOGGER.debug(set(all_row_step))

            if not len(set(all_col_step)) == 1:
                raise MajaNotYetImplemented(
                    "COL_STEP is different for Zenith than Azimuth %s" %
                    all_col_step)

            if not len(set(all_row_step)) == 1:
                raise MajaNotYetImplemented(
                    "ROW_STEP is different for Zenith than Azimuth %s" %
                    all_row_step)

            if not len(set(all_step_unit)) == 1:
                raise MajaNotYetImplemented(
                    "Step units are different for Zenith than Azimuth %s" %
                    all_step_unit)

            self.col_step = all_col_step[0]
            self.row_step = all_row_step[0]
            self.step_unit = all_step_unit[0]
def solar_angle(solar_angle_image, sol1_height, sol_href, output_image, sol2_in=None, sol2_height=None,
                write_output=True):
    # test about input and raise MajaNotYetImplemented is case of sol2 case
    if sol2_in is not None or sol2_height is not None:
        raise MajaNotYetImplemented()

    parameters = {"sol1.in": solar_angle_image,
                  "sol1.h": sol1_height,
                  "solhref": sol_href,
                  "sol": output_image}

    app = OtbAppHandler("SolarAngle", parameters, write_output)

    return app
 def write(self):
     raise MajaNotYetImplemented("Could not instanciate base class")
 def create(self, plugin_name, app_handler):
     raise MajaNotYetImplemented("Could not instanciate base class")
 def write_qlt_product(self, p_res, p_qlt_image_filename, working_dir):
     raise MajaNotYetImplemented("Could not instanciate base class")
 def can_write(self, plugin_name):
     raise MajaNotYetImplemented("Could not instanciate base class")
Beispiel #8
0
 def read(self, product_info, app_handler, l2comm, dem, pReadL1Mode):
     raise MajaNotYetImplemented("Could not instanciate base class")
Beispiel #9
0
 def detect_l1_products(self, dir_name, product_list):
     raise MajaNotYetImplemented("DetectL1Products : Could not instanciate base class")
Beispiel #10
0
 def initialize(self, product_filename):
     raise MajaNotYetImplemented("Initialize : Could not instanciate base class")