With functions for calculating photon flux, current density, and solar-to-hydrogen efficiency based on either the ASTM G173-03 reference spectrum (AM1.5G) or on the black-body radiation (Planck theory), for relevant wavelength ranges.
To use this package, install it from this repo:
install.packages("remotes")
remotes::install_github("solarchemist/photoec")
If you encounter bugs or have questions please open an issue.
Check out the source code from this repo:
git clone https://github.com/solarchemist/photoec.git
I suggest the following package rebuild procedure (in RStudio IDE):
- Run
devtools::check()
(in the console or via the Build pane). Should complete with one note aboutundefined global functions or variables: label
but no warnings nor errors:
── R CMD check results ───────────────────────────────── photoec 0.4.2.9000 ────
Duration: 17.3s
❯ checking R code for possible problems ... NOTE
cumflux: no visible binding for global variable ‘label’
currentdensity: no visible binding for global variable ‘label’
eV2nm: no visible binding for global variable ‘label’
energy2wavelength: no visible binding for global variable ‘label’
energy2wavenum: no visible binding for global variable ‘label’
flux: no visible binding for global variable ‘label’
nm2eV: no visible binding for global variable ‘label’
sunlight.ASTM: no visible binding for global variable ‘label’
sunlight.Planck: no visible binding for global variable ‘label’
wavelength2energy: no visible binding for global variable ‘label’
wavenum2energy: no visible binding for global variable ‘label’
Undefined global functions or variables:
label
0 errors ✔ | 0 warnings ✔ | 1 note ✖
- Run
devtools::build_vignettes()
in the console. This recompiles the vignettes and populates thedoc/
directory, and should produce one warning about the vignette title being different from the package title (safe to ignore). - Manually remove the line
doc
from.gitignore
(the build step keeps adding it).
Contributions are welcome, no matter whether code, bug reports or suggestions!
- The properties of the black body spectrum.
- An introduction to the G173-03 reference solar spectra.
- Am introduction to the air mass concept as applied towards solar energy.
- How to update the datasets in this package. This package includes two datasets:
solarconstants
a dataframe of some solar constants, andASTMG173
the ASTM G173-03 reference solar spectra.
To cite photoec
in publications use:
Taha Ahmed (2023). The photoec package: solar spectra and constants for photoelectrochemistry. DOI: 10.5281/zenodo.8034780.
Or see the CITATION.cff
(citation file format)
file in this repo or in the sidebar.
Please note that the DOI above always resolves to the latest release of this package.
If you want to explicitly cite a particular version, please use the corresponding DOI
(listed on the Zenodo page).
Consider scrapping our own unit converters in favour of units.