cosmic-variance


Namecosmic-variance JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/astrockragh/cosmic_variance
SummaryPackage to calculate cosmic variance in rectangular pencil-beam surveys
upload_time2024-03-15 21:22:53
maintainer
docs_urlNone
authorChristian Kragh Jespersen
requires_python>=3.6
licenseMIT license
keywords cosmology galaxies statistics astrostatistics cosmic variance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ===============================
Cosmic Variance Calculator
===============================

Package to calculate cosmic variance in pencil-beam surveys
---------------------------------------------------------------------------

.. image:: https://img.shields.io/pypi/v/cosmic_variance.svg
        :target: https://pypi.python.org/pypi/cosmic_variance


Python package based on the IDL code released with the Cosmic Variance Cookbook of Moster et al. (2010). The code was written for https://arxiv.org/pdf/2403.00050.pdf, so **please cite this paper if you use this code**. 

The code is based on galaxy stellar mass bins (as described in https://arxiv.org/pdf/1001.1737.pdf), scaled to dark matter cosmic variance (as described in https://arxiv.org/pdf/astro-ph/0109130.pdf). 

This is significantly more useful than dark matter - only variance, since the empirical galaxy variance is significantly higher.

Free software: MIT license

Install and Use
-------------------

To install the package, simply run:

.. code-block:: bash

        pip install cosmic-variance

Then in your script/notebook, import the package as:

.. code-block:: python

        import cosmic_variance as cv

The main use of the package is through the get_cv function, which takes in a rectangular survey geometry with side lengths side1 and side2 (in degrees), and an array of redshift bin edges, and returns a pandas dataframe with the cosmic variance for 0.5 dex galaxy stellar mass bins for each redshift bin.

.. code-block:: python

        import cosmic_variance as cv
        import numpy as np
        # Example of using the main function, get_cv to calculate
        # cosmic variance for a single JWST pointing

        #### these arguments are required ####
        side1 = 2.2/60. # /60 to convert from arcmin to degrees
        side2 = 2*2.2/60. # /60 to convert from arcmin to degrees
        zarray = np.array([7,8,9,11,13]) # redshift bin edges, if dz is given, this array will be the center of the redshift bins

        #### these arguments are optional ####
        name = 'JWST' # name of the survey, if provided, the output file will be saved as dfs/{name}.csv along with a meta file.
        # Default is None, in which case the output will not be saved

        acc = 'low' # accuracy of the calculation, 'low' or 'high, low is default, faster and sufficient for almost all applications

        verbose = False # if True, will print out the progress of the calculation, default is False

        #If you want to use a different cosmology, you can specify it by the following in the get_cv call
        # OmegaM = 0.308, OmegaL = 0.692, OmegaBaryon = 0.022/(0.678)**2 sigma8 = 0.82, ns = 0.96, h = 0.678

        cv_df = cv.get_cv(side1, side2, zarray, name = name, acc=acc, verbose = verbose)

This will calculate the cosmic variance for a 2.2 arcmin x 4.4 arcmin survey in redshifts bin [7, 8], [8,9], [9,11], [11,13] and save the output.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/astrockragh/cosmic_variance",
    "name": "cosmic-variance",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "Cosmology,Galaxies,Statistics,Astrostatistics,Cosmic Variance",
    "author": "Christian Kragh Jespersen",
    "author_email": "ckragh@princeton.edu",
    "download_url": "https://files.pythonhosted.org/packages/14/4f/fa96fd7b5559b5f212ad9365993dab81aecc331534f7ea4b4ea8dd7ad746/cosmic_variance-0.1.6.tar.gz",
    "platform": null,
    "description": "===============================\nCosmic Variance Calculator\n===============================\n\nPackage to calculate cosmic variance in pencil-beam surveys\n---------------------------------------------------------------------------\n\n.. image:: https://img.shields.io/pypi/v/cosmic_variance.svg\n        :target: https://pypi.python.org/pypi/cosmic_variance\n\n\nPython package based on the IDL code released with the Cosmic Variance Cookbook of Moster et al. (2010). The code was written for https://arxiv.org/pdf/2403.00050.pdf, so **please cite this paper if you use this code**. \n\nThe code is based on galaxy stellar mass bins (as described in https://arxiv.org/pdf/1001.1737.pdf), scaled to dark matter cosmic variance (as described in https://arxiv.org/pdf/astro-ph/0109130.pdf). \n\nThis is significantly more useful than dark matter - only variance, since the empirical galaxy variance is significantly higher.\n\nFree software: MIT license\n\nInstall and Use\n-------------------\n\nTo install the package, simply run:\n\n.. code-block:: bash\n\n        pip install cosmic-variance\n\nThen in your script/notebook, import the package as:\n\n.. code-block:: python\n\n        import cosmic_variance as cv\n\nThe main use of the package is through the get_cv function, which takes in a rectangular survey geometry with side lengths side1 and side2 (in degrees), and an array of redshift bin edges, and returns a pandas dataframe with the cosmic variance for 0.5 dex galaxy stellar mass bins for each redshift bin.\n\n.. code-block:: python\n\n        import cosmic_variance as cv\n        import numpy as np\n        # Example of using the main function, get_cv to calculate\n        # cosmic variance for a single JWST pointing\n\n        #### these arguments are required ####\n        side1 = 2.2/60. # /60 to convert from arcmin to degrees\n        side2 = 2*2.2/60. # /60 to convert from arcmin to degrees\n        zarray = np.array([7,8,9,11,13]) # redshift bin edges, if dz is given, this array will be the center of the redshift bins\n\n        #### these arguments are optional ####\n        name = 'JWST' # name of the survey, if provided, the output file will be saved as dfs/{name}.csv along with a meta file.\n        # Default is None, in which case the output will not be saved\n\n        acc = 'low' # accuracy of the calculation, 'low' or 'high, low is default, faster and sufficient for almost all applications\n\n        verbose = False # if True, will print out the progress of the calculation, default is False\n\n        #If you want to use a different cosmology, you can specify it by the following in the get_cv call\n        # OmegaM = 0.308, OmegaL = 0.692, OmegaBaryon = 0.022/(0.678)**2 sigma8 = 0.82, ns = 0.96, h = 0.678\n\n        cv_df = cv.get_cv(side1, side2, zarray, name = name, acc=acc, verbose = verbose)\n\nThis will calculate the cosmic variance for a 2.2 arcmin x 4.4 arcmin survey in redshifts bin [7, 8], [8,9], [9,11], [11,13] and save the output.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Package to calculate cosmic variance in rectangular pencil-beam surveys",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/astrockragh/cosmic_variance"
    },
    "split_keywords": [
        "cosmology",
        "galaxies",
        "statistics",
        "astrostatistics",
        "cosmic variance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f603eb6cd69f4dffb7c5cc53aa01c0ae93e5e5c7324f9faa4a51b52e121a84c",
                "md5": "b8acd3277e9a5118b8580f447fcf117e",
                "sha256": "309fb4f8720e65571c805d920fc60ac68849c6d8670fc799e9f9a381e0ef9b4d"
            },
            "downloads": -1,
            "filename": "cosmic_variance-0.1.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b8acd3277e9a5118b8580f447fcf117e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 11052,
            "upload_time": "2024-03-15T21:22:51",
            "upload_time_iso_8601": "2024-03-15T21:22:51.631319Z",
            "url": "https://files.pythonhosted.org/packages/7f/60/3eb6cd69f4dffb7c5cc53aa01c0ae93e5e5c7324f9faa4a51b52e121a84c/cosmic_variance-0.1.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "144ffa96fd7b5559b5f212ad9365993dab81aecc331534f7ea4b4ea8dd7ad746",
                "md5": "81a72f027d5e5aae2fa553e8f0372b6f",
                "sha256": "1387b7a099f06ec977eed91554610044582ed98ccb95f81cdf07e30086518436"
            },
            "downloads": -1,
            "filename": "cosmic_variance-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "81a72f027d5e5aae2fa553e8f0372b6f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15995,
            "upload_time": "2024-03-15T21:22:53",
            "upload_time_iso_8601": "2024-03-15T21:22:53.443463Z",
            "url": "https://files.pythonhosted.org/packages/14/4f/fa96fd7b5559b5f212ad9365993dab81aecc331534f7ea4b4ea8dd7ad746/cosmic_variance-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-15 21:22:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "astrockragh",
    "github_project": "cosmic_variance",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cosmic-variance"
}
        
Elapsed time: 0.19463s