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.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

sampex-0.1.1-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sampex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 20bf2e279932aa37a7e5cbe980385158b4856767c67ae988ad2c382377b2cedc
MD5 397e8a5665d4c3cdb7dfaba4153c7928
BLAKE2b-256 ef0259af9e03c798bd4c325d1c53b4bb5a9321445713e9682aba25e24ad74f3c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sampex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6babc0ee355ad776d0fb64dd08394e3e9a80911a8d13c169e93665c51475400c
MD5 d72ada38dd4ae02f637fb21fbc1b5537
BLAKE2b-256 1a93be60dc39495d4d25907303de5750a5cf572206254cfa94e02a162e0cf8b2

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