def __init__(self, rows, cols):
        rows = tuple(float(y) for y in rows)
        cols = tuple(float(x) for x in cols)
        self.rows = tuple(sorted(rows))
        self.cols = tuple(sorted(cols))

        if self.rows == rows:
            self.invert_y = False
        elif self.rows == tuple(reversed(rows)):
            self.invert_y = True
        else:
            raise ValueError('row coordinates are not ordered')

        if self.cols == cols:
            self.invert_x = False
        elif self.cols == tuple(reversed(cols)):
            self.invert_x = True
        else:
            raise ValueError('column coordinates are not ordered')