Skip to content

Commit

Permalink
Merge pull request #56 from jluastro/dev
Browse files Browse the repository at this point in the history
v2.0 release
  • Loading branch information
jluastro authored Jan 30, 2024
2 parents d296796 + 002fbf2 commit b841e6b
Show file tree
Hide file tree
Showing 24 changed files with 237 additions and 166 deletions.
10 changes: 9 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ build:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"
jobs:
post_checkout:
- git clone https://github.com/astropy/SPISEA.git
- mkdir cbds
- cd cbds
- wget https://archive.stsci.edu/hlsps/reference-atlases/hlsp_reference-atlases_hst_multi_kurucz-1993-atlas_multi_v2_synphot4.tar
- tar -xf hlsp_reference-atlases_hst_multi_kurucz-1993-atlas_multi_v2_synphot4.tar
- mv grp/redcat/trds/grid cbds/grid
- git clone https://github.com/MovingUniverseLab/BAGLE_Microlensing.git

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand All @@ -30,4 +39,3 @@ sphinx:
python:
install:
- requirements: requirements.txt

2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PopSyCLE
:alt: Powered by Astropy Badge

**Pop**\ulation **Sy**\nthesis for **C**\ompact-object **L**\ensing **E**\vents
is a code to simulate a model of the Milky Way including compact objects and multiple systems and perform a mock microlensing survey.
You can use it to put black hole candidates into context and to understand the effect of Galactic properties on photometric and astrometric microlensing simulation distributions among many other applications.

Full PopSyCLE documentation can be found `here <https://popsycle.readthedocs.io/en/latest/>`_.

Expand Down
4 changes: 2 additions & 2 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ built on open source, and we'd love to have you hang out in our community.

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars0.githubusercontent.com/u/1459392" width="48px;" alt="Jessica Lu"/><br /><sub><b>Jessica Lu</b></sub>](https://github.com/jluastro)<br /> | [<img src="https://avatars1.githubusercontent.com/u/31839166" width="48px;" alt="Casey Lam"/><br /><sub><b>Casey Lam</b></sub>](https://github.com/caseylam)<br /> | [<img src="https://avatars3.githubusercontent.com/u/12001188?s=460&u=5a23ecfbee6274c0368f7993353719ff2ec6e7bb" width="48px;" alt="Michael Medford"/><br /><sub><b>Michael Medford</b></sub>](https://github.com/MichaelMedford)<br /> | [<img src="https://avatars2.githubusercontent.com/u/58865295?s=460&v=4" width="48px;" alt="Sam Rose"/><br /><sub><b>Sam Rose</b></sub>](https://github.com/samrose30)<br /> | [<img src="https://avatars1.githubusercontent.com/u/27032156?s=460&v=4" width="48px;" alt="Kerianne Pruett"/><br /><sub><b>Kerianne Pruett</b></sub>](https://github.com/Kerianne28)<br /> | [<img src="https://camo.githubusercontent.com/83550327505c3092f9d99cfeec9382ce009f7d88/68747470733a2f2f322e67726176617461722e636f6d2f6176617461722f31633138323232653235663537643263306333333533666538343133353564653f643d68747470732533412532462532466769746875622e6769746875626173736574732e636f6d253246696d6167657325324667726176617461727325324667726176617461722d757365722d3432302e706e6726723d6726733d3634" width="48px;" alt="Will Dawson"/><br /><sub><b>Will Dawson</b></sub>](http://www.dawsonresearch.com/)<br /> |
| :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars0.githubusercontent.com/u/1459392" width="48px;" alt="Jessica Lu"/><br /><sub><b>Jessica Lu</b></sub>](https://github.com/jluastro)<br /> | [<img src="https://avatars1.githubusercontent.com/u/31839166" width="48px;" alt="Casey Lam"/><br /><sub><b>Casey Lam</b></sub>](https://github.com/caseylam)<br /> | [<img src="https://avatars3.githubusercontent.com/u/12001188?s=460&u=5a23ecfbee6274c0368f7993353719ff2ec6e7bb" width="48px;" alt="Michael Medford"/><br /><sub><b>Michael Medford</b></sub>](https://github.com/MichaelMedford)<br /> | [<img src="https://avatars2.githubusercontent.com/u/58865295?s=460&v=4" width="48px;" alt="Sam Rose"/><br /><sub><b>Sam Rose</b></sub>](https://github.com/samrose30)<br /> | [<img src="https://www.nsabrams.com/images/Natasha.jpeg" width="48px;" alt="Natasha Abrams"/><br /><sub><b>Natasha Abrams</b></sub>](https://www.nsabrams.com/)<br /> | [<img src="https://avatars1.githubusercontent.com/u/27032156?s=460&v=4" width="48px;" alt="Kerianne Pruett"/><br /><sub><b>Kerianne Pruett</b></sub>](https://github.com/Kerianne28)<br /> | [<img src="https://people.llnl.gov/sites/default/files/styles/medium/public/img/dawson29.png?itok=4raoUpPa" width="48px;" alt="Will Dawson"/><br /><sub><b>Will Dawson</b></sub>](http://www.dawsonresearch.com/)<br /> |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
6 changes: 3 additions & 3 deletions docs/PopSyCLE_example_multiples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@
"metadata": {},
"source": [
"First add an additional column with the number of observable peaks for binary events, then make\n",
"cuts based on the baseline magnitude, u0, and delta_m. You can make additional cuts, beyond this function if desired."
"cuts based on the baseline magnitude, u0, and delta_m. You can make additional cuts, beyond this function if desired. Note these are standard observational cuts we make, but the patch is too small to leave any events after cuts."
]
},
{
Expand All @@ -1175,8 +1175,8 @@
"t_cut, t_cut_one_peak, t_multiples_cut_multi_peak = binary_utils.cut_Mruns(t, \n",
" t_companions, \n",
" t_peaks, \n",
" min_mag = 25, \n",
" delta_m_cut = None, \n",
" min_mag = 22, \n",
" delta_m_cut = 0.1, \n",
" u0_cut = 2, \n",
" ubv_filter = 'I', \n",
" S_LSN = 'S')"
Expand Down
11 changes: 6 additions & 5 deletions docs/PopSyCLE_example_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
" n_obs=10,\n",
" theta_frac=2,\n",
" blend_rad=0.75,\n",
" IFMR= 'Raithel18',\n",
" IFMR= 'SukhboldN20',\n",
" isochrones_dir='/g/lu/models/PopSyCLE_isochrones',\n",
" bin_edges_number=None,\n",
" BH_kick_speed_mean=50,\n",
" NS_kick_speed_mean=400,\n",
" photometric_system='ubv',\n",
" filter_name='R',\n",
" red_law='Schlafly11',\n",
" red_law='Damineli16',\n",
" multiplicity=None,\n",
" galaxia_galaxy_model_filename= '/g/lu/code/galaxia/docs/galaxyModelParams_PopSyCLEv3.txt')"
]
},
Expand Down Expand Up @@ -88,7 +89,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -102,7 +103,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.11.0"
},
"pycharm": {
"stem_cell": {
Expand All @@ -115,5 +116,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
27 changes: 15 additions & 12 deletions docs/PopSyCLE_example_slurm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/michael/miniconda3/lib/python3.6/site-packages/pysynphot/locations.py:346: UserWarning: Extinction files not found in /Users/michael/models/cdbs/extinction\n",
" warnings.warn('Extinction files not found in %s' % (extdir, ))\n"
"/opt/mambaforge3/envs/astro/lib/python3.11/site-packages/pysynphot/locations.py:345: UserWarning: Extinction files not found in /g/lu/models/cdbs/extinction\n",
" warnings.warn('Extinction files not found in %s' % (extdir, ))\n",
"/opt/mambaforge3/envs/astro/lib/python3.11/site-packages/pysynphot/refs.py:124: UserWarning: No thermal tables found, no thermal calculations can be performed. No files found for /g/lu/models/cdbs/mtab/*_tmt.fits\n",
" warnings.warn('No thermal tables found, '\n"
]
}
],
Expand All @@ -42,12 +44,12 @@
"source": [
"run.generate_slurm_config_file(config_filename='slurm_config.yaml',\n",
" path_python='python',\n",
" account='uLens',\n",
" account='ulens',\n",
" queue='regular',\n",
" resource='Haswell',\n",
" n_cores_per_node=32,\n",
" n_nodes_max=2388,\n",
" walltime_max=48,\n",
" resource='cpu',\n",
" n_cores_per_node=64,\n",
" n_nodes_max=3072,\n",
" walltime_max=24,\n",
" additional_lines=['module load cray-hdf5/1.10.5.2', 'export HDF5_USE_FILE_LOCKING=FALSE'])"
]
},
Expand All @@ -72,13 +74,14 @@
" theta_frac=2,\n",
" blend_rad=0.75,\n",
" isochrones_dir='/Users/myself/popsycle_isochrones',\n",
" IFMR='Raithel18',\n",
" IFMR='SukhboldN20',\n",
" bin_edges_number=None,\n",
" BH_kick_speed_mean=50,\n",
" NS_kick_speed_mean=400,\n",
" photometric_system='ubv',\n",
" filter_name='r',\n",
" red_law='Schlafly11')"
" red_law='Damineli16',\n",
" multiplicity=None)"
]
},
{
Expand Down Expand Up @@ -124,7 +127,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -138,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.11.0"
},
"pycharm": {
"stem_cell": {
Expand All @@ -151,5 +154,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
17 changes: 11 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../../popsycle/'))
sys.path.insert(0, os.path.abspath('../'))
sys.path.insert(0, os.path.abspath('../SPISEA/spisea/'))
sys.path.insert(0, os.path.abspath('../SPISEA/'))
sys.path.insert(0, os.path.abspath('../BAGLE_Microlensing/src/'))
os.environ["PYSYN_CDBS"] = "../cbds"

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand All @@ -17,7 +27,7 @@
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'numpydoc', 'sphinx_rtd_theme'] #'sphinx.ext.napoleon'

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'deprecated']



Expand All @@ -26,8 +36,3 @@

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']


import os
import sys
sys.path.insert(0, os.path.abspath('../../popsycle/'))
File renamed without changes
File renamed without changes.
1 change: 1 addition & 0 deletions docs/howto.rst → docs/deprecated/howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,5 @@ For example, zams_mass_L is the ZAMS mass of the lens, and age_S is the log(age/
|t0 |Time at which the minimum source-lens |days |
| |separation occurs | |
+--------------------+----------------------------------------------+--------------+

>>>>>>> 508ec94f996e06fc219d2871af03d5e5414da5f4
11 changes: 7 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Welcome to PopSyCLE's documentation!
:alt: Powered by Astropy Badge

**Pop**\ulation **Sy**\nthesis for **C**\ompact-object **L**\ensing **E**\vents
is a code to simulate a model of the Milky Way including compact objects and multiple systems and perform a mock microlensing survey.
You can use it to put black hole candidates into context and to understand the effect of Galactic properties on photometric and astrometric microlensing simulation distributions among many other applications.

.. toctree::
:maxdepth: 2
Expand Down Expand Up @@ -46,20 +48,21 @@ Running PopSyCLE
----------------

An example of implementing PopSyCLE can be found
`in our example notebook <docs/PopSyCLE_example.ipynb>`_.
`single stars <https://github.com/jluastro/PopSyCLE/blob/main/docs/PopSyCLE_example.ipynb>`_ or
`with multiples <https://github.com/jluastro/PopSyCLE/blob/main/docs/PopSyCLE_example_multiples.ipynb>`_.

Running the PopSyCLE Pipeline
-----------------------------

An example of running the PopSyCLE pipline from the command line be found
`in our example notebook <docs/PopSyCLE_example_run.ipynb>`_.
`in our example notebook <https://github.com/jluastro/PopSyCLE/blob/main/docs/PopSyCLE_example_run.ipynb>`__.

Running the PopSyCLE Pipeline on a Slurm Scheduler
--------------------------------------------------

An example of running the PopSyCLE pipline on a compute cluster with a
slurm scheduler can be found
`in our example notebook <docs/PopSyCLE_example_slurm.ipynb>`_.
`in our example notebook <https://github.com/jluastro/PopSyCLE/blob/main/docs/PopSyCLE_example_slurm.ipynb>`__.

License
-------
Expand All @@ -77,7 +80,7 @@ Contributing
We love contributions! PopSyCLE is open source,
built on open source, and we'd love to have you hang out in our community.

`Check out all of PopSyCLE's contributors! <contributors.md>`_.
`Check out all of PopSyCLE's contributors! <https://github.com/jluastro/PopSyCLE/blob/main/contributors.md>`_

**Imposter syndrome disclaimer**: We want your help. No, really.

Expand Down
26 changes: 18 additions & 8 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
changelog
========
Change Log
==========

=========================
v2.0.0 (Insert Date Here)
v2.0.0 (2024-01-29)
=========================

New Features:
-------------
* Multiplicity
* See Abrams et al., in prep for details
* See new example HERE for details of how to call functions to add multiple systems.
* See `new example <https://github.com/jluastro/PopSyCLE/blob/main/docs/PopSyCLE_example_multiples.ipynb>`_ for details of how to call functions to add multiple systems.

* run_galaxia() is not modified, but all other function calls can be optionally changed to add multiple systems.
* New function refine_binary_events() added to simulate binary lightcurves using BAGLE.

* New metallicity-dependent Initial-Final Mass Relations (IFMR)
* See `Rose et al. 2022 <https://ui.adsabs.harvard.edu/abs/2022ApJ...941..116R/abstract>`_ for details.
* You are now required to input an IFMR when calling ``perform_pop_syn`` by specifying ``IFMR = 'SukhboldN20'`` (the other options are ``‘Raithel18’`` and ``‘Spera15’``). The previous default was ``‘Raithel18’``.
* Maxwellian Kicks
* A more sophisticated method for assigning birth kick velocities to newly formed compact objects was also added to PopSyCLE, described in more detail in Section 2.4 of `Rose et al. 2022 <https://ui.adsabs.harvard.edu/abs/2022ApJ...941..116R/abstract>`_. Instead of a single set of birth kicks of 100 km/s for black holes and 350 km/s for neutron stars being applied, a Maxwellian distribution with means at those values respectively were applied.
* NS masses drawn from distribution rather than a single mass
* See Section 2.2 of `Rose et al. 2022 <https://ui.adsabs.harvard.edu/abs/2022ApJ...941..116R/abstract>`_ for details.
* perform_pop_syn multiprocessing
* perform_pop_syn() multiprocessing
* Updated test suite to use pytest

Method Changes:
Expand All @@ -40,7 +42,15 @@ Misc:
* Various memory and speed up fixes.
* All mentions of PyPopStar were converted to SPISEA to reflect the software name changes.

==================
v1.0.0 (1-22-2020)
==================
===================
v1.1.0 (2020-03-02)
===================
* Filter Systems, Reformatted HDF5 Files, Pipeline Execution
* This release contains the abilities to add Zwicky Transient Facility photometry to the PopSyCLE data pipeline, with a structure set up for future support of additional filter systems.
* Additionally, hdf5 files generated by generate_pop_syn now contain the metallicity, bolometric luminosity, surface gravity, and effective temperature of stars which may be used for population selections and stellar typing. The structure of these hdf5 files have been reformatted to use numpy compound datatypes, allowing for easy user access without using the col_idx objects in previous releases.
* This release enables the execution of the PopSyCLE pipeline with the command line tool run.py, as well as support to run this pipeline executor on a Slurm scheduler.

===================
v1.0.0 (2019-09-28)
===================
* Initial release (`Lam et al. 2020 <https://ui.adsabs.harvard.edu/abs/2020ApJ...889...31L/abstract>`_).
Loading

0 comments on commit b841e6b

Please sign in to comment.