snippet_venus.VenusBoundaries2ΒΆ

__author__ = 'moa'

"""
Plotting Venus boundaries as described in Martinecz et al. (2008), "Location of the bow shock and ion composition
boundaries at Venus -- initial determinations from Venus Express ASPERA-4" PSS 56, 780-784.

A version using irfpy.

Output is

.. image:: VenusBoundaries2.png

.. code-author:: Moa Persson

.. code-author:: Yoshifumi Futaana
"""

import matplotlib.pyplot as plt
import matplotlib.patches as patch
import numpy as np

from irfpy.venus import bowshock, icb


def main():

    fig, ax = plt.subplots(1, 1, figsize=[10, 10])

    # Plot Venus as a circle
    circle = plt.Circle((0, 0), 1, color='g', fill=False, lw=5)

    # Plot the ICB (a circle at x<0 and a regression line at x>0)
    xi, ri = icb.xr_martinecz08()
    plt.plot(xi, ri, 'b', lw=5)

    # Plot the bow shock
    xb, rb = bowshock.xr_martinecz08()
    plt.plot(xb, rb, 'r', lw=5)

    # Add text of the boundaries
    plt.annotate('VENUS', xy=(0.4, 0.1), xycoords='axes fraction', xytext=(0, 0), textcoords='offset points',
                 va='top', fontsize=48)
    plt.annotate('BS', xy=(0.7, 0.4), xycoords='axes fraction', xytext=(0, 0), textcoords='offset points',
                 va='top', fontsize=48)
    plt.annotate('IMB', xy=(0.2, 0.35), xycoords='axes fraction', xytext=(0, 0), textcoords='offset points',
                 va='top', fontsize=48)

    ax.set_xlim(-2., 2.)
    ax.set_ylim(0, 4.)
    ax.set_ylabel('Rcyl VSO $[R_V]$', fontsize=32)
    ax.set_xlabel('X VSO $[R_V]$', fontsize=32)
    ax.tick_params(labelsize=32)
    fig.gca().add_artist(circle)
    ax.xaxis.set_ticks(np.arange(-2., 2.01, 1.))
    ax.yaxis.set_ticks(np.arange(0., 4.01, 1.))
    plt.savefig('VenusBoundaries2.png', bbox_inches='tight')

#    plt.show()


if __name__ == '__main__':
    main()