reheatfunq
Regional aggregate heat flow distributions and heat flow anomaly quantification
Science Score: 57.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 8 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Keywords
Repository
Regional aggregate heat flow distributions and heat flow anomaly quantification
Basic Info
- Host: GitHub
- Owner: mjziebarth
- License: gpl-3.0
- Language: Jupyter Notebook
- Default Branch: main
- Homepage: https://mjziebarth.github.io/REHEATFUNQ/
- Size: 4.16 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
- Releases: 15
Topics
Metadata Files
README.md
REHEATFUNQ
REHEATFUNQ is a Python package to estimate regional aggregate heat flow distributions and to identify (fault-generated) surface heat flow anomalies through the scatter that is inherent to the regional heat flow.
Installation
Installing REHEATFUNQ requires a number of common scientific computing packages.
REHEATFUNQ uses a pyproject.toml-based build that should install all
required dependencies automatically.
If you need to install the dependencies manually, see
Dependencies below for a list of dependencies that need to
be installed to build REHEATFUNQ. One uncommon package that the REHEATFUNQ
installation requires is the
loaducerf3 Python package.
This package can be installed with the following command after all other
dependencies have been installed:
bash
pip install 'loaducerf3 @ git+https://git.gfz-potsdam.de/ziebarth/loaducerf3'
Then, a Pip installation can be performed within the root directory of the
REHEATFUNQ source code to install REHEATFUNQ:
bash
pip install --user .
You can also use one of two Docker files that come with this repository. Use
bash
podman build --format docker -t reheatfunq .
or
bash
sudo docker build -t 'reheatfunq' .
to build the container image Dockerfile based on python:slim-bookworm which
includes updated dependencies and has a short compilation time.
Alternatively, you can build the reproducible Dockerfile-stable with fixed
dependencies at the state of the REHEATFUNQ description paper. See the
REHEATFUNQ documentation for more
information about how to build the Dockerfile-stable image. Typically, building
this image should be as simple as
bash
bash build-Dockerfile-stable.sh
if podman is installed.
Usage
REHEATFUNQ can be used by importing the various module components from the
reheatfunq package after installation.
To run the above-mentioned container images, run
bash
podman run -p XXXX:8888 reheatfunq
or
bash
sudo docker run -p XXXX:8888 reheatfunq
where XXXX is a port of choice under which the Jupyter server will be
accessible (i.e. http://127.0.0.1:XXXX with token listed in the terminal
output of the above command).
Visit the REHEATFUNQ documentation
for further usage instructions and documentation of the Python package. A
number of Jupyter notebooks are bundled in the jupyter directory
of the REHEATFUNQ source distribution.
In case that visiting the website is not an option, the documentation can be
built locally by running
bash
make html
from within the docs subdirectory. This requires Sphinx with Autodoc and
Napoleon to be installed.
Citation
If you use REHEATFUNQ, please cite the following paper:
Ziebarth, M. J. and von Specht, S.: REHEATFUNQ 1.4.0: A model for regional aggregate heat flow distributions and anomaly quantification, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2023-222, 2023.
This paper explains the REHEATFUNQ model and discusses a couple of performance and resilience analyses of the model.
The archived REHEATFUNQ software package can be cited as follows:
Ziebarth, Malte Jörn (2023): REHEATFUNQ: A Python package for the inference of regional aggregate heat flow distributions and heat flow anomalies. GFZ Data Services. https://doi.org/10.5880/GFZ.2.6.2023.002
You can also consider adding to the citation the REHEATFUNQ version tag you used.
License
REHEATFUNQ is licensed under the GPL-3.0-or-later license. See the LICENSE
and COPYING files for more information.
Dependencies
REHEATFUNQ makes use of a number of software packages. It has the following dependencies:
| Language | Packages | | :------: | :------: | | C++ | boost, Eigen, GeographicLib, OpenMP, CGAL & GMP (both through loaducerf3), | | Python | numpy, scipy, Cython, pyproj, loaducerf3, geopandas |
The Jupyter notebooks included with REHEATFUNQ require further Python packages to run:
| Language | Packages | | :------: | :------: | | Python | pdtoolbox, cmcrameri, cmocean, matplotlib, shapely, flottekarte, cmasher, scikit-learn, joblib, requests |
The package pdtoolbox can be installed with the following command:
bash
pip install 'pdtoolbox @ git+https://git.gfz-potsdam.de/ziebarth/pdtoolbox'
The package flottekarte can currently be installed with the following
commands (executed in a directory where a FlotteKarte subfolder can be
created):
bash
git clone https://github.com/mjziebarth/FlotteKarte.git
cd FlotteKarte
bash compile.sh
pip install --user .
Furthermore, parts of the pdtoolbox
and
ziebarthetal2022heatflow
packages, both licensed under the GPL-3.0-or-later, are included in the
external folder.
Changelog
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[2.0.2] - 2024-09-23
Changed
- Adjust
quantileinverter.cppto refactored code in Boost 1.84. - Update Boost version in
Dockerfile.
[2.0.1] - 2023-01-06
Added
- Added the
build-Dockerfile-stable.shscript that automates theDockerfile-stablebuild process from a fresh repository. - Added an import test to the build process of the
Dockerfile-stablecontainer.
Changed
- Fixed the container build script for the
Dockerfile-stablecontainer.
[2.0.0] - 2023-01-02
Added
- Added a function value cache for the minimum surprise estimate of the gamma
conjugate prior. The cache can be generated using the
GammaConjugatePrior.minimum_surprise_estimate_cachemethod and is tied to a specific set of heat flow samples and $a_\mathrm{min}$. The function cache uses binary search to speed up repetitive calls within the SHGO optimization algorithm and can be pickled. - Added batch evaluation of the maximum Kullback-Leibler distance from a
reference
GammaConjugatePriorto a set of other prior parameterizations. - Enable returning the
scipy.optimize.OptimizeResultof the SHGO optimization in the gamma conjugate prior minimum surprise estimate. - Added discovery (on failure) of system NumPy packages in isolated Python
build environments in
numpy-include.py. Compile and link against that system NumPy version. - Added option to pass random number generator or seed to
HeatFlowAnomalyPosteriorfor repeatability. - Added option to pass multiple
Anomalyinstances with weights to theHeatFlowAnomalyPosteriorclass. This allows the Bayesian treatment of uncertainties in the heat flow anomaly model or parameters. The discrete anomaly dimension is included in the treatment of the minimum distance criterion by Monte-Carlo sampling. The parametern_bootstrapallows to control the maximum number of Monte-Carlo samples that are generated. - Added an internally used piecewise barycentric Lagrange interpolator (BLI) class
- Added use of
shgofastPython module for increased performance in SHGO. - Add notebook
A13-Gamma-Landscape.ipynbthat implements the point-of-interest (POI) sampling toy model. - Allow switching of PDF backend (explicit / BLI / Simpson).
- Added CITATION.cff.
- Added optional naive MPMath implementation of the posterior for crosschecking purposes.
- Check whether heat flow anomaly posterior is normalizeable.
- Added facility to query internal state of
HeatFlowAnomalyPosterior. - Add a function to compute the $P_{H,\mathrm{max}}$ possible throughout all permutations.
- Added function
determine_restricted_samplesto determine fully (if possible) or approximate stochastically the set of permutations according to the $d_\mathrm{min}$ criterion. - Sped up evaluations of the
HeatFlowAnomalyPosteriorPDF & CDF(s) by means of interpolation (BLI), parallization, and removal of redundant computations (see 463319c for a complete list)
Changed
- Change likelihood in
HeatFlowPredictiveandHeatFlowAnomalyPosteriorclasses to include the latent parameter $j$ that iterates the $d_\mathrm{min}$ permutations. - Incompatible API changes for some (keyword-)arguments of
HeatFlowAnomalyPosteriorandHeatFlowPredictive. These changes reflect the model definition changes and the numerical improvements that make some arguments obsolete. - Internal numerics: rewrite
HeatFlowAnomalyPosteriorcode with templated precision. Simplify parts of this code and fix a number of numeric bugs. Allow precision to be selected from Python. - Change
HeatFlowAnomalyPosteriorCDF/cCDF computation to use a divide-and-conquer adaptive Simpson's rule (Lagrange interpolator). - Internal numerics: series approximation of the difference of $\ln \Gamma$
functions appearing in various parts of the
HeatFlowAnomalyPosteriorcode to eliminate cancellation errors and costlylgammaevaluations. - Documentation details and fixes
- Github workflow fix
- Minor updates to the notebooks requested in review
- Internal numerics: in
GammaConjugatePriornormalization use more robust determination of the maximum of the α-integration. - Internal: use
long doubleinGammaConjugatePriornormalization. - Change to
pyproject.tomlbuild system. - Fixed the build of
Dockerfileand updated to Debian Bookworm. - Fixed a problem with the access of NumPy headers in Cython files on some systems in isolated build mode.
- Fix wrong buffer size in
marginal_posterior_tail_quantiles_batch. - Changed the following notebooks in
jupyter/REHEATFUNQfor the resubmission of the REHEATFUNQ paper (https://doi.org/10.5194/egusphere-2023-222):03-Gamma-Conjugate-Prior-Parameters.ipynb,06-Heat-Flow-Analysis.ipynb,A2-Goodness-of-Fit_R_and-Mixture-Distributions.ipynb,A4-Resilience-to-Other-Distributions.ipynb,A6-Comparison-With-Other-Distributions.ipynb. This includes the convergence analysis of some Monte-Carlo code. - Updated the
Dockerfile-stableimage and fix various build issues. - Fix multiple errors in the $z\rightarrow 1$ (large $P_H$) series approximation.
- Fix multiple numerical errors and bugs in many places of the
HeatFlowAnomalyPosteriorcode, and add various numerical sanity checks (see 463319c)
[1.4.0] - 2023-02-01
Added
- Added a method
'bli'tomarginal_posterior_tail_quantiles_batchthat uses barycentric Lagrange interpolation of the tail distribution, evaluated at Chebyshev points, to represent the tail distribution when performing a TOMS 748 inversion of the tail quantile. The implementation follows Berruth & Trefethen (2004) Barycentric Lagrange Interpolation. This new method is the new default inHeatFlowAnomalyPosterior.tail_quantiles. - Added background grid resolution parameters in
GammaConjugatePrior.visualize
Changed
- Rewrote
QuantileInverterclass as a templated class that can work with numeric types of different precision. - Improve unit labelling in
GammaConjugatePrior.visualize. - Improve jupyter notebook in
jupyter/REHEATFUNQ:03-Gamma-Conjugate-Prior-Parameters.ipynb,A10-Gamma-Sketch.ipynb. - Fix docstring of
HeatFlowAnomalyPosterior.tail_quantiles.
[1.3.3] - 2022-12-18
Added
- Fixed an execution directory in
Docker-stable.
[1.3.2] - 2022-12-18
Added
- Clarify license in
setup.py
Changed
- Fixed an execution order error in
Docker-stable. - Small fix in
A10-Gamma-Sketch.ipynb.
[1.3.1] - 2022-12-18
Added
- Add missing function
boost::assertion_failed_msgthat caused an undefined symbol error on some systems.
[1.3.0] - 2022-12-18
Added
- Add
AnomalyNearestNeighborclass that can perform the heat flow analysis for arbitrary heat flow anomalies sampled at the heat flow data locations. - Add
length()method toAnomalyLS1980class. - Add backup Gauss-Kronrod quadrature in heat flow anomaly quantification backend when computing the transition to the large z expansion backend.
- Add new Jupyter notebooks
A7-Bias-10-Percent-Tail-Quantile-Alpha-Beta.ipynb,A8-Data-Size-vs-Variance.ipynb,A9-Simple-Heat-Conduction.ipynb,A10-Gamma-Sketch.ipynb, andA11-Sketch-Generate-Permutations.ipynbfrom paper. - Add new Jupyter notebook
Custom-Anomaly.ipynbthat can be used to quickstart the analysis of a custom heat flow anomaly using theAnomalyNearestNeighborclass. - Add compile option to turn of machine-specific code and tuning.
- Add
Docker-stableimage that builds all numerical code from scratch, hopefully yielding .
Changed
- Change default unit representation in
GammaConjugatePrior.visualize. - Update notebooks
01-Load-and-filter-NGHF.ipynb,03-Gamma-Conjugate-Prior-Parameters.ipynb,04-Global-Map.ipynb,06-Heat-Flow-Analysis.ipynb, andA5-Uniform-Point-Density.ipynb - Fix missing installs in Docker image
- Compile Python package binaries in portable mode.
- Replace aborts in
tanh_sinhquadrature inziebarth2022a.cppby exceptions and add a fallback for one occurrence oftanh_sinhruntime errors.
[1.2.0] - 2022-12-13
Added
- Add
aminparameter to heat flow anomaly strength quantification. - Added different working precisions for the heat flow anomaly strength quantification.
- Make
gamma_mlemethod available inreheatfunq.regional. - Added
pytesttesting. - Added missing import in
jupyter/REHEATFUNQ/zeahl22hf/geojson.py.
Changed
- Fix typo leading to incomplete quadrature error estimate in
outer_integrand. - Use precision-dependent tolerance in heat flow anomaly posterior quadrature.
- Add Kahan summation for heat flow anomaly posterior locals.
- Speed up heat flow anomaly posterior CDF and tail distribution via
CDFEvalclass that computes norm and cumulative distribution simultaneously.
[1.1.1] - 2022-12-02
Changed
- Update REHEATFUNQ Jupyter notebooks, mainly unified figure aesthetics.
- Load NGHF uncertainty values as
floatinstead ofint. - Change unit formatting in
GammaConjugatePriorvisualization.
[1.1.0] - 2022-11-28
Added
- Added the
tail_quantilesmethod of theHeatFlowAnomalyPosteriorclass. This computes the quantiles for the batch-evaluated CDF.
[1.0.1] - 2022-11-28
Changed
- Fix a C++ standard incompatibility that is compatible with g++ but not with clang++.
- Relax some typing requirements and make typing information compatible with Python 3.8.
[1.0.0] - 2022-11-27
Added
- First release version
- Dockerfile
- Missing Files
Changed
- Various documentation fixes
- Bug involving
tanh_sinhon Debian system
[0.1.1-p1] - 2022-11-25
Added
- Install fix for Debian-based Github actions
[0.1.1] - 2022-11-25
Added
- Install fix for Debian-based Github actions
[0.1.0] - 2022-11-25
Added
- First version of REHEATFUNQ.
Owner
- Name: Malte Ziebarth
- Login: mjziebarth
- Kind: user
- Location: Berlin, Germany
- Repositories: 6
- Profile: https://github.com/mjziebarth
Physicist with interest in Geophysics, Seismic Hazard, and Complex Networks. Hobbyist coder.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "Please consider citing one or both of the following software and paper reference for REHEATFUNQ."
authors:
- family-names: "Ziebarth"
given-names: "Malte Jörn"
orcid: https://orcid.org/0000-0002-5190-4478
title: "REHEATFUNQ: A Python package for the inference of regional aggregate heat flow distributions and heat flow anomalies"
doi: 10.5880/GFZ.2.6.2023.002
repository: https://github.com/mjziebarth/REHEATFUNQ
references:
- type: article
authors:
- family-names: "Ziebarth"
given-names: "Malte Jörn"
orcid: https://orcid.org/0000-0002-5190-4478
- family-names: "Specht"
name-particle: "von"
given-names: "Sebastian"
orcid: https://orcid.org/0000-0003-3735-9562
title: "REHEATFUNQ 1.4.0: A model for regional aggregate heat flow distributions and anomaly quantification"
year: 2023
journal: "Geoscientific Model Development"
status: preprint
doi: 10.5194/egusphere-2023-222
GitHub Events
Total
Last Year
Dependencies
- actions/checkout v3 composite
- actions/deploy-pages main composite
- actions/upload-artifact v3 composite
- actions/upload-pages-artifact v1 composite
- actions/checkout v3 composite
- actions/checkout v1 composite
- actions/setup-python v1 composite
- python slim build