Skip to main content

'Programs to load and plot the SAMPEX satellite data.'

Project description

sampex

Classes to easily load SAMPEX data. So far it contains loader classes for the HILT, PET, and LICA data, as well as the Attitude data.

NOTE: Heads up that loading some of the data, especially the state 4 HILT counts, takes a decent amount of time due to the sheer number of datetime conversions.

The example plot below sums up what this library does. I generated it with this console command: plot_sampex 2007 1 20 --yscale log Example SAMPEX data from the HILT, PET, and LICA instruments

Install

Installing this package is as simple as

python3 -m pip install sampex

If you want to develop this package, run

git clone git@github.com:mshumko/sampex.git
cd sampex

Then one of these commands to install sampex into a virtual environment:

python3 -m pip install -e .

or

python3 -m pip install -r requirements.txt 

Get started

Before you can load the SAMPEX data you'll need to do two things:

  1. Download the SAMPEX data to a folder. wget is great for this. Write down the top-level SAMPEX data directory as you'll need it in step 2.

  2. Configure this package as it needs to know what directory to begin searching for the SAMPEX data.

    python3 -m sampex config
    

    and in the prompt paste the top-level SAMPEX data directory.

Example 1: Load and plot the HILT data

from datetime import datetime

import matplotlib.pyplot as plt

import sampex

day = datetime(2007, 1, 20)

h = sampex.HILT(day)
h.load()

fig, ax = plt.subplots()
ax.step(h['time'], h['counts'], label='HILT', where='post')
plt.suptitle(f'SAMPEX-HILT | {day.date()}')
plt.show()

Example 2: Load and plot the PET data

from datetime import datetime

import matplotlib.pyplot as plt

import sampex

day = datetime(2007, 1, 20)

p = sampex.PET(day)
p.load()

fig, ax = plt.subplots()
ax.step(p['time'], p['counts'], label='PET', where='post')
plt.suptitle(f'SAMPEX-PET | {day.date()}')
plt.show()

Example 3: Load and plot the LICA data

from datetime import datetime

import matplotlib.pyplot as plt

import sampex

day = datetime(2007, 1, 20)

l = sampex.LICA(day)
l.load()

fig, ax = plt.subplots()
ax.step(l['time'], l['stop'], label='PET', where='post')
plt.suptitle(f'SAMPEX-LICA (stop) | {day.date()}')
plt.show()

Example 4: Load and plot the Attitude data

from datetime import datetime

import matplotlib.pyplot as plt

import sampex

day = datetime(2007, 1, 20)

a = sampex.Attitude(day)
a.load()

fig, ax = plt.subplots()
ax.plot(a['time'], a['Altitude'], label='SAMPEX Altitude')
plt.suptitle(f'SAMPEX Altitude | {day.date()}')
plt.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sampex-0.1.2.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

sampex-0.1.2-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file sampex-0.1.2.tar.gz.

File metadata

  • Download URL: sampex-0.1.2.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sampex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f95542997945486e36ffb14824cb0d018797cd3ad36df7e558bc0b9e9e35c5cd
MD5 810688b96c3175aa5049c71183eae1f3
BLAKE2b-256 648cd4bfe5f43358dcc40661fee0dce79d77f5c76240090e4590f48fd1448d34

See more details on using hashes here.

File details

Details for the file sampex-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sampex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sampex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8eec5a82d6d2b0e7ca6400575276814521a4a065bec362855ead6e4a31e15bb0
MD5 da95e263e38196f2a7834ac40f894eb8
BLAKE2b-256 e2d356d610e42dde9c27d8e1d4aee1e8b85df68c59062924958abc67775fa955

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page