Skip to main content
plots/overlaid_200_posteriors.png https://travis-ci.com/jiwoncpark/h0rton.svg?branch=master Documentation Status https://coveralls.io/repos/github/jiwoncpark/h0rton/badge.svg?branch=master https://img.shields.io/badge/license-MIT-blue.svg?style=flat Powered by Astropy Badge

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

  1. 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
  1. 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
  1. 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
  1. (Optional) To run the notebooks, add the Jupyter kernel.

$python -m ipykernel install --user --name h0rton --display-name "Python (h0rton)"
  1. (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

  1. Generate the training and validation data, e.g.

$python -m baobab.generate h0rton/trainval_data/train_tdlmc_diagonal_config.py
  1. Edit the configuration parameters h0rton/example_user_config.py. Make sure the cfg.data field agrees with the training data you generated.

  2. 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:

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)

Source distribution for h0rton 1.0
File Size Uploaded
h0rton-1.0.tar.gz 71.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for h0rton 1.0
File Interpreter ABI Platform
h0rton-1.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page