def _make_request(self, bbox, meta_info, timestamps):
        """ Make OGC request to create input for cloud detector classifier

        :param bbox: Bounding box
        :param meta_info: Meta-info dictionary of input eopatch
        :return: Requested data
        """
        service_type = ServiceType(meta_info['service_type'])

        # Raise error if resolutions are not specified
        if self.cm_size_x is None and self.cm_size_y is None:
            raise ValueError("Specify size_x and size_y for data request")

        # If WCS request, make sure both resolutions are set
        if service_type == ServiceType.WCS:
            if self.cm_size_y is None:
                self.cm_size_y = self.cm_size_x
            elif self.cm_size_x is None:
                self.cm_size_x = self.cm_size_y

        custom_url_params = {CustomUrlParam.SHOWLOGO: False,
                             CustomUrlParam.TRANSPARENT: False,
                             CustomUrlParam.EVALSCRIPT: self.model_evalscript}

        request = {ServiceType.WMS: self._get_wms_request,
                   ServiceType.WCS: self._get_wcs_request}[service_type](bbox,
                                                                         meta_info['time_interval'],
                                                                         self.cm_size_x,
                                                                         self.cm_size_y,
                                                                         meta_info['maxcc'],
                                                                         meta_info['time_difference'],
                                                                         custom_url_params)

        request_dates = request.get_dates()
        download_frames = get_common_timestamps(request_dates, timestamps)

        request_return = request.get_data(raise_download_errors=False, data_filter=download_frames)
        bad_data = [idx for idx, value in enumerate(request_return) if value is None]
        for idx in reversed(sorted(bad_data)):
            LOGGER.warning('Data from %s could not be downloaded for %s!', str(request_dates[idx]), self.data_feature)
            del request_return[idx]
            del request_dates[idx]

        return np.asarray(request_return), request_dates
def _make_request ( self , bbox , meta_info , timestamps ) : service_type = ServiceType ( meta_info [ 'service_type' ] ) if self . cm_size_x is None and self . cm_size_y is None : raise ValueError ( "Specify size_x and size_y for data request" ) if service_type == ServiceType . WCS : if self . cm_size_y is None : self . cm_size_y = self . cm_size_x elif self . cm_size_x is None : self . cm_size_x = self . cm_size_y custom_url_params = { CustomUrlParam . SHOWLOGO : False , CustomUrlParam . TRANSPARENT : False , CustomUrlParam . EVALSCRIPT : self . model_evalscript } request = { ServiceType . WMS : self . _get_wms_request , ServiceType . WCS : self . _get_wcs_request } [ service_type ] ( bbox , meta_info [ 'time_interval' ] , self . cm_size_x , self . cm_size_y , meta_info [ 'maxcc' ] , meta_info [ 'time_difference' ] , custom_url_params ) request_dates = request . get_dates ( ) download_frames = get_common_timestamps ( request_dates , timestamps ) request_return = request . get_data ( raise_download_errors = False , data_filter = download_frames ) bad_data = [ idx for idx , value in enumerate ( request_return ) if value is None ] for idx in reversed ( sorted ( bad_data ) ) : LOGGER . warning ( 'Data from %s could not be downloaded for %s!' , str ( request_dates [ idx ] ) , self . data_feature ) del request_return [ idx ] del request_dates [ idx ] return np . asarray ( request_return ) , request_dates
Make OGC request to create input for cloud detector classifier

        :param bbox: Bounding box
        :param meta_info: Meta-info dictionary of input eopatch
        :return: Requested data