def get_corners(model_params, gmt_format=False):
    """Retrieve corners of simulation domain from model params file.
    model_params: file path to model params
    gmt_format: if True, also returns corners in GMT string format
    """
    # with -45 degree rotation:
    #   c2
    # c1  c3
    #   c4
    corners = []
    with open(model_params, "r") as vmpf:
        lines = vmpf.readlines()
        # make sure they are read in the correct order at efficiency cost
        for corner in ["c1=", "c2=", "c3=", "c4="]:
            for line in lines:
                if corner in line:
                    corners.append(list(map(float, line.split()[1:3])))
    if not gmt_format:
        return corners
    # corners in GMT format
    cnr_str = "\n".join([" ".join(map(str, cnr)) for cnr in corners])
    return corners, cnr_str