syntheticstellarpopconvolve


Namesyntheticstellarpopconvolve JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://gitlab.com/dhendriks/syntheticstellarpopconvolve
Summarysynthetic stellar pop convolve is a python package to convolve output of stellar population synthesis codes with star formation rates.
upload_time2024-05-14 22:33:58
maintainerNone
docs_urlNone
authorDavid Hendriks
requires_pythonNone
licensegpl
keywords astrophysics stellar evolution population synthesis starformation rate history convolution
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Synthetic Stellar Pop Convolve (SSPC)
![docstring coverage](./badges/docstring_coverage.svg) ![test coverage](./badges/test_coverage.svg)

This repository contains the code and documentation for the synthetic
stellar-population convolution code-base `Synthetic Stellar Pop
Convolve (SSPC)`. `SSPC` is available in a [Gitlab
repository](https://gitlab.com/dhendriks/syntheticstellarpopconvolve)
as well as on
[Pypi](https://pypi.org/project/syntheticstellarpopconvolve/).

The code was originally developed by David Hendriks (with invaluable
help from Lieke van Son) for the project of [Hendriks et al. 2023
(MNRAS)](https://doi.org/10.1093/mnras/stad2857), where it was used to
convolve gravitational-wave merger events from binary systems as well
as supernova events from both binary systems and single stars with a
cosmological star-formation rate.

SSPC can be used to convolve the output of stellar
population-synthesis codes with (cosmological) starformation
rates. It can convolve both event-based (line by line) data, as
well as ensemble-based (nested histogram) data. The user must provide
information about the column/layer that contains the necessary data to
perform the convolution, which is at minimum the delay-time and the
normalized yield. The latter quantity gets multiplied directly with
the appropriate SFR, and as such should already be weighted by
e.g. binary fractions, importance-sampling weights and others.

It is possible to provide additional weights *during* convolution, which can
include things like detection probability that depend on redshift.

list of some current features:

-   convolution of event-based (lines) data
-   convolution of ensemble-based (nested histograms) data
    -   pre- and post-convolution marginalisation of the ensembles
-   convolution of several datasets in sequence with a particular SFR
-   convolution of data with a sequence of SFRs
-   multiprocessed where relevant
-   astropy units
-   rescaling and transforming data
-   additional weighting during convolution (for e.g. detection probability)
-   etc.

In the coming period I will:

-   Continue to clean the code, update the docstrings of the functions, and
    provide type-hinting.
-   Continue to flesh out the tutorial notebooks and add examples and use-cases
    (including how to set up convolution with BinCodex-type data)
-   Add relevant star-formation rate and metallicity-distribution prescriptions
    (including for the MW), and make the part of the code that explains how to
    supply SFR information a bit more clear
-   make the advanced functionality more clear and provide a notebook on this.

Future features I aim to add in the foreseeable future:

-   better functionality for other data-sources/types: Currently event-based data
    requires it being stored in a dataframe but one should be able to provide
    custom-data functions to change this.
-   functionality for pre-convolution data filtering (i.e. performing queries on
    the data): while the input data can be filtered to only contain the relevant
    data, I can imagine that one may want to convolve the data with different
    filters using the same input-data (although that could be done
    post-convolution)
-   better support for spatially-resolved star-formation rates: while
    we currently can already convolve spatially resolved
    star-formation rates by just dividing the space into a grid and
    handling each cell in sequence using the functionality for
    handling multiple SFRs, it probably can be improved by allowing
    extra information to be passed along which can be used in
    e.g. selection functions.
-   ??? (please let me know about desired features)

The code is in late-beta stage, and is largely covered in unit-tests, but its
not entirely finished just yet and likely still contains some bugs that I have
not been able to pick up. Thats where this community can come in! I think this
code could become useful for many pop-synth groups, especially when people
submit git issues for bugs and feature requests!

As I said the code is not fully stable yet but I do invite people to start
having a look at the code-base and try out installing.

If anyone has questions, hit me up on the LISA-UCB slack channel or send me an
email on [mail@davidhendriks.com](mailto:mail@davidhendriks.com).


## Installation


### Requirements
The Python packages that are required for this code to run are listed in the `requirements.txt`, which automatically gets read out by `setup.py`.

### Installation via PIP:
To install this package via pip:

```
pip install syntheticstellarpopconvolve
```

### Installation from source:
To install the `binary_c-python` from source, which is useful for development versions and customisation, run

```
./install.sh
```

This will install the package, along with all the dependencies, into the current active (virtual) python environment.


## documentation
Documentation is available in the repository and on [readthedocs](https://synthetic-stellar-pop-convolve.readthedocs.io/en/latest/) where we provide [tutorial and example use-case notebooks](https://synthetic-stellar-pop-convolve.readthedocs.io/en/latest/example_notebooks.html)

## Development:
If you want to contribute to the code, then it is recommended that you install the packages in `development_requirements.txt`:

```
pip install -r development_requirements.txt
```

Please do not hesitate to contact us to discuss any contribution. Please see `HOW_TO_CONTRIBUTE`.

Some useful commands to generate documentation and coverage reports are stored in the `commands/` directory.

We use the following naming convention for development and release branches:

```
development/<binary_c-python version>/<binary_c version>
releases/<binary_c-python version>/<binary_c version>
```

### Generating documentation
To build the documentation manually, run

```
./generate_docs.sh
```

from within the `commands/` directory. Note: this requires `pandoc` to be installed on your machine.

### Generating docstring and test coverage report
To generate the unit test and docstring coverage report, run

```
./generate_reports.sh
```

from within the `commands/` directory.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/dhendriks/syntheticstellarpopconvolve",
    "name": "syntheticstellarpopconvolve",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "astrophysics, stellar evolution, population synthesis, starformation rate history, convolution",
    "author": "David Hendriks",
    "author_email": "davidhendriks93@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/89/e1108b775d87a56ccefd9c97f6c61c9fdb38c05302f20525e6c6ec750bd2/syntheticstellarpopconvolve-0.3.tar.gz",
    "platform": null,
    "description": "# Synthetic Stellar Pop Convolve (SSPC)\n![docstring coverage](./badges/docstring_coverage.svg) ![test coverage](./badges/test_coverage.svg)\n\nThis repository contains the code and documentation for the synthetic\nstellar-population convolution code-base `Synthetic Stellar Pop\nConvolve (SSPC)`. `SSPC` is available in a [Gitlab\nrepository](https://gitlab.com/dhendriks/syntheticstellarpopconvolve)\nas well as on\n[Pypi](https://pypi.org/project/syntheticstellarpopconvolve/).\n\nThe code was originally developed by David Hendriks (with invaluable\nhelp from Lieke van Son) for the project of [Hendriks et al. 2023\n(MNRAS)](https://doi.org/10.1093/mnras/stad2857), where it was used to\nconvolve gravitational-wave merger events from binary systems as well\nas supernova events from both binary systems and single stars with a\ncosmological star-formation rate.\n\nSSPC can be used to convolve the output of stellar\npopulation-synthesis codes with (cosmological) starformation\nrates. It can convolve both event-based (line by line) data, as\nwell as ensemble-based (nested histogram) data. The user must provide\ninformation about the column/layer that contains the necessary data to\nperform the convolution, which is at minimum the delay-time and the\nnormalized yield. The latter quantity gets multiplied directly with\nthe appropriate SFR, and as such should already be weighted by\ne.g. binary fractions, importance-sampling weights and others.\n\nIt is possible to provide additional weights *during* convolution, which can\ninclude things like detection probability that depend on redshift.\n\nlist of some current features:\n\n-   convolution of event-based (lines) data\n-   convolution of ensemble-based (nested histograms) data\n    -   pre- and post-convolution marginalisation of the ensembles\n-   convolution of several datasets in sequence with a particular SFR\n-   convolution of data with a sequence of SFRs\n-   multiprocessed where relevant\n-   astropy units\n-   rescaling and transforming data\n-   additional weighting during convolution (for e.g. detection probability)\n-   etc.\n\nIn the coming period I will:\n\n-   Continue to clean the code, update the docstrings of the functions, and\n    provide type-hinting.\n-   Continue to flesh out the tutorial notebooks and add examples and use-cases\n    (including how to set up convolution with BinCodex-type data)\n-   Add relevant star-formation rate and metallicity-distribution prescriptions\n    (including for the MW), and make the part of the code that explains how to\n    supply SFR information a bit more clear\n-   make the advanced functionality more clear and provide a notebook on this.\n\nFuture features I aim to add in the foreseeable future:\n\n-   better functionality for other data-sources/types: Currently event-based data\n    requires it being stored in a dataframe but one should be able to provide\n    custom-data functions to change this.\n-   functionality for pre-convolution data filtering (i.e. performing queries on\n    the data): while the input data can be filtered to only contain the relevant\n    data, I can imagine that one may want to convolve the data with different\n    filters using the same input-data (although that could be done\n    post-convolution)\n-   better support for spatially-resolved star-formation rates: while\n    we currently can already convolve spatially resolved\n    star-formation rates by just dividing the space into a grid and\n    handling each cell in sequence using the functionality for\n    handling multiple SFRs, it probably can be improved by allowing\n    extra information to be passed along which can be used in\n    e.g. selection functions.\n-   ??? (please let me know about desired features)\n\nThe code is in late-beta stage, and is largely covered in unit-tests, but its\nnot entirely finished just yet and likely still contains some bugs that I have\nnot been able to pick up. Thats where this community can come in! I think this\ncode could become useful for many pop-synth groups, especially when people\nsubmit git issues for bugs and feature requests!\n\nAs I said the code is not fully stable yet but I do invite people to start\nhaving a look at the code-base and try out installing.\n\nIf anyone has questions, hit me up on the LISA-UCB slack channel or send me an\nemail on [mail@davidhendriks.com](mailto:mail@davidhendriks.com).\n\n\n## Installation\n\n\n### Requirements\nThe Python packages that are required for this code to run are listed in the `requirements.txt`, which automatically gets read out by `setup.py`.\n\n### Installation via PIP:\nTo install this package via pip:\n\n```\npip install syntheticstellarpopconvolve\n```\n\n### Installation from source:\nTo install the `binary_c-python` from source, which is useful for development versions and customisation, run\n\n```\n./install.sh\n```\n\nThis will install the package, along with all the dependencies, into the current active (virtual) python environment.\n\n\n## documentation\nDocumentation is available in the repository and on [readthedocs](https://synthetic-stellar-pop-convolve.readthedocs.io/en/latest/) where we provide [tutorial and example use-case notebooks](https://synthetic-stellar-pop-convolve.readthedocs.io/en/latest/example_notebooks.html)\n\n## Development:\nIf you want to contribute to the code, then it is recommended that you install the packages in `development_requirements.txt`:\n\n```\npip install -r development_requirements.txt\n```\n\nPlease do not hesitate to contact us to discuss any contribution. Please see `HOW_TO_CONTRIBUTE`.\n\nSome useful commands to generate documentation and coverage reports are stored in the `commands/` directory.\n\nWe use the following naming convention for development and release branches:\n\n```\ndevelopment/<binary_c-python version>/<binary_c version>\nreleases/<binary_c-python version>/<binary_c version>\n```\n\n### Generating documentation\nTo build the documentation manually, run\n\n```\n./generate_docs.sh\n```\n\nfrom within the `commands/` directory. Note: this requires `pandoc` to be installed on your machine.\n\n### Generating docstring and test coverage report\nTo generate the unit test and docstring coverage report, run\n\n```\n./generate_reports.sh\n```\n\nfrom within the `commands/` directory.\n",
    "bugtrack_url": null,
    "license": "gpl",
    "summary": "synthetic stellar pop convolve is a python package to convolve output of stellar population synthesis codes with star formation rates.",
    "version": "0.3",
    "project_urls": {
        "Homepage": "https://gitlab.com/dhendriks/syntheticstellarpopconvolve"
    },
    "split_keywords": [
        "astrophysics",
        " stellar evolution",
        " population synthesis",
        " starformation rate history",
        " convolution"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2989e1108b775d87a56ccefd9c97f6c61c9fdb38c05302f20525e6c6ec750bd2",
                "md5": "f5e64512afd2ede40f2438754b039917",
                "sha256": "68d7f9205b011224d49c2a897a49545b7b3d2681343e8e98342d30db49d55b13"
            },
            "downloads": -1,
            "filename": "syntheticstellarpopconvolve-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f5e64512afd2ede40f2438754b039917",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1714498,
            "upload_time": "2024-05-14T22:33:58",
            "upload_time_iso_8601": "2024-05-14T22:33:58.132016Z",
            "url": "https://files.pythonhosted.org/packages/29/89/e1108b775d87a56ccefd9c97f6c61c9fdb38c05302f20525e6c6ec750bd2/syntheticstellarpopconvolve-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-14 22:33:58",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "dhendriks",
    "gitlab_project": "syntheticstellarpopconvolve",
    "lcname": "syntheticstellarpopconvolve"
}
        
Elapsed time: 0.27108s