⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ddplot

📁 gps源代码
💻
📖 第 1 页 / 共 2 页
字号:
            ddr = float(words[10])            h = int(words[11],16)            # not adding health to the dataLists, this can be changed though                        if ordType[0:2] == "L1":                # get all of this general epoch info from the C/A line only                if ordType[3:6] == "C/A":                    dataListL1[0].append(t)                    dataListL1[1].append(ddr)                    dataListL1[5].append(sv1)                    dataListL1[6].append(elev1)                    dataListL1[7].append(sv2)                    dataListL1[8].append(elev2)                elif ordType[5:12] == "range":  #this will be the L1 P/Y/W range                    dataListL1[2].append(ddr)                elif ordType[5:12] == "phase":                    dataListL1[3].append(ddr)                elif ordType[5:12] == "doppler":                    dataListL1[4].append(ddr)                else:                    if (options.debugLevel):                        print "Didn't understand this line:"                        print line            elif ordType[0:2] == "L2":                # get all of the general epoch info from the range line only                if ordType[5:12] == "range":                    dataListL2[0].append(t)                    dataListL2[1].append(ddr)                    dataListL2[4].append(sv1)                    dataListL2[5].append(elev1)                    dataListL2[6].append(sv2)                    dataListL2[7].append(elev2)                elif ordType[5:12] == "phase":                    dataListL2[2].append(ddr)                elif ordType[5:12] == "doppler":                    dataListL2[3].append(ddr)                else:                    if (options.debugLevel):                        print "Didn't understand this line:"                        print line               dataL1 = numpy.array(dataListL1)    dataL2 = numpy.array(dataListL2)    avergs = numpy.array(avergsList)        del dataListL1, dataListL2, avergsList        # make sure that there is some data to plot    if (plotL1 and dataL1.shape[1] < 1):        print "\n No L1 data to plot. Exiting...\n"        exit;    if (plotL2 and dataL2.shape[1] < 1):        print "\n No L2 data to plot. Exiting...\n"        exit;    if (plotAvg and avergs.shape[1] < 1):        print "\n No averages to plot. Exiting...\n"        exit;        # done reading in the ord file    # A key handler for matplotlib    def press(event):        if event.key=='q' or event.key==' ':            pylab.close()    # Here we start generating the plots    fig = pylab.figure()    pylab.connect('key_press_event', press)    yprops = dict(rotation=90, horizontalalignment='right', verticalalignment='center', family='monospace', x=-0.01)    scale_props = dict(horizontalalignment="right", verticalalignment="bottom", size=8, family="sans-serif")     xMajorFmt=pylab.DateFormatter("%02H:%02M\n%03j")    xMinorFmt=pylab.NullFormatter()    xMajorLoc=matplotlib.dates.DayLocator()    xMinorLoc=matplotlib.dates.HourLocator()    rExtent=0.89    if options.legend:        rExtent=0.80            ax1 = fig.add_axes([0.08, 0.10, rExtent, 0.85])    # experimented with alpha blending on the plot, but couldn't find anything that really helped        # i know this looks rediculous, just trying to control the plotting order    if plotL1:        if plotRange:            if (options.plotAverages < 2):                ax1.plot_date(dataL1[0], dataL1[1], ',', color="r", label="C/A range")                ax2=fig.add_axes(ax1.get_position())                ax2.plot_date(dataL1[0], dataL1[2], ',', color="purple", label="L1 P/Y range")                        if plotPhase:            if (options.plotAverages < 2):                ax3=fig.add_axes(ax1.get_position())                ax3.plot_date(dataL1[0], dataL1[3], ',', color="#FF6600", label="L1 P/Y phase")                        if plotDoppl:            if (options.plotAverages < 2):                ax4=fig.add_axes(ax1.get_position())                ax4.plot_date(dataL1[0], dataL1[4], ',', color="navy", label="L1 P/Y doppler")        if plotL2:        if plotRange:            if (options.plotAverages < 2):                ax4=fig.add_axes(ax1.get_position())                ax4.plot_date(dataL2[0], dataL2[1], ',', color="forestgreen", label="L2 P/Y range")        if plotPhase:            if (options.plotAverages < 2):                ax5=fig.add_axes(ax1.get_position())                ax5.plot_date(dataL2[0], dataL2[2], ',', color="darkslategray", label="L2 P/Y phase")        if plotDoppl:            if (options.plotAverages < 2):                ax6=fig.add_axes(ax1.get_position())                ax6.plot_date(dataL2[0], dataL2[3], ',', color="teal", label="L2 P/Y doppler")                        if plotL1 and plotAvg:        if plotRange:            ax7=fig.add_axes(ax1.get_position())            ax7.plot_date(avergs[0], avergs[1], 'o', color="r", label="C/A rng avg")            ax8=fig.add_axes(ax1.get_position())            ax8.plot_date(avergs[0], avergs[2], 'o', color="purple", label="L1 P/Y rng avg")        if plotPhase:            ax9=fig.add_axes(ax1.get_position())            ax9.plot_date(avergs[0], avergs[3], 'o', color="#FF6600", label="L1 P/Y ph avg")        if plotDoppl:            ax10=fig.add_axes(ax1.get_position())            ax10.plot_date(avergs[0], avergs[4], 'o', color="navy", label="L1 P/Y dop avg")                 if plotL2 and plotAvg:        if plotRange:            ax11=fig.add_axes(ax1.get_position())            ax11.plot_date(avergs[0], avergs[5], 'o', color="forestgreen", label="L2 P/Y rng avg")        if plotPhase:            ax12=fig.add_axes(ax1.get_position())            ax12.plot_date(avergs[0], avergs[6], 'o', color="darkslategray", label="L2 P/Y ph avg")        if plotDoppl:             ax13=fig.add_axes(ax1.get_position())            ax13.plot_date(dataL2[0], dataL2[7], 'o', color="teal", label="L2 P/Y dop avg")                            if options.legend:        ax1.legend(numpoints=2, pad=0.1, labelsep = 0, handlelen=0.005, handletextsep=0.01, axespad=0.0, loc=(1,0))        leg = pylab.gca().get_legend()        ltext = leg.get_texts()        llines = leg.get_lines()        lframe = leg.get_frame()        lframe.set_facecolor('0.4')        pylab.setp(ltext, size=8, family="sans-serif")        pylab.setp(llines, linewidth=2)        leg.draw_frame(False)    ax1.set_ylabel('Double Difference (meters)', **yprops)    ax1.grid(True)    if options.yRange:        ax1.set_ylim(ymin=-options.yRange, ymax=options.yRange)    else:        pylab.figtext(rExtent+.08, 0.95, "y range autoscaled", **scale_props)    ax1.xaxis.set_major_formatter(xMajorFmt)    xlabels=ax1.get_xticklabels()    ylabels=ax1.get_yticklabels()    pylab.setp(xlabels, fontsize=10, family='sans-serif')    pylab.setp(ylabels, fontsize=10, family='sans-serif')    ax1.xaxis.set_minor_formatter(xMinorFmt)    # set x axis range    if options.tStart:      tMin = parse_time(options.tStart.split()[0:3])    else:      tMin = min(dataL1[0])    if options.tEnd:      tMax = parse_time(options.tEnd.split()[0:3])    else:      tMax = max(dataL1[0])    ax1.set_xlim(xmin=tMin, xmax=tMax)    ax1.set_title(options.title)    if (options.saveFig == None):        pylab.show()    else:       pylab.savefig(options.saveFig)# end of maindef parse_time(words):    fsec = float(words[2][8:10])    ydhms =  words[0]+" "+words[1]+" "+words[2][0:8]    utime = time.strptime(ydhms, "%Y %j %H:%M:%S")    dtime = datetime.datetime(utime[0], utime[1], utime[2],                              utime[3], utime[4], utime[5], int(fsec*1e6))    t0 = matplotlib.dates.date2num(dtime)    return t0# end of parse_time()    if __name__ == "__main__":    main()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -