https://github.com/aneeshnaik/spam

spam is a Python 3 package, used to search for imprints of Hu-Sawicki f(R) gravity in the rotation curves of the SPARC sample.

https://github.com/aneeshnaik/spam

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

spam is a Python 3 package, used to search for imprints of Hu-Sawicki f(R) gravity in the rotation curves of the SPARC sample.

Basic Info
  • Host: GitHub
  • Owner: aneeshnaik
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 13.4 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Archived
Created over 7 years ago · Last pushed about 6 years ago
Metadata Files
Readme License

README.md

SPAM

spam is a python-3 package to search for imprints of Hu-Sawicki f(R) gravity on the rotation curves of the SPARC sample, using the MCMC sampler emcee.

This code was used to generate the results in Naik et al., (2019). Please direct any comments/questions to the author, Aneesh Naik, at an485@[Cambridge University].

Prerequisites

This code was written and implemented with python (version 3.6.8), and requires the following external packages (the version numbers in parentheses indicate the versions employed at time of writing, not particular dependencies):

  • emcee (2.2.1)
  • numpy (1.16.1)
  • scipy (1.2.0)

Usage

Running the MCMC sampling for any of the preset models listed in Table 1 of the paper is straightforward. The following examples demonstrates how to do this for one galaxy under 'Model B'.

```python import spam

name of chosen galaxy

name = 'NGC2403'

load SPARC data for galaxy

galaxy = spam.data.SPARCGalaxy('NGC2403')

set up model B MCMC; 30 walkers and 4 temperatures

f = spam.fit.GalaxyFit(galaxy, nwalkers=30, ntemps=4, model='B')

run 1000 iterations

f.iterate(niter=1000) ```

Note that the models including f(R) gravity can be rather time-expensive due to the computational cost of the scalar field solver (see discussion in paper). It is recommended to run these models on multiple CPU threads. See GalaxyFit documentation for instructions on how to do this.

One can inspect the MCMC chains via the GalaxyFit.chain attribute. The GalaxyFit.theta_dict attribute is a useful dictionary which translates names of parameters to indices.

Here is some code to generate a histogram showing the marginal posterior distribution for fR0 from the MCMC sampling we performed above.

```python import matplotlib.pyplot as plt

get the fR0 chain

first index is 0 to get the zeroth temperature chain

the third index slices from 500 to 'burn in' the first 500 iterations.

chain = f.chain[0, :, 500:, f.theta_dict['fR0']]

flatten the chain

flatchain = chain.flatten()

plot a histogram of the chain with 200 bins

plt.hist(flatchain, bins=200) plt.show() ```

All of the spam output data analysed in the paper can be found here. Note that the chains, and therefore file sizes, are rather large. However, summary data for each model can be found in the 'summaries' folder. These are stored as pickled spam.analysis.FitSummary objects.

The scripts used to generate all of the figures in the paper can be found in the submodule spam.plot. These scripts search for an environment variable SPAMFITDIR, which is the directory containing all of the fit data linked above. All figures except 5) and A1) can be generated with the summary files only.

Authors

This code was written by Aneesh Naik (website). The research was performed in collaboration with the co-authors of Naik et al. (2019):

License

Copyright (2019) Aneesh Naik and co-authors.

SPAM is free software made available under the MIT license. For details see LICENSE.

If you make use of SPAM in your work, please cite our paper (arXiv, ADS).

Acknowledgments

Please see the acknowledgments in the paper for a list of the many people and institutions to whom we are indebted!

Owner

  • Name: Aneesh Naik
  • Login: aneeshnaik
  • Kind: user

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels