Example #1
0
        ir_vals = np.arange(nr)
    else:
        for i in range(len(desired_rvals)):
            rval = desired_rvals[i]
            ir_vals.append(np.argmin(np.abs(rvals - rval)))

# What is given is now what is desired
desired_rvals = rvals[ir_vals]

# Get power associated with desired quantity (should really have a contigency
# where the routine exits if the desired quantity isn't present
if not (varname == 'vtot' or varname == 'btot' or varname == 'omtot'):
    desired_qv = var_indices[varname]
    iq = np.argmin(np.abs(qv - desired_qv))
    varlabel = texlabels.get(varname, 'qval = ' + varname)
    units = texunits.get(varname, 'cgs')
else:
    if varname == 'vtot':
        desired_qv_vals = [1, 2, 3]
        varlabel = r'$|\mathbf{v}|$'
        units = r'$\rm{m}\ \rm{s}^{-1}$'
    elif varname == 'btot':
        desired_qv_vals = [801, 802, 803]
        varlabel = r'$|\mathbf{B}|$'
        units = r'$\rm{G}$'
    elif varname == 'omtot':
        desired_qv_vals = [301, 302, 303]
        varlabel = r'$|\mathbf{\omega}|$'
        units = r'$\rm{s}^{-1}$'
    iq_vals = []
    for desired_qv in desired_qv_vals:
Example #2
0
        field = vals[:, :, ir]
        plot_moll(field, cost, fig=fig, ax=ax_moll, varname=varname,\
                minmax=(min_slice, max_slice), clon=clon, symlog=symlog,\
                linscale=linscale_slice, linthresh=linthresh_slice)
        time_string = '%.1f' % time
        time_string = time_string.zfill(tlabel_string_width)
        title = varlabel + '     ' +\
                (r'$r/R_\odot\ =\ %0.3f$' %rval) +\
                '     ' + (r'$t = %s\ P_{\rm{rot}}$' %time_string)
        fig.text(margin_x + 0.5*moll_width, 1. - 0.5*margin_top,\
                title, ha='center', va='center', **csfont, fontsize=14)

        # Make the AZ_Avgs plot:
        field = az.vals[:, :, az.lut[var_index], 0]
        plot_azav (field, rr, cost, fig=fig, ax=ax_azav,\
               units=texunits.get(varname, 'cgs'), minmax=(min_az, max_az),\
               plotcontours=False, plotlatlines=True, cbar_fs=10,\
               rvals=[rval], symlog=symlog, linthresh=linthresh_az,\
               linscale=linscale_az)

        # Make the time-latitude plot underneath everything

        # Arrays for plotting time-latitude diagram (use two, with the one
        # after the current time greyed out)
        #times2, lats2 = np.meshgrid(times, tt_lat, indexing='ij')
        it_current = np.argmin(np.abs(times - time))
        times_1 = times[:it_current + 2]
        # Have some overlap to prevent getting
        # empty arrays at the first and last times
        times_2 = times[it_current:]
        times_2d_1, lats_2d_1 = np.meshgrid(times_1, tt_lat, indexing='ij')