Calculate local index from global index
        :param index: input index
        :return: local index for data

def local_to_global(self, index):
        """ Calculate local index from global index
        :param index: input index
        :return: local index for data
        """

        if (type(index) is int) or (type(index) is slice):
            if len(self.__mask) > 1:
                raise IndexError('check length of parameter index')
            # 1D array
            if type(index) is int:
                return self.int_local_to_global(index)

            elif type(index) is slice:
                return self.slice_local_to_global(index)

            else:
                raise IndexError('check data type of index to be integer or slice')

        elif type(index) is tuple:

            local_index = []

            for k, item in enumerate(index):
                if k < len(self.__mask):

                    if type(item) is slice:
                        temp_index = self.slice_local_to_global(item, k)

                    elif type(item) in [int, np.int64, np.int32]:
                        temp_index = self.int_local_to_global(item, k)

                    if temp_index is None:
                        return temp_index

                else:
                    temp_index = item

                local_index.append(temp_index)

            return tuple(local_index)
        else:
            raise IndexError('check index for correct length and type')