Skip to main content

CI codecov Codacy Badge Documentation Status DOI PyPI PyPI - Downloads status

popsynth

alt text

popsynth core function is to create observed surveys from latent population models.

First, let's define what a population of objects is in terms of a generative model. The two main ingredients are the objects' spatial distribution () and the distribution of their inherent properties (). Here, are the latent population parameters, are the spatial locations of the objects, and are the properties of the individual objects (luminosity, spin, viewing angle, mass, etc.). The spatial distribution is defined such that:

is the intensity of objects for a given set of population parameters. With these definitions we can define the probability for an object to have position and properties as

popsynth allows you to specify these spatial and property distributions in an object-oriented way to create surveys. The final ingredient to creating a sample for a survey is knowing how many objects to sample from the population (before any selection effects are applied). Often, we see this number in simulation frameworks presented as "we draw N objects to guarantee we have enough." This is incorrect. A survey takes place over a given period of time () in which observed objects are counted. This is a description of a Poisson process. Thus, the number of objects in a simulation of this survey is a draw from a Poisson distribution:

Thus, popsynth first numerically integrates the spatial distribution to determine the Poisson rate parameter for the given $\vec{\psi}$, then makes a Poisson draw for the number of objects in the population survey. For each object, positions and properties are drawn with arbitrary dependencies between them. Finally, selection functions are applied to either latent or observed (with or without measurement error) properties.

Note: If instead we draw a preset number of objects, as is done in many astrophysical population simulation frameworks, it is equivalent to running a survey up until that specific number of objects is detected. This process is distributed as a negative binomial process, i.e, wait for a number of successes and requires a different statistical framework to compare models to data.

Installation

pip install popsynth

Note: This is not synth pop! If you were looking for some hard driving beats out of a yamaha keyboard with bells... look elsewhere

alt text

Contributing

Contributions to popsynth are always welcome. They can come in the form of:

Bug reports

Please use the Github issue tracking system for any bugs, for questions, and or feature requests.

Code and more distributions

While it is easy to create custom distributions in your local setup, if you would like to add them to popsynth directly, go ahead. Please include tests to ensure that your contributions are compatible with the code and can be maintained in the long term.

Documentation

Additions or examples, tutorials, or better explanations are always welcome. To ensure that the documentation builds with the current version of the software, I am using jupytext to write the documentation in Markdown. These are automatically converted to and executed as jupyter notebooks when changes are pushed to Github.

Metadata

Release files for popsynth 1.1.1

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

Source distribution (sdist)

Source distribution for popsynth 1.1.1
File Size Uploaded
popsynth-1.1.1.tar.gz 81.0 kB Details

Built distribution (wheel)

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

Total release size: 164.1 kB

Release files / popsynth-1.1.1.tar.gz

Download URL popsynth-1.1.1.tar.gz
Size 81.0 kB
Tags Source
SHA-256 checksum
How to use checksums
62111d24217f358e85df0059be2ecc7dd9abb1d71d4aa2a2e6527574dff0bf12
BLAKE2b-256 checksum
How to use checksums
856a18f25f21686f4d5c633ca789b0d0fa3b7c2001c375417b27f41039bdcbec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / popsynth-1.1.1-py3-none-any.whl

Download URL popsynth-1.1.1-py3-none-any.whl
Size 83.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
489f4982491226b8f976ed6b1586774f3f3ea98d2aee6e4bf78e185289939663
BLAKE2b-256 checksum
How to use checksums
917903b928a1875310e41dd28cf7b011910a1479628c51feabf2a2fd02f1d299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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