sampler
Module for sampling using [PTMCMCSampler][] and enterprise_extensions.
Classes¶
Functions¶
cpu_model ¶
get_user_args ¶
Get CLI arguments
RETURNS | DESCRIPTION |
---|---|
inputs
|
Dictionary of loaded user-supplied modules.
TYPE:
|
input_options
|
Dictionary of user-supplied input options. |
RAISES | DESCRIPTION |
---|---|
SystemExit
|
If CLI input is missing required args. |
Source code in src/ptarcade/sampler.py
get_user_pta_data ¶
Import user-specified PTA data.
PARAMETER | DESCRIPTION |
---|---|
inputs |
User supplied modules |
RETURNS | DESCRIPTION |
---|---|
psrs
|
List of Pulsar objects
TYPE:
|
noise_params
|
Dictionary containing noise data
TYPE:
|
emp_dist
|
The empirical distribution to use for sampling
TYPE:
|
Source code in src/ptarcade/sampler.py
initialize_pta ¶
initialize_pta(
inputs: dict[str, Any],
psrs: list[Pulsar] | None,
noise_params: dict | None,
) -> dict[int, PTA]
Initialize the PTA with the user input
PARAMETER | DESCRIPTION |
---|---|
psrs |
list of pulsar objects
TYPE:
|
inputs |
User specified modules |
noise_params |
User specified noise params
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[int, PTA]
|
Dictionary of [enterprise.signals.signal_base.PTA][] objects configured with user inputs |
Source code in src/ptarcade/sampler.py
setup_sampler ¶
setup_sampler(
inputs: dict[str, ModuleType],
input_options: dict[str, Any],
pta: dict[int, PTA] | None,
emp_dist: array_like | None,
) -> tuple[PTSampler, NDArray]
Setup the PTMCMC sampler
PARAMETER | DESCRIPTION |
---|---|
inputs |
Dictionary of loaded user-supplied modules.
TYPE:
|
input_options |
Dictionary of user-supplied input options. |
pta |
Dictionary of [enterprise.signals.signal_base.PTA][] objects configured with user inputs |
emp_dist |
The empirical distribution to use for sampling
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
sampler
|
Configured [PTMCMCSampler.PTSampler][]
TYPE:
|
x0
|
Initial sample.
TYPE:
|
Source code in src/ptarcade/sampler.py
do_sample ¶
Run the configured sampler.
PARAMETER | DESCRIPTION |
---|---|
inputs |
The user specified modules. |
sampler |
The configured [PTMCMCSampler.PTSampler][].
TYPE:
|
x0 : NDArray The inital sample.
Source code in src/ptarcade/sampler.py
main ¶
Read user inputs, set up sampler and models, and run sampler.