(arrays, target_resolution, skip=[])
return output
Upscale a dict of arrays to a certain resolution.
    The dictionary key must be a resolution,
    and the values can either be an array or list of arrays.
    
    Use skip to ignore array indexes in the list.
Upscale a dict of arrays to a certain resolution.
    The dictionary key must be a resolution,
    and the values can either be an array or list of arrays.
    
    Use skip to ignore array indexes in the list.
Upscale a dict of arrays to a certain resolution . The dictionary key must be a resolution and the values can either be an array or list of arrays . Use skip to ignore array indexes in the list .
def upscale_arrays_to_resolution(arrays, target_resolution, skip=[]):
    """Upscale a dict of arrays to a certain resolution.
    The dictionary key must be a resolution,
    and the values can either be an array or list of arrays.
    
    Use skip to ignore array indexes in the list.
    """
    if isinstance(skip, int):
        skip = [skip]
    skip = set(skip)

    #Count number of arrays
    num_arrays = 0
    for resolution, array_list in iteritems(arrays):
        if isinstance(array_list, (list, tuple)):
            array_len = len(array_list)
            num_arrays += array_len - len([i for i in range(array_len) if i in skip])
        elif 0 not in skip:
            num_arrays += 1

    #Upscale each array
    LANGUAGE.strings['Generation']['UpscaleArrayStart'].format_custom(XRES=target_resolution[0], YRES=target_resolution[1])
    processed = 0
    output = []
    for resolution, array_list in iteritems(arrays):

        if not isinstance(array_list, (list, tuple)):
            array_list = [array_list]
            
        for i, array in enumerate(array_list):
            if i in skip:
                continue
            processed += 1
            Message(LANGUAGE.strings['Generation']['UpscaleArrayProgress'].format_custom(XRES=resolution[0], YRES=resolution[1],
                                                                                CURRENT=processed, TOTAL=num_arrays))
            zoom_factor = (target_resolution[1] / resolution[1],
                           target_resolution[0] / resolution[0])
            upscaled = upscale(array, zoom_factor)
            output.append(upscaled)
    return output
def upscale_arrays_to_resolution ( arrays , target_resolution , skip = [ ] ) : if isinstance ( skip , int ) : skip = [ skip ] skip = set ( skip ) #Count number of arrays num_arrays = 0 for resolution , array_list in iteritems ( arrays ) : if isinstance ( array_list , ( list , tuple ) ) : array_len = len ( array_list ) num_arrays += array_len - len ( [ i for i in range ( array_len ) if i in skip ] ) elif 0 not in skip : num_arrays += 1 #Upscale each array LANGUAGE . strings [ 'Generation' ] [ 'UpscaleArrayStart' ] . format_custom ( XRES = target_resolution [ 0 ] , YRES = target_resolution [ 1 ] ) processed = 0 output = [ ] for resolution , array_list in iteritems ( arrays ) : if not isinstance ( array_list , ( list , tuple ) ) : array_list = [ array_list ] for i , array in enumerate ( array_list ) : if i in skip : continue processed += 1 Message ( LANGUAGE . strings [ 'Generation' ] [ 'UpscaleArrayProgress' ] . format_custom ( XRES = resolution [ 0 ] , YRES = resolution [ 1 ] , CURRENT = processed , TOTAL = num_arrays ) ) zoom_factor = ( target_resolution [ 1 ] / resolution [ 1 ] , target_resolution [ 0 ] / resolution [ 0 ] ) upscaled = upscale ( array , zoom_factor ) output . append ( upscaled ) return output