Metadata-Version: 2.4
Name: epspy
Version: 1.0.1
Summary: Extragalactic Point Sources
Project-URL: Repository, https://github.com/shikharmittal04/epspy.git
Author-email: Shikhar Mittal <shikhar.mittal4@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Shikhar Mittal
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: extragalactic,foregrounds,point sources
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.8
Requires-Dist: healpy
Requires-Dist: mpi4py
Requires-Dist: transformcl
Description-Content-Type: text/x-rst

Overview
--------

:Name: Extragalactic Point Sources
:Author: `Shikhar Mittal <https://sites.google.com/view/shikharmittal/home>`_
:Paper: `Mittal et al (2024) <https://doi.org/10.1093/mnras/stae2111>`_
:Documentation: `epspy.readthedocs.io <https://epspy.readthedocs.io/en/latest/index.html>`_

Why do you need this code?
--------------------------

Use this code to generate the foregrounds due to extragalactic point sources.

A cosmological global 21-cm signal hides under foregrounds due to galactic and extragalactic emissions. These foregrounds can easily be 4 to 5 orders of magnitude higher than the signal of interest. For a reliable inference, it is important to accurately model these foregrounds. While we have a reasonable understanding of galactic emission (typically fit as a log-log polynomial), we do not understand the extragalactic contributions. This package models the foregrounds due to extragalactic radio sources.

Read more about it in the paper `Mittal et al (2024) <https://doi.org/10.1093/mnras/stae2111>`_.

Installation and requirements
-----------------------------

This package can be installed as

.. code:: bash

   pip install epspy

It is recommended to work on a Python version > 3.8. Packages required are 

- `numpy <https://pypi.org/project/numpy/>`_
- `scipy <https://pypi.org/project/scipy/>`_
- `matplotlib <https://pypi.org/project/matplotlib/>`_
- `mpi4py <https://pypi.org/project/mpi4py/>`_
- `healpy <https://pypi.org/project/healpy/>`_
- `transformcl <https://pypi.org/project/transformcl/>`_


Quick start
-----------

The code is run in two main steps:

-  Assign the point sources flux densities (at a chosen reference frequency) and spectral indices.
-  Then generate the sky maps at desired frequencies of observation.

The following code captures the main functionalities of this package.

.. code:: python

   from epspy import meps

   #Step-1 initialise the object with default settings
   obj = meps.eps()

   #Step-2 generate the data at the reference frequency
   obj.ref_freq()

   #Step-3 generate the sky maps at multiple frequencies as well as their sky average
   obj.gen_freq()

   #Step-4 finally, generate a sky-averaged spectrum vs frequency figure
   obj.visual()


Save the above code as (say) ``eg_script.py`` and run it as

.. code:: bash

    python eg_script.py

Running the above will generate several files. The terminal messages will guide you to these output files. The most important of all files of your interest will be ``Tb_nu_map.npy``. To visualise your outputs use the function ``visual()``. Refer to the documentation for more details. To learn about the physics of this package see our `paper <https://doi.org/10.1093/mnras/stae2111>`_.

The default values in this package have been chosen such that the users can run their scripts on a PC. Since modern PCs have at least 4 cores, for a better performance, one could also run ``eg_script.py`` parallelly as 

.. code:: bash

    mpirun -np 4 python eg_script.py

In general, and for more realistic flux density ranges and high-resolution maps, it is recommended to use the code on high-performance clusters.

Documentation
-------------

For more details on the working of the package and understanding the output files refer to the `documentation <https://epspy.readthedocs.io/en/latest/index.html>`_.

License and citation
--------------------

The software is free to use on the MIT open-source license. If you use the software then please cite `Mittal et al (2024) <https://doi.org/10.1093/mnras/stae2111>`_.

If the code is used in a project where the author has provided significant scientific input, guidance on methodology, or assistance with interpretation of results, then co-authorship on resulting publications is expected, following standard academic practice.

Users are encouraged to contact the author when using the code for new scientific applications or major projects.

Acknowledgement
---------------
I thank Girish Kulkarni, Dominic Anstey, and Eloy de Lera Acedo for helpful comments and feedback during the development of this code.