h0rton - Hierarchical Bayesian Inference of the Hubble Constant from Strong Gravitational Time Delay Lenses
Hierarchical Bayesian inference of the Hubble constant from samples of strong gravitational time delay lenses. This package represents LSST Dark Energy Science Collaboration research in progress. Please contact Ji Won Park (@jiwoncpark) for questions on using the code.
Installation
Virtual environments are strongly recommended, to prevent dependencies with conflicting versions. Create a conda virtual environment and activate it:
$conda create -n h0rton python=3.6 -y $conda activate h0rton
You’ll need a Fortran compiler and Fortran-compiled fastell4py, which you can get on a debian system by running
$sudo apt-get install gfortran $git clone https://github.com/sibirrer/fastell4py.git <desired location> $cd <desired location>/fastell4py $python setup.py install --user
Now do one of the following.
Option 2(a): clone the repo (please do this if you’d like to contribute to the development).
$git clone https://github.com/jiwoncpark/h0rton.git $cd h0rton $pip install -e . -r requirements.txt
Option 2(b): pip install the release version (only recommended if you’re a user).
$pip install h0rton
(Optional) To run the notebooks, add the Jupyter kernel.
$python -m ipykernel install --user --name h0rton --display-name "Python (h0rton)"
(Optional) To experiment with H0 inference using the TDLMC data, download all their data first using the provided convenience script:
$source h0rton/tdlmc_data/download_tdlmc_data.sh
How to train
Generate the training and validation data, e.g.
$python -m baobab.generate h0rton/trainval_data/train_tdlmc_diagonal_config.py
Edit the configuration parameters h0rton/example_user_config.py. Make sure the cfg.data field agrees with the training data you generated.
Run
$python -m h0rton.train h0rton/example_user_config.py
You can visualize the training results by running
$tensorboard --logdir runs
Feedback and More
Suggestions are always welcome! If you encounter issues or areas for improvement, please message @jiwoncpark or make an issue.
h0rton was used to enter the Time Delay Lens Modeling Challenge:
Challenge webpage: https://tdlmc.github.io/
Experimental design paper: https://arxiv.org/abs/1801.01506
This software was developed within the LSST DESC using LSST DESC resources, and so meets the criteria given in, and is bound by, the LSST DESC Publication Policy for being a “DESC product.” When referring to h0rton, please cite (Park et al 2020) and provide a link to this repo.
Metadata
Release files for h0rton 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| h0rton-1.0.tar.gz | 71.8 kB | Without provenance | Details for h0rton-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| h0rton-1.0-py3-none-any.whl | Python 3 | none | any | Details for h0rton-1.0-py3-none-any.whl |
Total release size: 169.6 kB
Release files / h0rton-1.0.tar.gz
| Download URL | h0rton-1.0.tar.gz |
|---|---|
| Size | 71.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddceb9e1f27b77d654110ddd9f09cda940d0e2adf958027fff1071e5c3b1b51c
|
|
BLAKE2b-256 checksum How to use checksums |
5d0961eda6aa668c4b4c4759984f15792f3c96186909830cd8407ea97054fb9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.10
|
Release files / h0rton-1.0-py3-none-any.whl
| Download URL | h0rton-1.0-py3-none-any.whl |
|---|---|
| Size | 97.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7d8f990b45d7607392db56fe1fb1f1ea790ad808150262697a436a7397afcb1
|
|
BLAKE2b-256 checksum How to use checksums |
b5b2c3074852a290fc0f2fd5c111bdc412caa27410e0397ddb9122c5ac2e156e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.10
|
Security for h0rton 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.