plot_moon_anomaly_mapΒΆ

An example to plot lunar magnetic anomaly.

../_images/plot_moon_anomaly_map.png
''' An example to plot lunar magnetic anomaly.

.. image:: ../../../src/scripts/plot_moon_anomaly_map.png
'''

import os
import sys
import logging
logging.basicConfig()
import datetime
import math

import matplotlib.pyplot as plt
import numpy as np
import scipy as sp

from irfpy.moon.anomaly import AnomalyModelPME as LunarAnomaly

def main():

    anom = LunarAnomaly()

    lon, lat, btot = anom.lon, anom.lat, anom.b

    fig = plt.figure()
    ax = fig.add_subplot(111)
    img = ax.pcolor(lon, lat, btot)

    ax.set_xlim(0, 360)
    ax.set_ylim(-90, 90)
    ax.set_xlabel('East Longitude')
    ax.set_ylabel('Latitude')

    cb = fig.colorbar(img)
    cb.set_label('|B| [nT]')

    fig.savefig('plot_moon_anomaly_map.png')

if __name__ == '__main__':

    main()