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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sampex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 56c694699256946faf0627761984b82c8d20a284fef6aa469378b5eda66d2e82
MD5 88fa8fbd6e586c10c4065dccaac96d3d
BLAKE2b-256 5596e5aba3b30b703a9715e696f1c35183877655519852c6891473fb0b28b5be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sampex-0.0.2-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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6f35d2a69eae0740dea163d485eb3f0f73bbfdb4ee86d604fad872befd30835
MD5 e7a7583601bc0ecd2bfb37b917ac6a21
BLAKE2b-256 ffccfc01a2aeee06b9236af6fa8fe49993ba0d11b2cc611de1531ff0792a4d91

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