示例#1
0
def dummy_test(infile, expfile):

    # load input test data
    ifile = open(infile, "br")
    idic = pickle.load(ifile)
    ifile.close()

    Y = idic["Y"]
    FWHM = idic["FWHM"]

    surf = {}
    if "tri" in idic.keys():
        surf["tri"] = idic["tri"]

    if "lat" in idic.keys():
        surf["lat"] = idic["lat"]

    # run mesh_smooth
    Y_out = mesh_smooth(Y, surf, FWHM)

    # load expected outout data
    efile = open(expfile, "br")
    expdic = pickle.load(efile)
    efile.close()
    Y_exp = expdic["Python_Y"]

    testout = []

    comp = np.allclose(Y_out, Y_exp, rtol=1e-05, equal_nan=True)
    testout.append(comp)

    assert all(flag == True for (flag) in testout)
示例#2
0
def generate_smooth_out(rand_dict):
    """Uses rand_dict to run mesh_smooth and returns the smoothed data."""
    # below are going to be input params for mesh_smooth
    Y = rand_dict["Y"]
    FWHM = rand_dict["FWHM"]
    surf = {}
    if "tri" in rand_dict.keys():
        surf["tri"] = rand_dict["tri"]
    if "lat" in rand_dict.keys():
        surf["lat"] = rand_dict["lat"]

    # run mesh_smooth and return the smoothed data
    O = {}
    O["Python_Y"] = mesh_smooth(Y, surf, FWHM)

    return O