Exemple #1
0
def main():
    try:
        tc = trackchart.new([
            (1024, 768),
            20,
            float(sys.argv[-3]),
            float(sys.argv[-2]),
            "../known/berlin.csv",
            sys.argv[-1],
        ])
    except (IndexError, ValueError):
        print("Usage: %s start_mile end_mile data_file" % sys.argv[0])
        sys.exit()

    trackchart.mainline(tc)
    trackchart.mileposts(tc, from_file=True)
    trackchart.bridges_and_crossings(tc)
    trackchart.stations(tc)
    #trackchart.elevation(tc)
    #trackchart.curvature(tc)
    trackchart.accel(tc)
    trackchart.townlines(tc)
    trackchart.yardlimits(tc)
    trackchart.controlpoints(tc)
    trackchart.sidings(tc)
    trackchart.draw_title(tc)

    filename = "images/berlin_%s_%s.png" % (sys.argv[-3], sys.argv[-2])
    tc['image'].save(filename)
    os.system("eog %s" % filename)
Exemple #2
0
def main():
    """
    Main
    """
    try:
        mychart = trackchart.new([(1024, 768),
                                 20, float(sys.argv[-3]), float(sys.argv[-2]),
                                 "../known/northern.csv", sys.argv[-1]])
    except (IndexError, ValueError):
        print("Usage: %s start_mile end_mile file.json" % sys.argv[0])
        sys.exit()

    data_file = sys.argv[-1] != "-"

    #print("border")
    #trackchart.border(mychart)
    print("mainline")
    trackchart.mainline(mychart)
    print("mileposts")
    trackchart.mileposts(mychart, from_file=True)
    print("bridges")
    trackchart.bridges_and_crossings(mychart)
    print("stations")
    trackchart.stations(mychart)
    print("townlines")
    trackchart.townlines(mychart)
    print("yardlimits")
    trackchart.yardlimits(mychart)
    print("controlpoints")
    trackchart.controlpoints(mychart)
    print("sidings")
    trackchart.sidings(mychart)
    print("title")
    trackchart.draw_title(mychart)
    if data_file:
        #print("elevation")
        #trackchart.elevation(mychart)
        #print("curvature")
        #trackchart.curvature(mychart)
        print("accel")
        trackchart.accel(mychart)
        print("plot value")
        trackchart.plot_value(mychart, field="acc_z", scale=1)
        #print("lidar-gage")
        #trackchart.gage(mychart)
        print("string chart")
        #trackchart.string_chart_by_time(mychart)


    filename = "images/northern_%s_%s.png" % (sys.argv[-3], sys.argv[-2])
    mychart['image'].save(filename)
    os.system("eog %s" % filename)
Exemple #3
0
def main():
    """
    Main
    """
    try:
        mychart = trackchart.new([(1024, 768), 20,
                                  float(sys.argv[-3]),
                                  float(sys.argv[-2]), "../known/negs.csv",
                                  sys.argv[-1]])
    except (IndexError, ValueError):
        print("Usage: %s start_mile end_mile" % sys.argv[0])
        sys.exit()

    #print("border")
    #trackchart.border(mychart)
    print("mainline")
    trackchart.mainline(mychart)
    print("mileposts")
    trackchart.mileposts(mychart, from_file=False)
    print("bridges")
    trackchart.bridges_and_crossings(mychart)
    print("stations")
    trackchart.stations(mychart)
    print("elevation")
    trackchart.elevation(mychart)
    print("curvature")
    #trackchart.curvature(mychart)
    print("accel")
    trackchart.accel(mychart)
    #print("lidar-gage")
    #trackchart.gage(mychart)
    print("townlines")
    trackchart.townlines(mychart)
    print("yardlimits")
    trackchart.yardlimits(mychart)
    print("controlpoints")
    trackchart.controlpoints(mychart)
    print("sidings")
    trackchart.sidings(mychart)
    print("title")
    trackchart.draw_title(mychart)

    filename = "images/pl_%s_%s.png" % (sys.argv[-3], sys.argv[-2])
    mychart['image'].save(filename)
    os.system("eog %s" % filename)