Skip to main content

pypi Version conda version python version pytest codecov docs Project Status: Active – The project has reached a stable, usable state and is being actively developed. license zenodo

The Solar MAgnetic Connection Haus (Solar-MACH) tool is a multi-spacecraft longitudinal configuration plotter. This is the repository of the pip/conda-forge package of Solar-MACH, called solarmach. For the corresponding streamlit repository, which is used for solar-mach.github.io, see github.com/jgieseler/Solar-MACH.

Installation

solarmach requires python >= 3.11.

It can be installed either from PyPI using:

pip install solarmach

or from conda-forge using:

conda install -c conda-forge solarmach

Basic usage

from solarmach import SolarMACH, print_body_list

# optional: get list of available bodies/spacecraft
print(print_body_list().index)

# necessary options
body_list = ['STEREO-A', 'Earth', 'BepiColombo', 'PSP', 'Solar Orbiter', 'Mars']
date = '2021-10-28 15:15:00'

# Previously you needed to define position-sensitive solar wind speed per
# body in body_list, e.g., vsw_list = [400, 400, 400, 400, 400, 400, 400]
# Now you can skip this parameter or provide an empty list. Then solarmach
# will try to automatically obtain measured solar wind speeds from each
# spacecraft
vsw_list = []

# optional parameters
coord_sys = 'Carrington'                         # 'Carrington' (default) or 'Stonyhurst'
reference_long = 273                             # longitude of reference (None to omit)
reference_lat = 0                                # latitude of reference (None to omit)
plot_spirals = True                              # plot Parker spirals for each body
plot_sun_body_line = True                        # plot straight line between Sun and body
long_offset = 270                                # longitudinal offset for polar plot; defines where Earth's longitude is (by default 270, i.e., at "6 o'clock")
reference_vsw = 400                              # define solar wind speed at reference
return_plot_object = False                       # figure and axis object of matplotib are returned, allowing further adjustments to the figure
transparent = False                              # make output figure background transparent
markers = 'numbers'                              # use 'numbers' or 'letters' for the body markers (use False for colored squares)
filename = 'solarmach.png'                       # define filename of output figure. can be .png or .pdf

# initialize
sm = SolarMACH(date, body_list, vsw_list, reference_long, reference_lat, coord_sys)

# make plot
sm.plot(
   plot_spirals=plot_spirals,
   plot_sun_body_line=plot_sun_body_line,
   reference_vsw=reference_vsw,
   transparent=transparent,
   markers=markers,
   long_offset=long_offset,
   return_plot_object=return_plot_object,
   outfile=filename
)

# obtain data as Pandas DataFrame
display(sm.coord_table)
Example output figure

Documentation

Full documentation for the package can be found at https://solarmach.readthedocs.io

Example Notebooks

solarmach can easily be run in a Jupyter Notebook.

Contributing

Contributions to this package are very much welcome and encouraged! Contributions can take the form of issues to report bugs and request new features or pull requests to submit new code.

Please make contributions specific to the streamlit web-version that is used for solar-mach.github.io in the corresponding repository at github.com/jgieseler/Solar-MACH.

Citation

Please cite the following paper if you use solarmach in your publication:

Gieseler, J., Dresing, N., Palmroos, C., von Forstner, J.L.F., Price, D.J., Vainio, R. et al. (2022). Solar-MACH: An open-source tool to analyze solar magnetic connection configurations. Front. Astronomy Space Sci. 9. doi:10.3389/fspas.2022.1058810

Acknowledgements

The Solar-MACH tool was originally developed at Kiel University, Germany and further discussed within the ESA Heliophysics Archives USer (HAUS) group.

This project has received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement No 101134999 (SOLER) and from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 101004159 (SERPENTINE).

Powered by: matplotlib sunpy speasy plotly

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solarmach-0.5.4.tar.gz (439.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solarmach-0.5.4-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file solarmach-0.5.4.tar.gz.

File metadata

  • Download URL: solarmach-0.5.4.tar.gz
  • Upload date:
  • Size: 439.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for solarmach-0.5.4.tar.gz
Algorithm Hash digest
SHA256 07b6e673e8d99f7572cf64acbc7a3944104a1fe9bc5ed9798158b3ca5a7b6626
MD5 fee998bab91283f9431557eb0bee0fef
BLAKE2b-256 0c09ad2ef9559315cc24e4da3fcf3d54844fd1a8fdf57e969df4e0ad31430d2d

See more details on using hashes here.

File details

Details for the file solarmach-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: solarmach-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for solarmach-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 23d61d14e16db05f236c0d12726cb8b904da958e7ff8b7127eece96672043598
MD5 cac9f641e4310ce677d8378b2af8aa4d
BLAKE2b-256 a942a96abd63df1733e931b47a1c2f737ed2fba3b7ac12963a099d6e6cd944b3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page