Skip to main content

FlopPITy

normalizing Flow exoplanet Parameter Inference Toolkyt

FlopPITy allows the user to easily perform atmospheric retrievals using SNPE-C (citation) and neural spline flows (citation).

Installation guide

Currently FlopPITy doesn't work with python 3.13

$ conda create -n floppity_env python==3.12.9
$ conda activate floppity_env
$ pip install floppity

Basic usage:

  • First, import FlopPITy:
from floppity import Retrieval
from floppity.simulators import read_ARCiS_input, ARCiS
  • Now you can initialize the retrieval class with a simulator. A python wrapper for ARCiS comes built-in (you need to install ARCiS on your own tho):
R = Retrieval(ARCiS)
  • Read in observations and define parameters to retrieve:
R.get_obs(['path/to/obs_0', 'path/to/obs_1',..., 'path/to/obs_n'])
    
R.add_parameter(par_0, min, max)
R.add_parameter(par_1, min, max)
...
R.add_parameter(par_m, min, max)
  • For ARCiS, the observations and parameters can be read from the ARCiS input file:
pars, obs_list = read_ARCiS_input('path/to/ARCiS/input')
R.get_obs(obs_list)
R.parameters=pars
  • For retrievals using ARCiS, the input file and output directory need to be passed in a dictionary:
ARCiS_kwargs= dict(
                    ARCiS_dir = "/path/to/ARCiS/executable", #only needs to be set if ARCiS is not on the default path
                    input_file = arcis_input,
                    output_dir = 'path/to/output',
                  )
  • You can now run the retrieval, indicating the number of rounds and samples per round:
R.run_retrieval(n_rounds=10, n_samples=1000, simulator_kwargs=ARCiS_kwargs)
  • Great! You can now inspect your posterior:
fig = R.plot_corner()

Writing a simulator

Writing a simulator to work for FlopPITy is relatively straightforward. All that's needed is a function that takes in observations and parameters and returns spectra. The spectra need to be returned in a dictionary where each key represents each of the observations simulated (e.g. simulated[0] contains PRISM spectra and simulated[1] contains MIRI/LRS spectra):

def simulator(obs, parameters, **kwargs):
    wvl_0 = obs[0][:,0]
    wvl_1 = obs[1][:,0]
    ...
    wvl_n = obs[n][:,0]

    spectra={}
    spectra[0] = # array of shape (ndims, len(wvl_0))
    spectra[1] = # array of shape (ndims, len(wvl_1))
    ...
    spectra[n] = # array of shape (ndims, len(wvl_n))

    return spectra

Advanced options:

  • Additional post processing parameters (currently RV, vrot, offset and scaling) can be added, for example:
R.add_parameter('RV', -100, 100, post_process=True) # km/s

Metadata

Release files for FlopPITy 0.0.10.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FlopPITy 0.0.10.3
File Size Uploaded Provenance Actions
floppity-0.0.10.3.tar.gz 2.5 MB Without provenance Details for floppity-0.0.10.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for FlopPITy 0.0.10.3
File Interpreter ABI Platform Actions
floppity-0.0.10.3-py3-none-any.whl Python 3 none any Details for floppity-0.0.10.3-py3-none-any.whl

Total release size: 2.5 MB

Release files / floppity-0.0.10.3.tar.gz

Download URL floppity-0.0.10.3.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
74d43f18dfaa52f613d16584f3c68a222846c3456ba8dc3e85eb29260e0cfddb
BLAKE2b-256 checksum
How to use checksums
72a4ef91398ba6b9e39e11a3fa06f7af0ed16f9a9cd7a97d5aeb81ffeb6c95eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Release files / floppity-0.0.10.3-py3-none-any.whl

Download URL floppity-0.0.10.3-py3-none-any.whl
Size 69.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a63d57c564af7169f7b86888d62d4e885cc987890b704f257630211313063126
BLAKE2b-256 checksum
How to use checksums
f3d09439e7a952ae9c93759cec1ce86f0a84ebbf3fa21fa8fbc44ad331f2437e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Security for FlopPITy 0.0.10.3

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.

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