'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
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:
-
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.
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sampex-0.0.1.tar.gz
.
File metadata
- Download URL: sampex-0.0.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 848a090c8d08755bae9853cdef484fdd1f85f231c9f316c563d3ff63b41c67f9 |
|
MD5 | ccd7396afd2b831022cfc5e82935c73c |
|
BLAKE2b-256 | 143f4dcafff1a6b56fd705df59a2d2aff6c8bd152aab8ced8187d873f2d6b1df |
File details
Details for the file sampex-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: sampex-0.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a2fd585f22ad2985e602b5489c1c4dbb9af9e0551438fa7525ab06615acb479 |
|
MD5 | c7511069fe530f7a49484509171b5c8a |
|
BLAKE2b-256 | 1cae4363f5885b1eac982196b5d078972e051faff0b6b4be63e89f9a9d94414f |