예제 #1
0
def dunlop(palint_object, ax,
           component='m', norm_factor=1,
           plt_idx=0,
           out='show', folder=None, name='output.pdf',
           plt_opt={},
           **options):
    components = {'x': 1, 'y': 2, 'z': 3, 'm': 4}
    idx = components[component]
    colors = helper.get_colors()
    marker = helper.get_marker()

    ax.plot(palint_object.th[:, 0], palint_object.th[:, idx] / norm_factor, '.-',
            marker=marker[plt_idx],
            color=colors[0], **plt_opt)
    ax.plot(palint_object.sum[:, 0], palint_object.sum[:, idx] / norm_factor, '.-',
            marker=marker[plt_idx],
            color=colors[1], **plt_opt)
    ax.plot(palint_object.ptrm[:, 0], palint_object.ptrm[:, idx] / norm_factor, '.-',
            marker=marker[plt_idx],
            color=colors[2], **plt_opt)

    # todo write dunlop_add_tr()
    # ax.plot(palint_object.tr[:, 0], palint_object.tr[:, idx] / norm_factor,
    #         color='k', marker=marker[plt_idx], alpha=0.8, ls='')

    dunlop_std(palint_object=palint_object, ax=ax, component=component, norm_factor=norm_factor, plt_idx=plt_idx,
               plt_opt=plt_opt)
    return ax
예제 #2
0
def arai(palint_object, ax,
         component='m', norm=None, norm_factor=[1, 1],
         plt_idx=0,
         t_min=20, t_max=700,
         out='show', folder=None, name='output.pdf',
         line=True, check=True,
         plt_opt={}, **options):
    label = options.get('label', '')
    idx = palint_object.components[component]
    markers = helper.get_marker()
    colors = ['r', 'b', 'g']  # helper.get_colors()
    xy = np.array(
        [[i[idx], j[idx]] for i in palint_object.ptrm for j in palint_object.th if i[0] == j[0]]) / norm_factor

    th = xy[:, 1]
    ptrm = xy[:, 0]

    if not 'ls' in plt_opt or 'linestyle' in plt_opt:
        plt_opt.update({'ls': ''})

    ax.plot(np.fabs(ptrm), np.fabs(th),
            marker='o', color=colors[plt_idx], label=label, **plt_opt)

    area = options.get('area')
    temps = options.get('temps')

    if area:
        slopes, sigmas, y_intercept, x_intercept = palint_object.calculate_slope(b_min=t_min, t_max=t_max)
        y_fit = (y_intercept[idx - 1] + slopes[idx - 1] * ptrm * norm_factor[0]) / norm_factor[1]
        ax.fill_between(np.fabs(ptrm), np.fabs(th), y_fit, alpha=0.2, color=colors[plt_idx])

    if line:
        add_arai_line(palint_object=palint_object, ax=ax,
                      t_min=t_min, t_max=t_max,
                      plt_idx=plt_idx,
                      norm_factor=norm_factor,
                      component=component,
                      plt_opt=plt_opt)

    if check:
        add_ck_check(palint_object=palint_object, ax=ax,
                     plt_idx=plt_idx,
                     norm_factor=norm_factor,
                     component=component,
                     plt_opt=plt_opt)
        add_ac_check(palint_object=palint_object, ax=ax,
                     plt_idx=plt_idx,
                     norm_factor=norm_factor,
                     component=component,
                     plt_opt=plt_opt)
    if temps:
        add_arai_temps(palint_object=palint_object, ax=ax,
                       plt_idx=plt_idx,
                       norm_factor=norm_factor,
                       component=component,
                       plt_opt=plt_opt)
    return ax
예제 #3
0
def arai_stdev(palint_object, ax,
               component='m', norm=None, norm_factor=[1, 1],
               plt_idx=0,
               t_min=20, t_max=700,
               line=True, check=True,
               plt_opt={}, **options):
    idx = palint_object.components[component] - 1
    markers = helper.get_marker()
    # colors = helper.get_colors()
    colors = ['r', 'b', 'g']  # helper.get_colors()

    y, x = palint_object._get_th_ptrm_data(t_min=t_min, t_max=t_max, m=True)
    x /= norm_factor[0]
    y /= norm_factor[1]
    y_stdev, x_stdev = palint_object._get_th_ptrm_stdev_data(t_min=t_min, t_max=t_max)

    ax.fill_between(x[:, idx], y[:, idx] + y_stdev[:, idx], y[:, idx] - y_stdev[:, idx], color=colors[plt_idx],
                    alpha=0.2)
    return ax