#     Conclusion.py: Loads lists of guidepoints computed with the gradient
# descent method and checks absolute and relative errors againts real
# guidepoints. Plots real curve, a noisy data example, and a curve generated
# from guidepoints found using gradient descent on that noisy example.

# Automatically sets working directory to the folder enclosing this file
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)

# Get input to make sure data matches what was chosen when Setup.py ran
input1 = getTextInput("\nMake sure you've already run Setup.py, then "\
                        "GradDesc.py.\n\nWhich preset did you use?\n\n"\
                        "Enter a number to choose path data:\n"\
                        "1: Los Angeles to New York\n"\
                        "2: Rome to Paris\n"\
                        "3: Cape Town to Tokyo\n"\
                        "...Leaving blank will default to 1.\n",\
                     "^[1-3]$", "1")

if input1 == "1":
    rt = pre.la_ny
elif input1 == "2":
    rt = pre.rm_pa
else:
    rt = pre.ct_tk


#     Lists for the guidepoints estimated using the gradient descent
# method are loaded below. [0],[1], and [2] are different sets of noisy
# data, [4] had no noise.
예제 #2
0
#     Setup.py: Gets list of points along the true Bezier curve that was
# requested, plus another list of the same data with Gaussian noise added.
# Plots the curve and noisy data if requested.

# Automatically sets working directory to the folder enclosing this file
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)

# Get input deciding which preset flight path to use and whether or not to
# show plot of true flight path and a set of noisy data points
input1 = getTextInput("\nThis file will save sample data to file \"pings\"\n\n"\
                        "Enter a number to choose path data:\n"\
                        "1: Los Angeles to New York\n"\
                        "2: Rome to Paris\n"\
                        "3: Cape Town to Tokyo\n"\
                        "...Leaving blank will default to 1.\n",\
                     "^[1-3]$", "1")

input2 = getTextInput("Show sample plot? [y/n]\n"\
                        "...Leaving blank will default to n.\n",\
                     "^[yn]$", "n")

if input1 == "1":
    rt = pre.la_ny
elif input1 == "2":
    rt = pre.rm_pa
else:
    rt = pre.ct_tk