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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sampex-0.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 c6936c8306bac356e93e6de613c3a045657fe8c9d012f6164d3dd44e94eacd69
MD5 09ac8bf892b80b0e9385a65d38e590a0
BLAKE2b-256 3fc2adff439501337b95ff0d699274cdaee901ccdda132635cec11a8bd658a32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sampex-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffa56fcb27fe7dece19c4837123e4ccefdaf71a8f9e2b879a399b8f492e83dc4
MD5 77d2ef15b79edb2c665903834cdd6a40
BLAKE2b-256 c17477bfa18e268df56325a2f31698fd27a761e7b2d632ead910808b13438e47

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