COSMIC RAY API

Estimate atmospheric cosmic ray fluxes and radiation protection quantities

background


cosmic rays in earth's atmosphere

Our atmosphere protects us from a hostile space radiation environment comprised of high energy particles of solar and intergalactic origin:

  • solar radiation is significant during unpredictable and short lived solar flares and coronal mass ejections.
  • galactic cosmic radiation is omnipresent and modulated by the Earth's magnetic field, which varies with latitude, longitude, and time of year (due to effects of the solar wind).

Space radiation collides with the nuclei of gases in the atmosphere, leading to a cascade of nuclear and electromagnetic reactions. The result is a complex shower of high energy radiation, the intensity and composition of which varies with altitude.

predictive modelling of aviation radiation

Excessive exposure to radiation can damage DNA and lead to long-term health effects such as an increased risk of cancer.

Radiation levels at altitudes used by commercial aircraft are greater than at sea level and aircrew are classified as radiation workers in some countries; however, planning to limit their exposure, and monitoring, is generally lacking.

Both real-time measurements and predictive modelling of radiation in the atmosphere are important to mitigate the radiation risk posed to assets and crew.

Amentum Aerospace has developed a RESTful API to a validated predictive model of cosmic radiation in the atmosphere. The API calculates radiation doses and other quantities on a particular date, latitude, longitude, and altitude.

how to use the api


Register for a free key and API documentation

dose calculation

Understanding the Effective Dose to aircrew is important to ensuring their exposure does not exceed annual limits imposed by regulatory organisations.

The example to the right shows the API called using the curl command line interface. The particle type and the altitude and date of the calculation are specified. The API returns the value and units of the dose rate in JSON format.

Terminal
curl -X GET "https://developer.amentum.space/cosmic-rays/api/calculate_dose_rate?altitude=10&latitude=34.4&longitude=180&year=1998&month=5&day=28&particle=gamma" -H "accept: application/json" -H "Authorization: APIKEY"
{
  "dose rate": {
    "units": "uSv/hr",
    "value": 0.3267316594698155
  }
}
                  
Python Code
import json
import requests
# store end point URL
hostname = "https://developer.amentum.space/cosmic-rays/api/get_differential_intensity"
# requests lets you specify query string params as a dictionary, neat-o!
payload = {
    'year' : '2001',
    'month' : '8',
    'day' : '9',
    'latitude' : '57',
    'longitude' : '-101',
    'particle' : 'mu-',
    'angle' : '1.0',
    'atmospheric_depth' : '400'
}
# include the API key in the request header 
headers = {
  'Authorization' : 'APIKEY'
}
# hit the API 
try:
  response = requests.get(hostname, params=payload, headers=headers)
except requests.exceptions.RequestException as e:  
  print(e)
  sys.exit(1)
# read response as JSON
json_payload = response.json()
# pretty print the json 
print(json.dumps(json_payload, indent=4, sort_keys=True))
                  
Output
                    {
                      "energies": {
                          "data": [
                              10.592537251772889,
                              11.885022274370186,
                              13.335214321633243,
                              14.96235656094434,
                              16.78804018122561,
                              18.836490894898017,
                    ...
                  

differential intensity spectra

The radiation environment is often characterised by measuring the spectrum of energies of different particle types. Predictive models must be able to accurately reproduce these experimental measurements. The information is also important for atmospheric research.

The example to the left shows the API called from Python code (see the validation section for more examples like this). In this case, the API returns the energy differential intensity spectrum in JSON format as two arrays. The first array is the energy (in MeV); the second is the corresponding intensity (in /cm2/sr/MeV/s).