pyomnidata
Python tool for downloading, converting and reading OMNI solar wind data.
If you make use of the OMNI data please acknowledge and cite as specified here: https://omniweb.gsfc.nasa.gov/html/citing.html
Installation
Simply install using pip3:
pip3 install pyomnidata --user
Alternatively install from this repository:
git clone https://github.com/mattkjames7/pyomnidata
cd pyomnidata
#EITHER build a wheel and install with pip (better)
python3 setup.py bdist_wheel
pip3 install dist/pyomnidata-1.0.0-py3-none-any.whl --user
#OR directly using setup py (should work, not tested though)
python3 setup.py install --user
For this to work properly - you will need to set up the $OMNIDATA_PATH environment variable to point to a folder where you want to store the data. Do this by adding something along the lines of the following to the bottom of your ~/.bashrc file:
export OMNIDATA_PATH=/path/to/omni/data
Usage
Downloading Data
Download OMNI data like this:
import pyomnidata
#download all available data
pyomnidata.UpdateLocalData()
Download F10.7 index (solar flux at 10.7 cm):
pyomnidata.UpdateSolarFlux(EndDate=2021024)
where EndDate is the last date which you want to request solar flux data for. This should be set to something at least a few days prior to the current date, if you request a date which currently has no available data then the download will fail.
Read Data
Get the OMNI parameters like so:
####OMNI parameters####
#Year can either be a single year:
Year = 2001
#or it can be a range:
Year = [2001,2004]
#5 minute resolution data
data = pyomnidata.GetOMNI(Year,Res=5)
#1 minute data
data = pyomnidata.GetOMNI(Year,Res=1)
####solar flux###
#all of the data
data = pyomnidata.GetSolarFlux()
#a single date
data = pyomnidata.GetSolarFlux(Date=20050101)
#a range of dates
data = pyomnidata.GetSolarFlux(Date=[20020101,20020103])
The returned data object is a numpy.recarray object which contains all of the OMNI data requested. To see what fields are stored use print(data.dtype.names). The units are as presented here: https://omniweb.gsfc.nasa.gov/html/omni_min_data.html#4b
Plot Data
Use the PlotOMNI function, e.g.:
import matplotlib.pyplot as plt
#create a figure
plt.figure(figsize=(11,6))
#plot some stuff in one panel
ax0 = pyomnidata.PlotOMNI(['SymH','SymD'],[20010101,20010120],fig=plt,maps=[2,1,0,0])
#and a second panel
ax1 = pyomnidata.PlotOMNI(['FlowSpeed'],[20010101,20010120],fig=plt,maps=[2,1,1,0])
#fit things a bit nicer
plt.tight_layout()
Which should produce something like the following:
Metadata
Release files for pyomnidata 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyomnidata-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / pyomnidata-1.0.2-py3-none-any.whl
| Download URL | pyomnidata-1.0.2-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6e88bd3af046aab35727318656c54980c5ab442a7d35e2ce12d9c087779aaad
|
|
BLAKE2b-256 checksum How to use checksums |
ef1a68368381f76f130291e0142903ad59059a70911ebc80fd69932174c0138c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for pyomnidata 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.