Exemplo n.º 1
0
def _draw_contours(group, index, label, zp, contours):
    import matplotlib.pyplot as plt
    color = next_color()
    # Interpolate on common z
    fp = np.vstack([np.interp(zp, L[0], L[index]) for L in group])
    # Plot the quantiles
    plot_quantiles(zp, fp, contours, color)
    # Plot the best
    plt.plot(zp, fp[0], '-', label=label, color=dark(color))
Exemplo n.º 2
0
def _residuals_contour(Q, residuals, contours=_CONTOURS):
    import pylab
    shift = 0
    for m, r in residuals.items():
        color = next_color()
        plot_quantiles(Q[m], shift+r.T, contours, color)
        pylab.plot(Q[m], shift+r[:, 0], '.', markersize=1,
                   color=dhsv(color, dv=-0.2)) # best
        shift += 5
    _residuals_labels()
Exemplo n.º 3
0
def _residuals_contour(Q, residuals, contours=CONTOURS):
    import matplotlib.pyplot as plt
    shift = 0
    for m, r in residuals.items():
        color = next_color()
        plot_quantiles(Q[m], shift + r.T, contours, color)
        plt.plot(Q[m],
                 shift + r[:, 0],
                 '.',
                 label=m.name,
                 markersize=1,
                 color=dark(color))
        # Use 3 colours from cycle so reflectivity matches rho for each dataset
        next_color()
        next_color()
        shift += 5
    _residuals_labels()
Exemplo n.º 4
0
def _profiles_contour(profiles, contours=_CONTOURS, npoints=200):
    import pylab

    any_magnetic = False
    for p in profiles.values():
        # Find limits of all profiles
        z = np.hstack([line[0] for line in p])
        zp = np.linspace(np.min(z), np.max(z), npoints)
        if len(p[0]) == 3:
            rho_color = next_color()
            # Interpolate rho on common z
            rho = np.vstack([np.interp(zp, L[0], L[1]) for L in p])
            # Plot the quantiles
            plot_quantiles(zp, rho, contours, rho_color)
            # Plot the best
            pylab.plot(zp, rho[0], '-', color=dhsv(rho_color, dv=-0.2))
        else:
            any_magnetic = True
            rho_color = next_color()
            rhoM_color = next_color()
            # Interpolate rho, rhoM on common z
            rho = np.vstack([np.interp(zp, L[0], L[1]) for L in p])
            rhoM = np.vstack([np.interp(zp, L[0], L[3]) for L in p])
            # Plot the quantiles
            plot_quantiles(zp, rho, contours, rho_color)
            plot_quantiles(zp, rhoM, contours, rhoM_color)
            # Plot the best
            pylab.plot(zp, rho[0], '-', color=dhsv(rho_color, dv=-0.2))
            pylab.plot(zp, rhoM[0], '-', color=dhsv(rhoM_color, dv=-0.2))
    _profiles_labels(any_magnetic)