def get_optimal_resolution(bbox): """ Determines the optimal resolution of the image: * best resolution that still produces an image smaller than 5000x5000 pixels """ x_pxs, y_pxs = bbox_to_resolution(bbox, width=1, height=1) resx = (int((x_pxs - 1) / 50000) + 1) * 10 resy = (int((y_pxs - 1) / 50000) + 1) * 10 return resx, resy
def _scale_factors(self, reference_shape, bbox): """Compute the resampling factors for height and width of the input array and sigma :param reference_shape: Tuple specifying height and width in pixels of high-resolution array :type reference_shape: (int, int) :param bbox: An EOPatch bounding box :type bbox: sentinelhub.BBox :return: Rescale factor for rows and columns :rtype: ((float, float), float) """ res_x, res_y = bbox_to_resolution(bbox, width=reference_shape[1], height=reference_shape[0]) if self.proc_resolution is None: pres_x, pres_y = res_x, res_y else: pres_x, pres_y = self.proc_resolution rescale = res_y / pres_y, res_x / pres_x sigma = 200 / (pres_x + pres_y) return rescale, sigma