andrea-mitridate / ptarcade Goto Github PK
View Code? Open in Web Editor NEWA simple wrapper of ENTERPRISE and ceffyl that allows for new-physics searches in PTA data.
Home Page: https://andrea-mitridate.github.io/PTArcade/
License: MIT License
A simple wrapper of ENTERPRISE and ceffyl that allows for new-physics searches in PTA data.
Home Page: https://andrea-mitridate.github.io/PTArcade/
License: MIT License
I test the code with a very simple model file where
import numpy as np
from ptarcade.models_utils import prior
parameters = {
'test' : prior("Uniform", 0 , 1)
}
smbhb = False
name = "test"
def spectrum( f , test ):
Omegah2 = 0
return 0*f
and I run it with
ptarcade -m test_model.py
it runs quickly and I get the chain. The posterior is
which I believe does not reflect the uniform prior from 0 to 1. The issue is still here when I add Nsamp or burn a lot of samples in the beginning.
However when I change the prior from 1 to 2 the issue is gone:
So I suppose that something happened in the definition of the uniform prior?
Is your feature request related to a problem? Please describe.
Some models are bounded by BBN or CMB bounds on cosmological energy density. Having a switch to include these bounds in the prior function would be useful for constraining posteriors
Describe the solution you'd like
Describe alternatives you've considered
We could just take the posterior and remove samples that result in energy densities greater than the bound? How would these two methods change the posterior?
Additional context
I'd like to compute the integrated energy density of the different spectra I'll be using to compare each other
Our full documentation is great, but we should add some more information, images, etc. to the README.
Attribute error for params in 'plot_utils.plot_posteriors'. I am using the conda environment method to run PTArcade.
Following the quick start section in from the arXiv documentation I can run the mcmc step but when I run the commands for plotting
p_utils.plot_posteriors([chain] , [params])
I get the following error
File ~/miniconda3/envs/ptarcade/lib/python3.10/site-packages/ptarcade/plot_utils.py:827, in <listcomp>(.0)
824 N_chains = len(chains)
826 priors = params
--> 827 params = [np.array(list(par.keys())) for par in params]
829 if par_to_plot is None:
830 par_to_plot = [None] * N_chains
AttributeError: 'numpy.ndarray' object has no attribute 'keys'
The chains seem to import no problem
after running
chain, params = c_utils.import_chains('./chains/np_model/')
the output is
Starting import from ./chains/np_model/
Finished importing chains/np_model in 0.13s
Perhaps I am doing something basic wrong, but I'm unsure.
Any help you could give would be greatly appreciated. Thanks so much for making this very exciting tool.
Cheers,
Andrew
Hello, I am sorry if this is a bit naive or silly. But I was wondering if PTArcade can be somehow made compatible with Windows, or can be made possible to be installed on Google Colab?
Before doing pip install, one needs to install Tempo2. And from what I gathered, it can not be installed on Windows. Due to such linux/ mac dependencies, I am unable to install PTArcade on Google colab.
Is it possible to have a version which works on windows too? Or if there's already a way to do it, I will be grateful for the help.
Also, this is the first time I am posting/ commenting on GitHub, so I am open to any suggestions/ feedback.
Thank you!
For NG15 the user can choose between the data with and without spatial correlations in Ceffyl mode. There is not such a choice for IPTA2 and NG12.
Do not error out. Capture the user's config, print a statement to STDOUT that we are falling back to the available mode for the given dataset.
Describe the bug
a) Is there a way to impose constraints on parameters using specific settings? For instance, assuming I have parameters
a and b with a Uniform prior ranging from [0,1], I'd like to enforce a condition where x≥y. This is reminiscent of the example found in Bilby's documentation.
b) The documentation provides a method for importing a spectrum:
log_spectrum = spec_importer(path)
def spectrum(f, p):
return 10**log_spectrum(np.log10(f), p=p)
Given this, is it feasible to modify the log_spectrum function to accommodate additional parameters and subsequently retrieve the final spectrum as demonstrated below?
def spectrum(f, p, A):
return A * 10**log_spectrum(np.log10(f), p=p)
c) Is this package capable of parallel execution on both High-Performance Computing (HPC) systems and personal PCs? If so, how can one configure the number of threads or cores utilized by the package?
Useful resources:
For testing locally:
Hi, I am trying to study the joint analysis of PTA data with other cosmological data such as Planck using the MCMC sampler Cobaya. Can the PTArcade be integrated with cosmological samplers? Please let me know how to do it if it is possible.
plot_posteriors
crashes when save = False
if it does not find a directory named plots
in the local directory.
Possible solutions:
plots
directory is created if none is found in the local directory.Related to this we should allow the user to specify the output directory.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
Input spectrum models have a peak frequency. It'd be nice to have a separate method to compute it for given spectral parameters
Describe the solution you'd like
Add a separate method in the input models to compute f0
Describe alternatives you've considered
I can just copy the code out of model.py
and add my own f0
function for each input model. But it'd be nice to have it as a formal part of each input spectrum
Additional context
I want to see where the peak frequency compares to the PTA band
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.