Skip to main content


🦴 fossyl 🦴

fossyl is a package designed to efficiently run Markov-Chain Monte-Carlo simulations using the emcee package. It uses a Radial Basis Function Interpolator to perform efficient interpolation. The algorithm is streamlined for ease of use, requiring only four input variables to run simulations on any spectral model calculated on a grid. However, additional input variables are available for more customization and control. This software supports both regular and irregular grids, making it versatile and adaptable to various modeling scenarios. An example jupyter notebook for using fossyl is provided. Where fossyl outputs: a step figure for each parameter, the best fit spectra alongside your input spectra with a corner plot to the right, and a h5 file with the walker data.

🛠️ Installation 🛠️

pip Installation
  1. Download Python: Visit here to install Python
  2. Download pip: Visit here to install pip
  3. Run Install Command: Run the command in terminal:
    pip install fossyl
    

Manual Installation

  1. Download Python: Visit here to install Python
  2. Download pip: Visit here to install pip
  3. Downloading fossyl: Download the latest version of fossyl in the "Releases" tab of the Github page
  4. pip Packages: Go into the directory of fossyl and run the command:
    pip install -r requirements.txt
    

⚙️ Using fossyl ⚙️

How to Use h5grid

  1. After fossyl is installed, verify the installation by running the following command: from fossyl.h5grid import *. If you encounter any issues during installation, please reach out to Hunter Brooks for assistance.
  2. Ensure that model spectra are assigned as: column 1 (wavelength) and column 2 (flux)
  3. Assign the relavent variables as described below.
  4. To compile code, execute the command: h5grid(model_directory, model_parm, output_h5). These are the minimum required parameters for fossyl to run. You can include optional variables if needed.
Relavent Variables For h5grid
  • Required Variables:

    • model_directory: File path/name to your model spectra: string:

      • example: /Desktop/spectra/test.csv
    • model_parameters: Model parameter names: list: (must be in order that the paramters are in the file name)

      • example: ['Teff', 'log(g)', '[M/H]', 'C/O', 'log(Kzz)']
    • output_file: File path/name of output file: string:

      • example: /models/test
  • Optional Variables:

    • wavelength_region: The wavelength region saved for each spectrum: list
      • example: [0, 10], default=[0, np.inf]

How to Use mcfit

  1. Ensure that your model is compiled into a h5 file using h5grid
  2. Ensure that the observed spectra are assigned as: column 1 (wavelength), column 2 (flux), and column 3 (uncertainty)
  3. Once fossyl is successfully imported, define the relevant variables as shown below. Ensure that all required variables are formatted correctly.
  4. To run the Markov-Chain Monte-Carlo simulation, execute the command: mcmcfit(input_file, output_file, h5_directory, model_parm). These are the minimum required parameters for fossyl to run. You can include optional variables if needed.
Relavent Variables For mcfit
  • Required Variables:

    • input_file: File path/name to your input spectrum: string:

      • example: /Desktop/spectra/test.csv
    • output_file: File path/name of output file: string: (do not include file type)

      • example: /Output/test
    • h5_directory: Directory name to model spectra h5 file: string: (ensure no numbers are included in path name outside of numbers in model file name)

      • example: /Desktop/model/LOWZ.h5
    • model_parm: Model parameter names: list: (must be the exact name used in h5 file)

    • example code: ['Teff', 'log(g)', '[M/H]', 'C/O', 'log(Kzz)']

  • Optional Variables:

    • grid_scale: Number of grid points around best grid point in each dimension: int

      • example: 50, default=10
    • unit_wave: Astropy units of the observed and model wavelength units: list: (first index is observed, second index is model)

      • example: [u.um, u.um], default=[u.um, u.um]
    • unit_flux: Astropy units of the observed and model flux units: list: (first index is observed, second index is model)

      • example: [u.Jy, (u.erg / (u.cm**2 * u.s * u.um))], default=[(u.erg / (u.cm**2 * u.s * u.um)), (u.erg / (u.cm**2 * u.s * u.um))]
    • walkers: Number of walkers for emcee calculation: int

      • example: 25, default=15
    • steps: Number of max steps for emcee calculation: int: May be cutoff before this as a result of auto-correlation

      • example: 15000, default=1000
    • rv_fit: Whether a radial velocity is fit: boolean

      • example: True, default=False
    • monitor: Whether a monitoring step figure is displayed every 1000 steps: boolean

      • example: True, default=False
    • save_output: Whether the output tables and figures are saved: boolean

      • example: True, default=True

📞 Support & Development Team 📞

📖 Acknowledgments 📖

  1. If you intend to publish any calculations done by fossyl, please reference Brooks et al. (in prep.).

  2. Please reference the relavent model citation.

Metadata

Release files for fossyl 0.6.2

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

Source distribution (sdist)

Source distribution for fossyl 0.6.2
File Size Uploaded
fossyl-0.6.2.tar.gz 17.1 kB Details

Built distribution (wheel)

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

Total release size: 34.6 kB

Release files / fossyl-0.6.2.tar.gz

Download URL fossyl-0.6.2.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
851ec5f7b2edfc55ad162e0a9992b685f515ee708d7d28105d0c1fbb5b973804
BLAKE2b-256 checksum
How to use checksums
702a65210b1809b97e5ffe1deba33202d8956b7e8eb6b2ccc0afaee1f2a9f83c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release files / fossyl-0.6.2-py3-none-any.whl

Download URL fossyl-0.6.2-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fdd1c25e0d7d93aa773c268bbe6e3bfe0ad85ba79694f61f992a54a9e06c66d
BLAKE2b-256 checksum
How to use checksums
2bd244f6b5cd4fcaca30e109ffaea80bb080627cc5b96f26c1b44aa27db279bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.6.2 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