diveshscript


Namediveshscript JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/your-repo
SummaryA brief description of the package
upload_time2024-08-25 22:13:54
maintainerNone
docs_urlNone
authorYour Name
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # script
## (*S*emi-numerical *C*ode for *R*e*I*onization with *P*ho*T*on-conservation)

This package allows you to generate the ionization field during the epoch of cosmological reionization using the photon-conserving algorithm of **Choudhury & Paranjape (2018)**.

# Download and Stay Updated

The most straightforward way to download the code and stay updated is to clone the latest version from [bitbucket](https://bitbucket.org/rctirthankar/script) to your local computer via git. While downloading the first time, you can clone the repository as:

~~~Bash
> git clone https://bitbucket.org/rctirthankar/script
~~~

For subsequent updates, just type:

~~~Bash
> git pull
~~~

# Installing the Code

After downloading the code, go to the folder **script** and type:

~~~Bash
> python setup.py install --user    ## assuming you do not have root access and want to install locally
~~~

Sometimes, after downloading the latest update of the code or after updating your OS, you may find difficulty in re-installing. This is because of some files leftover from the previous installation. In that case, try the following:
~~~Bash
> python setup.py clean --all
~~~

### Fortran compiler
Note that the installation requires a fortran compiler present in your computer (assumed to be gfortran). The default `setup.py` should be able to locate the compiler if it exists in the usual locations. In case the fortran compiler cannot be located (but is installed on your system), you can specify it explicitly using

~~~Bash
> F90=/full/path/to/f90 python setup.py install --user
~~~

### FFTW3 libraries
The FFTW3 libraries are needed for power spectra calculations. The `setup.py` looks for the FFTW3 installations in the usual locations. 

In case the FFTW3 libraries are already installed but could not be found, you can add the paths to the environmental variables as
~~~Bash
> export LIBRARY_PATH=$LIBRARY_PATH:/full/path/to/lib
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/full/path/to/lib
~~~

In case the above does not work, you can specify the path to the FFTW3 libraries by setting a new environmental variable
~~~Bash
> export FFTW_DIR=/full/path/to/fftw/
~~~
The above command(s) should be put in your .bash_profile or .bashrc file so that they are executed as soon as you login.

If the FFTW3 libraries are not installed on your machine, please install either using the software repository of your operating system or by directly downloading from [the FFTW3 website](http://www.fftw.org/download.html). Usually the following sequence is sufficient (do *not* forget the ``--enable-shared`` flag):
~~~Bash
> ./configure --enable-shared
> make
> make install
~~~
In case you do *not* have root access, you need to customize the configure command, for example:
~~~Bash
> ./configure --enable-shared --prefix=/full/path/to/installation/directory
~~~

### Optional: Download and Install MUSIC
`script` depends on density and velocity files obtained using a *N*-body simulation. A faster method of generating these fields is to use a 2LPT code. We recommend downloading and installing `MUSIC` from the [official website](https://bitbucket.org/ohahn/music/src/master/).

# Running the Code

For accessing the script modules, type

~~~python
import script
~~~

If you also want to use the utilities for running MUSIC, type

~~~python
from script import two_lpt
~~~

There are three main class objects which are used to run the code:

* *script.default_simulation_data*: Class object for reading GADGET-2 snapshot file and setting up CIC density and velocity fields.
* *script.matter_fields*: Class object containing the density, velocity and collapsed halo fields smoothed to the resolution at which the maps will be generated.
* *script.ionization_map*: Class object for making the ionization maps.

Please take a look at the examples below to get an idea about how to use the code.

# Examples

You can carry out some simple examples by running the python codes provided under the **script/examples** folder.

1. Simple examples which show how to make ionization maps, compute power spectra and plot them. These examples require a GADGET-2 snapshot, one sample is provided in **script/examples/snap_008**
	1. *example_1p01_plot_maps_and_power_spectrum.py*: plot two-dimensional slices of the matter and HI density fields and also plot the 21 cm power spectrum.
	2. *example_1p02_plot_maps_for_different_parameters.py*: plot two-dimensional slices of the HI density fields for different parameters and resolutions.
	3. *example_1p03_compare_photon_conserving_excursion_set.py*: compare HI maps and power spectra obtained using the photon-conserving (PC) and excursion-set (ES) methods.
	4. *example_1p04_make_reionization_movie.py*: make a movie of the HI fields by varying the global ionized fraction and also simultaneously plot the 21 cm power spectrum. Needs `ffmpeg` installed.
2. Examples which require MUSIC to be installed.
	1. *example_2p01_run_2lpt_music.py*: run MUSIC to generate 2LPT particle positions and velocities that are needed for ionization maps.
	2. *example_2p02_redshift_movie.py*: make a movie of the HI fields for a reionization history using the outputs from MUSIC and also simultaneously plot the 21 cm power spectrum.
	3. *example_2p03_light_cone.py*: make light cone map for a reionization history using the outputs from MUSIC.
3. Other examples.
	1. *example_3p01_zeta_function.py*: make HI maps using a mass-dependent efficiency parameter zeta.
	2. *example_3p02_UV_luminosity_function.py*: compute the UV luminosity function for the mass function used.

3. *script.ipynb*: a sample Jupyter notebook showing the basic capabilities of **script**.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/your-repo",
    "name": "diveshscript",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "your.email@example.com",
    "download_url": "https://files.pythonhosted.org/packages/f6/ae/2e225d077d79fb090e00740f92d11402899789b3925e2dab6a9c6ec6d1a1/diveshscript-0.1.0.tar.gz",
    "platform": null,
    "description": "# script\n## (*S*emi-numerical *C*ode for *R*e*I*onization with *P*ho*T*on-conservation)\n\nThis package allows you to generate the ionization field during the epoch of cosmological reionization using the photon-conserving algorithm of **Choudhury & Paranjape (2018)**.\n\n# Download and Stay Updated\n\nThe most straightforward way to download the code and stay updated is to clone the latest version from [bitbucket](https://bitbucket.org/rctirthankar/script) to your local computer via git. While downloading the first time, you can clone the repository as:\n\n~~~Bash\n> git clone https://bitbucket.org/rctirthankar/script\n~~~\n\nFor subsequent updates, just type:\n\n~~~Bash\n> git pull\n~~~\n\n# Installing the Code\n\nAfter downloading the code, go to the folder **script** and type:\n\n~~~Bash\n> python setup.py install --user    ## assuming you do not have root access and want to install locally\n~~~\n\nSometimes, after downloading the latest update of the code or after updating your OS, you may find difficulty in re-installing. This is because of some files leftover from the previous installation. In that case, try the following:\n~~~Bash\n> python setup.py clean --all\n~~~\n\n### Fortran compiler\nNote that the installation requires a fortran compiler present in your computer (assumed to be gfortran). The default `setup.py` should be able to locate the compiler if it exists in the usual locations. In case the fortran compiler cannot be located (but is installed on your system), you can specify it explicitly using\n\n~~~Bash\n> F90=/full/path/to/f90 python setup.py install --user\n~~~\n\n### FFTW3 libraries\nThe FFTW3 libraries are needed for power spectra calculations. The `setup.py` looks for the FFTW3 installations in the usual locations. \n\nIn case the FFTW3 libraries are already installed but could not be found, you can add the paths to the environmental variables as\n~~~Bash\n> export LIBRARY_PATH=$LIBRARY_PATH:/full/path/to/lib\n> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/full/path/to/lib\n~~~\n\nIn case the above does not work, you can specify the path to the FFTW3 libraries by setting a new environmental variable\n~~~Bash\n> export FFTW_DIR=/full/path/to/fftw/\n~~~\nThe above command(s) should be put in your .bash_profile or .bashrc file so that they are executed as soon as you login.\n\nIf the FFTW3 libraries are not installed on your machine, please install either using the software repository of your operating system or by directly downloading from [the FFTW3 website](http://www.fftw.org/download.html). Usually the following sequence is sufficient (do *not* forget the ``--enable-shared`` flag):\n~~~Bash\n> ./configure --enable-shared\n> make\n> make install\n~~~\nIn case you do *not* have root access, you need to customize the configure command, for example:\n~~~Bash\n> ./configure --enable-shared --prefix=/full/path/to/installation/directory\n~~~\n\n### Optional: Download and Install MUSIC\n`script` depends on density and velocity files obtained using a *N*-body simulation. A faster method of generating these fields is to use a 2LPT code. We recommend downloading and installing `MUSIC` from the [official website](https://bitbucket.org/ohahn/music/src/master/).\n\n# Running the Code\n\nFor accessing the script modules, type\n\n~~~python\nimport script\n~~~\n\nIf you also want to use the utilities for running MUSIC, type\n\n~~~python\nfrom script import two_lpt\n~~~\n\nThere are three main class objects which are used to run the code:\n\n* *script.default_simulation_data*: Class object for reading GADGET-2 snapshot file and setting up CIC density and velocity fields.\n* *script.matter_fields*: Class object containing the density, velocity and collapsed halo fields smoothed to the resolution at which the maps will be generated.\n* *script.ionization_map*: Class object for making the ionization maps.\n\nPlease take a look at the examples below to get an idea about how to use the code.\n\n# Examples\n\nYou can carry out some simple examples by running the python codes provided under the **script/examples** folder.\n\n1. Simple examples which show how to make ionization maps, compute power spectra and plot them. These examples require a GADGET-2 snapshot, one sample is provided in **script/examples/snap_008**\n\t1. *example_1p01_plot_maps_and_power_spectrum.py*: plot two-dimensional slices of the matter and HI density fields and also plot the 21 cm power spectrum.\n\t2. *example_1p02_plot_maps_for_different_parameters.py*: plot two-dimensional slices of the HI density fields for different parameters and resolutions.\n\t3. *example_1p03_compare_photon_conserving_excursion_set.py*: compare HI maps and power spectra obtained using the photon-conserving (PC) and excursion-set (ES) methods.\n\t4. *example_1p04_make_reionization_movie.py*: make a movie of the HI fields by varying the global ionized fraction and also simultaneously plot the 21 cm power spectrum. Needs `ffmpeg` installed.\n2. Examples which require MUSIC to be installed.\n\t1. *example_2p01_run_2lpt_music.py*: run MUSIC to generate 2LPT particle positions and velocities that are needed for ionization maps.\n\t2. *example_2p02_redshift_movie.py*: make a movie of the HI fields for a reionization history using the outputs from MUSIC and also simultaneously plot the 21 cm power spectrum.\n\t3. *example_2p03_light_cone.py*: make light cone map for a reionization history using the outputs from MUSIC.\n3. Other examples.\n\t1. *example_3p01_zeta_function.py*: make HI maps using a mass-dependent efficiency parameter zeta.\n\t2. *example_3p02_UV_luminosity_function.py*: compute the UV luminosity function for the mass function used.\n\n3. *script.ipynb*: a sample Jupyter notebook showing the basic capabilities of **script**.",
    "bugtrack_url": null,
    "license": null,
    "summary": "A brief description of the package",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/your-repo"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6ae2e225d077d79fb090e00740f92d11402899789b3925e2dab6a9c6ec6d1a1",
                "md5": "0f6185f459b7942d196890ac958b53f0",
                "sha256": "35aaf2d28921f1e1e09c6532866e176f78318c98513512900480a01751b51602"
            },
            "downloads": -1,
            "filename": "diveshscript-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0f6185f459b7942d196890ac958b53f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 40041,
            "upload_time": "2024-08-25T22:13:54",
            "upload_time_iso_8601": "2024-08-25T22:13:54.103527Z",
            "url": "https://files.pythonhosted.org/packages/f6/ae/2e225d077d79fb090e00740f92d11402899789b3925e2dab6a9c6ec6d1a1/diveshscript-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-25 22:13:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "your-repo",
    "github_not_found": true,
    "lcname": "diveshscript"
}
        
Elapsed time: 0.75934s