Plotting the intensity of cosmic ray flux against latitude (or altitude) using ‘crdb’ package in Python

I am using the ‘crdb’ package about cosmic rays and the idea is to plot the intensity of cosmic ray flux against latitude (or altitude) after collision with the Earth’s atmosphere.

Here is what i have so far:

import matplotlib.pyplot as plt
import numpy as np
import crdb

tab = crdb.query("Intensity", energy_type="EKN", quantity="phi", e_type="total", flux_rescaling=2)
plt.scatter(tab.distance, tab.value, c=tab.latitude, cmap='viridis', s=10, alpha=0.7)
plt.colorbar(label="Latitude")
plt.xlabel('Distance from Earth Center (km)')
plt.ylabel('Intensity (arbitrary units)')
plt.title('Cosmic Ray Intensity vs Latitude')

plt.show()

It does not work. Can someone please help?

Here is what i have so far:
import matplotlib.pyplot as plt
import numpy as np
import crdb

tab = crdb.query("Intensity", energy_type="EKN", quantity="phi", e_type="total",     flux_rescaling=2)
plt.scatter(tab.distance, tab.value, c=tab.latitude, cmap='viridis', s=10, alpha=0.7)
plt.colorbar(label="Latitude")
plt.xlabel('Distance from Earth Center (km)')
plt.ylabel('Intensity (arbitrary units)')
plt.title('Cosmic Ray Intensity vs Latitude')

plt.show()

  • what does it mean “it does not work”? Please, remove the duplication of code snippets, and provide a description of how the code fails in meeting your expectations

    – 

Leave a Comment