bowtie

Bow-tie analysis for the energy channels of a generic particle instrument

https://github.com/spearhead-he/bowtie

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary

Keywords

bow-tie bow-tie-analysis heliophysics response-function space-physics spacephysics
Last synced: 6 months ago · JSON representation ·

Repository

Bow-tie analysis for the energy channels of a generic particle instrument

Basic Info
  • Host: GitHub
  • Owner: spearhead-he
  • License: bsd-3-clause
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 3.68 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • Open Issues: 1
  • Releases: 2
Topics
bow-tie bow-tie-analysis heliophysics response-function space-physics spacephysics
Created about 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Code of conduct Citation Zenodo

README.md

DOI Python versions pytest codecov Project Status: Active – The project has reached a stable, usable state and is being actively developed. website

SPEARHEAD bow-tie analysis tool

About

This analysis tool runs a bow-tie analysis (Van Allen et al. 1974) for the energy channels of a generic particle instrument. The input is a CSV table of channel responses indexed by the incident energy. The analysis results are the geometric factor (with errors) and the effective energy of the channel. The analysis description may be found here (A description of the BepiColombo/SIXS-P cruise phase data product). The instrument response may be obtained by simulation, analytical model, or measurement and presented as a discrete function on an energy grid. The only requirement is that the grid must be monotonously ascending.

Tested in Ubuntu 20.04.6 LTS with Python version 3.12.8.

How to install

Access online (JupyterHub)

You can access the complete bow-tie analysis tool online on the JupyterHub server of the SPEARHEAD project. All you need is a (free) GitHub account for verification. Access the tool by opening this link!

Install locally

  1. This tool requires a recent Python (>=3.10) installation. Following SunPy's approach, we recommend installing Python via miniforge (click for instructions).
  2. Download this file and extract to a folder of your choice (or clone the repository https://github.com/spearhead-he/bowtie if you know how to use git).
  3. Open a terminal or the miniforge prompt and move to the directory where the code is.
  4. Create a new virtual environment (e.g., conda create --name bowtie python=3.12 or python -m venv venv_bowtie_tool if you don't use miniforge/conda) and activate it (e.g., conda activate bowtie, or source venv_bowtie_tool/bin/activate if you don't use miniforge/conda).
  5. Install the Python dependencies from the requirements.txt file with pip install -r requirements.txt within the virtual environment.
  6. Open the Jupyter Notebook by running jupyter-lab bowtie_example.ipynb

How to use

The Notebook is a simple example that also acts as a tutorial to teach the user how to run the bow-tie analysis with this tool.

The instrument response function(s) must be stored in a CSV file. The first column is the midpoint of the energy bin. The next columns are the response functions of the particle instrument.

The tool operates with two main classes, which are called Bowtie and Spectra. Bowtie stores response functions and contains the methods to run bow-tie analysis, while Spectra contains information on the spectral indices and the amount of different spectra that are used in the bow-tie calculation.

Bowtie


The Bowtie class contains the data that the bow-tie analysis is applied to and the energy range to be considered in the calculations. Its methods make running analysis easy and straightforward.

Methods:

set_energy_range(energy_min, energy_max):
    energy_min : {float} The minimum energy in MeV to consider
    energy_max : {float} See energy_min.
bowtie_analysis(channel, spectra, plot):
    channel : {str} The channel name as it appears in the csv table.
    spectra : {Spectra} The Spectra class object, introduced in this package. Contains the 
                        spectral indices and the power law spectra used in the bow-tie analysis.
    plot : {bool} A boolean switch to produce a plot visualizing the analysis.
bowtie_analysis_full_stack(spectra, plot):
    A wrapper for bowtie_analysis(). Runs the analysis on all channels that appear in the input file.
    spectra : {Spectra} See bowtie_analysis().
    plot : {bool} See bowtie_analysis()

Spectra


The Spectra class contains the range of spectra that are applied on the response function to run bow-tie analysis.

Methods:

set_spectral_indices(gamma_min, gamma_max):
    gamma_min : {float} The minimum spectral index to consider in the calculation.
    gamma_max : {float} See gamma_min.
produce_power_law_spectra(response_df):
    response_df : {pandas.DataFrame} The input csv table read in to a pandas DataFrame. Contains
                                     the channel responses as a function of incident energy.

Contributing

Contributions to this tool 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.

If you don't have a GitHub account, you can sign-up for free here, or you can also reach out to us with feedback by sending an email to jan.gieseler@utu.fi.

Acknowledgement

This tool is developed within the SPEARHEAD (SPEcification, Analysis & Re-calibration of High Energy pArticle Data) project. SPEARHEAD has received funding from the European Union’s Horizon Europe programme under grant agreement No 101135044.

The tool reflects only the authors’ view and the European Commission is not responsible for any use that may be made of the information it contains.

Owner

  • Name: SPEARHEAD
  • Login: spearhead-he
  • Kind: organization

SPEcification, Analysis & Re-calibration of High Energy pArticle Data

Citation (CITATION.cff)

# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
title: 'SPEARHEAD bow-tie analysis tool'
doi: 10.5281/zenodo.15744645
authors:
- given-names: Christian
  family-names: Palmroos
  affiliation: University of Turku
  orcid: https://orcid.org/0000-0002-7778-5454
- given-names: Philipp
  family-names: Oleynik
  affiliation: University of Turku
  orcid: https://orcid.org/0000-0003-0794-7742
- given-names: Jan
  family-names: Gieseler
  affiliation: University of Turku
  orcid: https://orcid.org/0000-0003-1848-7067
version: 0.2.0
date-released: 2025-06-26
repository-code: https://github.com/spearhead-he/bowtie
license: BSD-3-Clause

GitHub Events

Total
  • Create event: 3
  • Issues event: 3
  • Release event: 2
  • Watch event: 2
  • Issue comment event: 4
  • Public event: 1
  • Push event: 15
  • Pull request event: 5
  • Fork event: 3
Last Year
  • Create event: 3
  • Issues event: 3
  • Release event: 2
  • Watch event: 2
  • Issue comment event: 4
  • Public event: 1
  • Push event: 15
  • Pull request event: 5
  • Fork event: 3

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: 3 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 2
  • Total pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 3
  • Average time to close issues: 3 months
  • Average time to close pull requests: 9 days
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • phirippu (1)
  • jgieseler (1)
Pull Request Authors
  • Christian-Palmroos (1)
  • jgieseler (1)
  • phirippu (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels