https://github.com/astarvienna/howmanybloodyphotons
Tiny repo to calculate astronomical photon counts
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.8%) to scientific vocabulary
Repository
Tiny repo to calculate astronomical photon counts
Basic Info
- Host: GitHub
- Owner: AstarVienna
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Size: 765 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 8
- Releases: 0
Metadata Files
README.md

Tiny repo to calculate astronomical photon counts for various instruments
[!NOTE] The python package must be called using the abbreviation
hmbp.
The abbreviation ("how many bloody photons") is an expression of the authors frustration with the various convoluted legacy units still used in modern day Astronomy.
Install
bash
pip install HowManyPhotons
Basic usage
HowManyPhotons is mainly used to determine how many photons fall within the wavelength range of any instrument filter contained in the spanish VO filter database.
```python from astropy import units as u import hmbp
hmbp.forfluxinfilter("V", 10*u.ABmag) hmbp.convert(fromquantity=10*u.mJy, tounit=u.mag, filtername="J", instrument="HAWKI", observatory="Paranal") ```
Input and output units
hmbp accepts and converts between u.mag (Vega), u.ABmag and u.Jy.
ALL functions return photons counts in units of [ph s-1 m-2].
[!WARNING] ONLY the filter curve is included in the calclutation. The following instrumental transmission profiles are NOT included in the photon flux calculation:
- atmospheric transmission
- mirror reflection
- detector quantum efficiency
These spectral profiles may be included in later releases of HowManyBloodyPhotons, but they are currently NOT considered.
Main functions
The are two main functions: for_flux_in_filter and convert:
hmbp.forfluxin_filter
Returns the number of incoming photons through a specific filter. If no instrument and observatory are provided, hmbp looks for a corresponding filter_name in the dictionary hmbp.FILTER_DEFAULTS.
The result is an astropy.Quantity with the units [ph s-1 m-2].
Function signature:
python
hmbp.for_flux_in_filter(filter_name, flux, instrument=None, observatory=None)
Some short examples:
python
hmbp.for_flux_in_filter("V", 10*u.ABmag)
hmbp.for_flux_in_filter("Ks", 20*u.mag, instrument="HAWKI", observatory="Paranal")
hmbp.for_flux_in_filter("Si6", 1*u.Jy, instrument="Michelle", observatory="Gemini")
hmbp.convert
Converts one common flux unit into another common flux:
(mag, ABmag, Jy)
Function signature:
python
hmbp.convert(from_quantity, to_unit, filter_name, instrument=None, observatory=None)
Some short examples:
python
hmbp.convert(10*u.mag, u.Jy, "BrGamma")
hmbp.convert(from_quantity=0*u.mag, to_unit=u.ABmag, filter_name="J",
instrument="HAWKI", observatory="Paranal")
Convenience functions
We have also provided a few helper functions for several common flux conversions:
hmbp.in_zero_vega_magshmbp.in_zero_AB_magshmbp.in_one_janskyhmbp.in_skycalc_background
The function signatures follow the same pattern as hmbp.for_flux_in_filter, just without needing to explicitly specify the flux parameter.
Returned units are [ph s-1 m-2]
Some short examples:
python
hmbp.in_zero_vega_mags("V")
hmbp.in_zero_AB_mags("Ks", "HAWKI", "Paranal")
hmbp.in_one_jansky("NeII", instrument="VISIR", observatory="Paranal")
hmbp.in_skycalc_background("M", airmass=2.0, pwv=5.0)
Owner
- Name: A*Vienna
- Login: AstarVienna
- Kind: organization
- Location: Vienna. Austria
- Repositories: 10
- Profile: https://github.com/AstarVienna
GitHub Events
Total
- Create event: 13
- Release event: 1
- Issues event: 2
- Delete event: 8
- Issue comment event: 11
- Push event: 6
- Pull request review event: 2
- Pull request event: 15
Last Year
- Create event: 13
- Release event: 1
- Issues event: 2
- Delete event: 8
- Issue comment event: 11
- Push event: 6
- Pull request review event: 2
- Pull request event: 15
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 16
- Total Committers: 2
- Avg Commits per committer: 8.0
- Development Distribution Score (DDS): 0.063
Top Committers
| Name | Commits | |
|---|---|---|
| Kieran | k****i@g****m | 15 |
| A*Vienna | 8****a@u****m | 1 |
Packages
- Total packages: 1
-
Total downloads:
- pypi 46 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 4
- Total maintainers: 4
pypi.org: howmanyphotons
Simple photon count utility for astronomical fluxes
- Homepage: https://github.com/AstarVienna/HowManyBloodyPhotons
- Documentation: https://howmanyphotons.readthedocs.io/
- License: GPLv3
-
Latest release: 0.3.0
published about 1 year ago
Rankings
Maintainers (4)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- abatilo/actions-poetry v2 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- abatilo/actions-poetry v2 composite
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- shogo82148/actions-upload-release-asset v1 composite
- anisocado 0.3.0
- anyio 4.2.0
- astropy 5.3.3
- attrs 23.2.0
- beautifulsoup4 4.12.2
- cattrs 23.2.3
- certifi 2023.11.17
- charset-normalizer 3.3.2
- colorama 0.4.6
- contourpy 1.2.0
- coverage 7.4.0
- cycler 0.12.1
- docutils 0.20.1
- exceptiongroup 1.2.0
- fonttools 4.47.0
- h11 0.14.0
- httpcore 0.16.3
- httpx 0.23.3
- idna 3.6
- importlib-resources 6.1.1
- iniconfig 2.0.0
- kiwisolver 1.4.5
- lxml 5.1.0
- matplotlib 3.8.2
- more-itertools 10.2.0
- numpy 1.26.3
- packaging 23.2
- pillow 10.2.0
- platformdirs 4.1.0
- pluggy 1.3.0
- pooch 1.8.0
- pyerfa 2.0.1.1
- pyparsing 3.1.1
- pytest 7.4.3
- pytest-cov 4.1.0
- python-dateutil 2.8.2
- pyyaml 6.0.1
- requests 2.31.0
- requests-cache 1.1.1
- rfc3986 1.5.0
- scipy 1.11.4
- scopesim 0.7.1
- six 1.16.0
- skycalc-ipy 0.3.0
- sniffio 1.3.0
- soupsieve 2.5
- synphot 1.2.1
- tomli 2.0.1
- tqdm 4.66.1
- typing-extensions 4.9.0
- url-normalize 1.4.3
- urllib3 2.1.0
- zipp 3.17.0
- ScopeSim ^0.7.1
- astropy ^5.3.3
- numpy ^1.26.3
- python ^3.9
- pyyaml ^6.0.1
- skycalc_ipy ^0.3.0
- synphot ^1.2.1
- pytest ^7.4.3 test
- pytest-cov ^4.1.0 test