def _get_rescale_factors(self, reference_shape, meta_info):
        """ Compute the resampling factor for height and width of the input array

        :param reference_shape: Tuple specifying height and width in pixels of high-resolution array
        :type reference_shape: tuple of ints
        :param meta_info: Meta-info dictionary of input eopatch. Defines OGC request and parameters used to create the
                            eopatch
        :return: Rescale factor for rows and columns
        :rtype: tuple of floats
        """
        # Figure out resampling size
        height, width = reference_shape

        service_type = ServiceType(meta_info['service_type'])
        rescale = None
        if service_type == ServiceType.WMS:

            if (self.cm_size_x is None) and (self.cm_size_y is not None):
                rescale = (self.cm_size_y / height, self.cm_size_y / height)
            elif (self.cm_size_x is not None) and (self.cm_size_y is None):
                rescale = (self.cm_size_x / width, self.cm_size_x / width)
            else:
                rescale = (self.cm_size_y / height, self.cm_size_x / width)

        elif service_type == ServiceType.WCS:
            # Case where only one resolution for cloud masks is specified in 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

            hr_res_x, hr_res_y = int(meta_info['size_x'].strip('m')), int(meta_info['size_y'].strip('m'))
            lr_res_x, lr_res_y = int(self.cm_size_x.strip('m')), int(self.cm_size_y.strip('m'))
            rescale = (hr_res_y / lr_res_y, hr_res_x / lr_res_x)

        return rescale
def _get_rescale_factors ( self , reference_shape , meta_info ) : height , width = reference_shape service_type = ServiceType ( meta_info [ 'service_type' ] ) rescale = None if service_type == ServiceType . WMS : if ( self . cm_size_x is None ) and ( self . cm_size_y is not None ) : rescale = ( self . cm_size_y / height , self . cm_size_y / height ) elif ( self . cm_size_x is not None ) and ( self . cm_size_y is None ) : rescale = ( self . cm_size_x / width , self . cm_size_x / width ) else : rescale = ( self . cm_size_y / height , self . cm_size_x / width ) elif 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 hr_res_x , hr_res_y = int ( meta_info [ 'size_x' ] . strip ( 'm' ) ) , int ( meta_info [ 'size_y' ] . strip ( 'm' ) ) lr_res_x , lr_res_y = int ( self . cm_size_x . strip ( 'm' ) ) , int ( self . cm_size_y . strip ( 'm' ) ) rescale = ( hr_res_y / lr_res_y , hr_res_x / lr_res_x ) return rescale
Compute the resampling factor for height and width of the input array

        :param reference_shape: Tuple specifying height and width in pixels of high-resolution array
        :type reference_shape: tuple of ints
        :param meta_info: Meta-info dictionary of input eopatch. Defines OGC request and parameters used to create the
                            eopatch
        :return: Rescale factor for rows and columns
        :rtype: tuple of floats