Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed sample_times arg in .generate_lightcurve definition #82

Open
wants to merge 276 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
276 commits
Select commit Hold shift + click to select a range
7d1e860
commit so I can run locally
Feb 13, 2022
b80be34
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
Feb 13, 2022
fed2551
Update training documentation
mcoughlin Feb 14, 2022
15c172c
Clean up training docs
mcoughlin Feb 14, 2022
946a19e
Add a command line to an plot EOS
weizmannk Feb 14, 2022
6c57024
Merge pull request #6 from weizmannk/constrain_R14_trend
mcoughlin Feb 14, 2022
327de5a
Weizmann's documentation
mcoughlin Feb 14, 2022
e62e5d1
Yay for symmetries!
mcoughlin Feb 14, 2022
781af9d
typing mistake correction
weizmannk Feb 14, 2022
82b1948
Merge pull request #13 from weizmannk/main
mcoughlin Feb 14, 2022
1667a07
direction of the file gw_posteriors.txt
weizmannk Feb 14, 2022
b3ed6cd
Merge pull request #14 from weizmannk/main
mcoughlin Feb 14, 2022
e5985ed
Point to EOS Zenodo link
mcoughlin Feb 15, 2022
ce67181
instructions file modified
ritwiksharma049 Feb 17, 2022
f38ad08
installation instructions file
ritwiksharma049 Feb 17, 2022
c0dd6a9
instructions file modified
ritwiksharma049 Feb 18, 2022
e70fa32
Merge pull request #17 from ritwiksharma049/inst
mcoughlin Feb 18, 2022
70d8e7f
use standard library for package resources
mcoughlin Feb 21, 2022
74463af
Try pinning parameter order in model training
mcoughlin Feb 21, 2022
4f8577d
Try dealing with this pathlib thing
mcoughlin Feb 22, 2022
735cc26
pathlib dependency issues
mcoughlin Feb 22, 2022
f5fd178
pathlib mystery
mcoughlin Feb 22, 2022
56bcec9
Continued dependicies studies
mcoughlin Feb 23, 2022
07f2de5
dependency fun
mcoughlin Feb 23, 2022
98dd4c7
try removing wrapt...
mcoughlin Feb 23, 2022
03e1c92
try installing from master
mcoughlin Feb 23, 2022
6fb599b
cache is the wrong name!
mcoughlin Feb 23, 2022
b156781
Attempt to fix numpy ragged nested sequences warning
Feb 28, 2022
6674363
Attempt to fix numpy ragged nested sequences warning 2
Mar 3, 2022
df5a8fa
Prevent the output message flooded by
Mar 6, 2022
bc6f25a
training plots
mcoughlin Mar 10, 2022
a7f77f3
Adding support for tf interpolation in nmma
Mar 16, 2022
6dfb9bc
Minor adjustment for better support on HPC
Mar 17, 2022
70fe935
Increase the timeout limit for afterglowpy to 60s
Mar 17, 2022
84d03e0
Solving the nmma checkpoint issue
Mar 18, 2022
a55a52b
Adding comment for average between filters
Mar 18, 2022
02cdf35
Adding PL_BB_fixedT model
Mar 22, 2022
208f5e1
Remove pdb
Mar 22, 2022
5f9c38c
Update PL_BB_fixedT to powerlaw_mag
Mar 22, 2022
ec08992
Allow the PL's reference filter to be chosen by user
Mar 22, 2022
eb7cfbb
Fix PL_BB_fixedT 1
Mar 23, 2022
1ac9e0a
Fix PL_BB_fixedT 2
Mar 23, 2022
f918abb
Fix PL_BB_fixedT 3
Mar 23, 2022
7073191
Fix PL_BB_fixedT 4
Mar 23, 2022
93689c4
Add gaussian-process-api as an interpolation option
mcoughlin Apr 5, 2022
440233f
Add rubin-ToO as an option
mcoughlin Apr 14, 2022
2a3cfc0
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Apr 14, 2022
7734db4
Add ability to read .dat files
mcoughlin Apr 14, 2022
22a52ef
adding too lims
Apr 14, 2022
cdeccea
Merge pull request #22 from niharika-sravan/main
mcoughlin Apr 14, 2022
59d8210
Working on ToOs
mcoughlin Apr 14, 2022
e84e851
fixing mag lim issues
Apr 15, 2022
527067d
Merge pull request #23 from niharika-sravan/main
mcoughlin Apr 15, 2022
4447cd5
Remove filters with data not simulated
mcoughlin Apr 15, 2022
b0c1074
Bug fix in case of missing filters
mcoughlin Apr 15, 2022
d0c537f
Keep upperlimits
mcoughlin Apr 15, 2022
2c7c8dc
installation file modified
ritwiksharma049 Apr 18, 2022
103996f
Merge pull request #25 from ritwiksharma049/file
mcoughlin Apr 18, 2022
8ec26af
Adding Rahul's contribution
tsunhopang Apr 19, 2022
9656822
Fix typo in recommended package
mcoughlin Apr 19, 2022
d707f81
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Apr 19, 2022
5ac992b
ztf command line fixed
ritwiksharma049 Apr 23, 2022
7155a82
prior file changed in command line
ritwiksharma049 Apr 24, 2022
3c88ec0
Merge pull request #27 from ritwiksharma049/docfix
mcoughlin Apr 24, 2022
06b68d1
Add ability to train a "CV" model based on example objects
mcoughlin Apr 25, 2022
a3d8a30
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Apr 25, 2022
bbf50a6
GRB211211A
mcoughlin Apr 26, 2022
635fc2c
no header
mcoughlin Apr 26, 2022
f166e5d
Update docs
mcoughlin Apr 26, 2022
283c8af
Add Bu2019nsbh as a training option
mcoughlin Apr 26, 2022
8ca7bd7
Add Bu2019nsbh prior file
mcoughlin Apr 26, 2022
2a2fb97
short and long grb priors
tahumada Apr 27, 2022
142509f
Merge pull request #28 from tahumada/main
mcoughlin Apr 27, 2022
11dbf2e
Merge branch 'main' into gp-api
mcoughlin Apr 27, 2022
3887821
Merge pull request #19 from mcoughlin/gp-api
mcoughlin Apr 27, 2022
15674eb
readme file modified
ritwiksharma049 Apr 27, 2022
49c482f
Merge pull request #29 from ritwiksharma049/readm
mcoughlin Apr 27, 2022
e556cdd
Include legend with all models when doing multi-modal fitting
mcoughlin May 5, 2022
6361255
Enable training of spectral models
mcoughlin May 19, 2022
bd7fd3c
Fix training tests
mcoughlin May 19, 2022
09bd919
minor changes to ensure interrow changes are handed to df sim and to …
May 20, 2022
d9f5204
clean up!
May 20, 2022
f2dadbd
Merge pull request #33 from niharika-sravan/main
mcoughlin May 20, 2022
3103e2d
Add simple prior file
mcoughlin May 20, 2022
395e212
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin May 20, 2022
31d2c11
Add ability to have different systematic error per filter
mcoughlin May 23, 2022
a6325b6
added descriptions in gwem_resampling.py and gwsamples_creation.py
May 24, 2022
e1df197
Merge pull request #35 from ninakuni/main
mcoughlin May 24, 2022
538d138
Fix error budget in case of upper limits
mcoughlin May 25, 2022
8c779ad
making too.csv output optional
May 30, 2022
e0eee7b
Merge pull request #37 from niharika-sravan/main
mcoughlin May 31, 2022
ee7570c
pymultinest instructions changed
ritwiksharma049 Jun 8, 2022
5e7068d
second commit on installation doc
ritwiksharma049 Jun 8, 2022
bde7b31
Merge pull request #39 from ritwiksharma049/readm
mcoughlin Jun 8, 2022
b630475
fix ref before assignment
dfinstad Jun 22, 2022
731cef4
remove extra chars
dfinstad Jun 22, 2022
b998802
Merge pull request #41 from dfinstad/fix_reqs
mcoughlin Jun 22, 2022
fcaf2ee
Merge pull request #40 from dfinstad/fix_em_analysis_vars
mcoughlin Jun 22, 2022
319eca9
switch to using tf model call
dfinstad Jun 22, 2022
0613ced
Merge pull request #42 from dfinstad/use_tf_model_call
mcoughlin Jun 23, 2022
cd216fd
Update docs with an additional example using the prior
Jun 29, 2022
1c1cc15
Merge pull request #43 from atoivonen13/docs
mcoughlin Jun 29, 2022
5148e0b
Make parameters more optional
mcoughlin Jun 30, 2022
bb4c15f
Refactor nmma.em.analysis
mcoughlin Jul 5, 2022
48ff87c
Raise minimum astropy version
mcoughlin Jul 5, 2022
795ab5b
Fix the intrinsic parameters
mcoughlin Jul 6, 2022
a89404c
revert to an earlier version of astropy
weizmannk Jul 10, 2022
48c9af9
Merge pull request #46 from weizmannk/main
mcoughlin Jul 10, 2022
98962d1
paralle_bilby typo on installation
weizmannk Jul 11, 2022
7bc86ae
Merge pull request #47 from weizmannk/main
mcoughlin Jul 11, 2022
aa9796c
Add SALT2
mcoughlin Jul 11, 2022
4e458bd
erge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Jul 11, 2022
c9d245d
Nina's TF files
mcoughlin Jul 15, 2022
55c0dc1
Add --optimal-augmentation-times as an option
mcoughlin Jul 16, 2022
2581c1e
Rename optimal -> photometry
mcoughlin Jul 16, 2022
7d1fded
Update fitting.md
atoivonen13 Jul 18, 2022
fe24db6
Merge pull request #48 from atoivonen13/docs
mcoughlin Jul 18, 2022
4b47dbf
Remove constant columns from corner plot
mcoughlin Jul 19, 2022
5b5a4a0
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Jul 19, 2022
abc634f
Add request_disk to condor file
Jul 19, 2022
7f0bca1
Use f-strings
Jul 19, 2022
3008884
Add condor script
weizmannk Jul 20, 2022
b8e9014
new update of nmma's intallation
weizmannk Jul 20, 2022
ebf6ada
Merge pull request #50 from weizmannk/light-curve-analysis-condor
mcoughlin Jul 20, 2022
e7ceedf
Do not quit loop if some filter is nan
mcoughlin Jul 23, 2022
16a0ca0
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Jul 23, 2022
a3a511c
A check on astropy version
mcoughlin Jul 23, 2022
3f5a43c
Upload GW prior file
mcoughlin Jul 28, 2022
a39a9e3
Update bilby requirement
mcoughlin Aug 17, 2022
ad3c82f
Merge pull request #51 from mcoughlin/bilby-requirement
mcoughlin Aug 18, 2022
aab2311
Update LICENSE
mcoughlin Aug 19, 2022
4272133
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Aug 19, 2022
cb2367c
Update versions
mcoughlin Aug 19, 2022
ac1ac0e
make afterglowpy optional
mcoughlin Aug 19, 2022
bce2cea
Explicitly install pyafterglow for testing
mcoughlin Aug 19, 2022
d11a88b
misnamed dependency
mcoughlin Aug 19, 2022
b0cb1d6
Ok we can do 3.7 a bit longer
mcoughlin Aug 19, 2022
e34620e
Fail more gracefully for optional arguments
mcoughlin Aug 22, 2022
35322d6
Update to v0.0.8
mcoughlin Aug 22, 2022
98485d7
Adding a rubin flag
weizmannk Aug 24, 2022
6abfcb8
Merge pull request #52 from weizmannk/main
mcoughlin Aug 24, 2022
b0b132b
Break if all nan
mcoughlin Aug 26, 2022
6156c7b
Merge branch 'main' of github.com:nuclear-multimessenger-astronomy/nmma
mcoughlin Aug 26, 2022
69a1341
By default, save files separately when training
mcoughlin Sep 21, 2022
6759e11
Make the inference step agnostic to filter list
mcoughlin Sep 21, 2022
1d8f463
NSBH GWEMresampling
Oct 21, 2022
d090332
Merge pull request #54 from ninakuni/main
mcoughlin Oct 21, 2022
6950629
EOS weighting functions
Oct 21, 2022
15aae5f
Merge branch 'nuclear-multimessenger-astronomy:main' into eosweighting
ninakuni Oct 21, 2022
32a31b6
Merge pull request #55 from ninakuni/eosweighting
mcoughlin Oct 21, 2022
14dc680
Add files via upload
ninakuni Oct 27, 2022
d6d806f
Merge pull request #1 from ninakuni/ninakuni-patch-1
ninakuni Oct 27, 2022
b2f6769
Add files via upload
ninakuni Oct 27, 2022
cd0460c
Merge pull request #2 from ninakuni/ninakuni-patch-2
ninakuni Oct 27, 2022
5896032
Add files via upload
ninakuni Oct 27, 2022
af73d03
Merge pull request #3 from ninakuni/ninakuni-patch-3
ninakuni Oct 27, 2022
13ae00b
Create GW-EM-resampling.md
ninakuni Oct 27, 2022
2e7adcd
Merge pull request #4 from ninakuni/ninakuni-patch-1-1
ninakuni Oct 27, 2022
17950ee
GWEMresampling docs, files, tools
Oct 27, 2022
a8f0fe2
Delete example_files/tools/gwem_resampling/15nsat_cse_uniform_R14 dir…
ninakuni Oct 27, 2022
02719e9
prior mv to priorsdir
Oct 28, 2022
c35e14c
Merge pull request #57 from ninakuni/gwemresampling_docs
mcoughlin Oct 28, 2022
0621e70
Delete corner_samples.jpg
ninakuni Oct 29, 2022
67a0962
corner_samples.png file
ninakuni Oct 29, 2022
aea45a4
Update index.rst
ninakuni Oct 29, 2022
37fd6e4
Update GW-EM-resampling.md
ninakuni Oct 29, 2022
e7f941f
Update GW-EM-resampling.md
ninakuni Oct 29, 2022
672e443
Update GW-EM-resampling.md
ninakuni Oct 29, 2022
5ba0fb1
Merge pull request #58 from ninakuni/gwemresampling_docs
mcoughlin Oct 29, 2022
4827b64
add training data for latest Bulla model
shreyasahasram08 Nov 3, 2022
544d9f9
fix scikit-learn version at 1.0.2
weizmannk Nov 29, 2022
7340521
update the ZTF cadence
weizmannk Nov 29, 2022
09f82ba
add scikit-learn=1.0.2
weizmannk Nov 29, 2022
a43ad16
Merge pull request #59 from weizmannk/main
weizmannk Nov 29, 2022
9e7ef4a
Use astropy for speed_of_light constant
mcoughlin Jan 4, 2023
b9d8626
Merge pull request #60 from mcoughlin/speed_of_light
mcoughlin Jan 4, 2023
0db3db5
update ToO lims
weizmannk Jan 19, 2023
107d894
Merge pull request #61 from weizmannk/main
mcoughlin Jan 19, 2023
cf9b305
Corrected code line in combined_analysis.md
ritwiksharma049 Jan 24, 2023
c9ffe24
Merge pull request #62 from ritwiksharma049/main
weizmannk Jan 24, 2023
30d10f9
Add manual plot option
mcoughlin Feb 4, 2023
ddb5f14
Fix plotting to be in requested order
mcoughlin Feb 4, 2023
b80ae75
Add files via upload
FabioRagosta Feb 9, 2023
2b81123
Delete Tutorial_nmmalcsimulator.ipynb
FabioRagosta Feb 9, 2023
9b19ca4
Create README.md
FabioRagosta Feb 9, 2023
26ed1ef
Add files via upload
FabioRagosta Feb 9, 2023
7358196
Update README.md
FabioRagosta Feb 9, 2023
374356c
Update lightcurve detection script
weizmannk Feb 9, 2023
b71ffa9
Update create lightcurve
weizmannk Feb 9, 2023
d08ac84
Add events ID in bilby injection file
weizmannk Feb 9, 2023
61dbd33
Update create lightcurve
weizmannk Feb 9, 2023
ca03e64
validated lightcurve sim tutorial
tylerbarna Feb 9, 2023
393e2f1
Merge pull request #64 from weizmannk/main
mcoughlin Feb 9, 2023
4cc8d61
Merge pull request #63 from FabioRagosta/main
mcoughlin Feb 10, 2023
c3b97db
Pin scipy version to 1.9.3
weizmannk Feb 16, 2023
3c3edfd
Pin scipy version to 1.9.3
weizmannk Feb 16, 2023
0d92178
Update setup.py
mcoughlin Feb 16, 2023
5ab8b8f
Update requirements.txt
mcoughlin Feb 16, 2023
e37df71
Merge pull request #66 from weizmannk/main
mcoughlin Feb 17, 2023
7f60479
cluster jobscript and quick start fix.
ritwiksharma049 Feb 21, 2023
32139cd
Merge pull request #68 from ritwiksharma049/cluster
mcoughlin Feb 21, 2023
94ab39d
expanse script indexed and README.md corrected
ritwiksharma049 Feb 22, 2023
5c6ebdb
Merge pull request #70 from ritwiksharma049/cluster1
mcoughlin Feb 22, 2023
74f7881
check for parameter definitions
mcoughlin Feb 24, 2023
80b4655
fix lightcurve plot
mcoughlin Feb 24, 2023
2f579bf
Peter's flags added on request
ritwiksharma049 Mar 4, 2023
0cf12d3
Peter's changes added
ritwiksharma049 Mar 4, 2023
798874b
Peter's changes added
ritwiksharma049 Mar 4, 2023
f4a65cc
.priors changed to .prior
ritwiksharma049 Mar 5, 2023
7dec68b
Merge pull request #71 from ritwiksharma049/enlil
weizmannk Mar 5, 2023
2ab083f
add filter check in ztf sampling
tylerbarna Mar 5, 2023
16ce829
Merge branch 'possis-update' of github.com:shreyasahasram08/nmma into…
shreyasahasram08 Mar 7, 2023
1b4fc20
sample masses in log10
shreyasahasram08 Mar 7, 2023
c680f46
Merge pull request #73 from shreyasahasram08/possis-update
mcoughlin Mar 7, 2023
e39e782
add updated tensorflow models
shreyasahasram08 Mar 7, 2023
c7fd293
Merge pull request #74 from shreyasahasram08/possis-update
mcoughlin Mar 7, 2023
5d8dab5
Check for missing filters in kilonova simulation
mcoughlin Mar 8, 2023
1ef08db
Ad-hoc fix for the kilonova filter in Kilonova+GRB model
tsunhopang Mar 8, 2023
73c6675
Add ZTF20abwysqy to example candidate_data
mcoughlin Mar 9, 2023
49cf1d5
Add missing grb-resolution argument to create_lightcurves.py
mcoughlin Mar 9, 2023
23eec29
Add missing jet-type argument
mcoughlin Mar 9, 2023
ff34512
Add WARNING statement when detection too bright for intervals
mcoughlin Mar 10, 2023
cf1db41
Raise error if light curve is empty
mcoughlin Mar 11, 2023
b258635
added 2nd filt condition to ztf sampling
tylerbarna Mar 12, 2023
1a901fb
Merge pull request #72 from tylerbarna/lc-ztf-sampling-filters
weizmannk Mar 12, 2023
99697ca
Using getFilteredMag in GenericCombineLCModel
tsunhopang Mar 12, 2023
0fac34d
Add CVs
mcoughlin Mar 22, 2023
216dae2
add LANL models
mcoughlin Mar 28, 2023
c1844c3
Use KNtheta, rather than KNTheta
mcoughlin Mar 28, 2023
20d52aa
Adding total ejecta mass calculation in BNSEjectaFitting
tsunhopang Apr 10, 2023
282e04c
Merge pull request #79 from mcoughlin/lanl
mcoughlin Apr 11, 2023
d25d547
update and edit
weizmannk Apr 17, 2023
7d8d3a8
add tuto to simulate lc detection
weizmannk Apr 18, 2023
4061243
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
49100cb
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
3f58eec
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
8719332
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
08ac6b4
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
5f1b2da
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
f0d9e4d
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
e7645d1
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
92a76f1
Update nmma/em/detect_lightcurves.py
weizmannk Apr 18, 2023
1cc317e
Update nmma/em/create_lightcurves.py
weizmannk Apr 19, 2023
27e5173
Update nmma/em/create_lightcurves.py
weizmannk Apr 19, 2023
1f412c7
update
weizmannk Apr 19, 2023
1577f88
update
weizmannk Apr 19, 2023
ef58d24
Merge pull request #80 from weizmannk/main
weizmannk Apr 19, 2023
e14f6e6
removed sample_times arg in .generate_lightcurves
tylerbarna Apr 26, 2023
717ce0c
made optional sample_times in gen_lc calls
tylerbarna Apr 26, 2023
5ed450d
Update analysis.py
tylerbarna Apr 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7]
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -36,6 +36,7 @@ jobs:
- name: Install dependencies
run: |
#sudo apt-get install gfortran swig libhdf5-serial-dev libmpich-dev
python -m pip install --upgrade git+https://github.com/bitranox/wrapt_timeout_decorator.git
python -m pip install coverage cpp-coveralls flake8 pytest
python -m pip install .[doc]

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ jobs:
run: |
# sudo apt-get install gfortran swig libhdf5-serial-dev libmpich-dev
sudo apt install -y openmpi-bin libopenmpi-dev gfortran build-essential libblas3 libblas-dev liblapack3 liblapack-dev libatlas-base-dev texlive texlive-latex-extra texlive-fonts-recommended dvipng cm-super
python -m pip install pytest pytest-cov flake8 pytest-aiohttp sqlparse freezegun PyJWT pathlib joblib
python -m pip install .[doc]
python -m pip install --upgrade git+https://github.com/bitranox/wrapt_timeout_decorator.git
python -m pip install pytest pytest-cov flake8 pytest-aiohttp sqlparse freezegun PyJWT joblib tensorflow afterglowpy
python -m pip install .
git clone https://github.com/JohannesBuchner/MultiNest && cd MultiNest/build && cmake .. && make && cd ../..
pwd
- name: Lint with flake8
Expand All @@ -70,6 +71,8 @@ jobs:
psql -U nmma -h localhost -c "GRANT ALL PRIVILEGES ON DATABASE nmma TO nmma;" nmma
- name: Test with pytest
run: |
pwd
ls
py.test nmma/tests/*
env:
LD_LIBRARY_PATH: .:/home/runner/work/nmma/nmma/MultiNest/lib # for Linux
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@



svdmodels/Bu2019lm_lbol.pkl
svdmodels/Bu2019lm_mag.pkl
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
pass_filenames: true
exclude: nmma|nb|.ipynb_checkpoints|data|dev|letsencrypt|logs|dask-worker-space
exclude: nb|.ipynb_checkpoints|data|dev|letsencrypt|logs|dask-worker-space
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
pass_filenames: true
exclude: nmma|nb|.ipynb_checkpoints|data|dev|letsencrypt|logs|dask-worker-space|__init__.py
exclude: nb|.ipynb_checkpoints|data|dev|letsencrypt|logs|dask-worker-space|__init__.py
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ NMMA
====

A pythonic library for probing nuclear physics and cosmology with multimessenger analysis


Please check our official documentation here: https://nuclear-multimessenger-astronomy.github.io/nmma/


How to contribute: https://nuclear-multimessenger-astronomy.github.io/nmma/contributing.html


A tutorial about how to produce simulations of lightcurves is given in nmma/tutorials/tutorial-lightcurve_simulation.ipynb
37 changes: 37 additions & 0 deletions doc/Cluster_Resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Cluster Resources (Expanse)

One might also want to submit bulk jobs while using NMMA. Here, we have
included an example script for job submission (called as jobscript.sh) in SLURM. This job was submitted on SDSC's
Expanse (ACCESS) cluster:

#!/bin/bash
#SBATCH --job-name=gw170817_gp_test.job
#SBATCH --output=logs/gw170817_gp_test.out
#SBATCH --error=logs/gw170817_gp_test.err
#SBATCH -p compute
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=10
#SBATCH --mem=249325M
#SBATCH --time=00:30:00
#SBATCH --mail-type=ALL
#SBATCH --mail-user= your_full_email
#SBATCH -A <<project*>>
#SBATCH --export=ALL
module purge
module load sdsc
module load cpu/0.15.4 gcc/10.2.0 intel-mpi/2019.8.254
source /home/username/anaconda3/bin/activate nmma_env
export PATH=$PATH:/home/username/anaconda3/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/username/anaconda3/lib/
mpiexec -n 10 light_curve_analysis --model Me2017 --outdir outdir --label injection --prior /home/username/nmma/priors/Me2017.prior --tmin 0.1 --tmax 20 --dt 0.5 --error-budget 1 --nlive 512 --Ebv-max 0 --injection /home/username/nmma/injection.json --injection-num 0 --injection-outfile outdir/lc.csv --generation-seed 42 --filters u,g,r,i,z,y,J,H,K --plot --remove-nondetections

To submit the job, run:

sbatch jobscript.sh

To check the job allotment, you can run:

squeue -u username


Test runs on other clusters are currently in progress. Further examples on other cluster resources will be subsequently added.
53 changes: 53 additions & 0 deletions doc/GW-EM-resampling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## Connecting Electromagnetic Signals to Source Properties

In NMMA, it is possible to use the results from GW inferences together with kilonova inferences or joint KN+GRB afterglow inferences to get estimates on the binary properties.
A binary system can be a binary neutron star (BNS) merger or a neutron-star-black-hole (NSBH) merger. We can connect observed electromagnetic signals to potential
source properties via phenomenological relations, i.e., via fits based on numerical-relativity relations, see [(Pang et al. 2022)](https://arxiv.org/pdf/2205.08513.pdf) and Refs. therein for further details.

For estimating the source properties, the following input files are required:

* `EMsamples` - is the posterior sample file from a previous Bayesian inference (e.g. Kilonova+GRB inference) on electromagnetic (EM) signals,
* `EMprior` - is the prior file that was used for the EM inference
* `EOS` - number of equation of state files which will be used in the resampling
* `EOSpath` - path to the folder of all EOS files
* `GWsamples` - some fiducial randomly generated posterior samples for masses $m_{1,2}$ , chirp mass $\mathcal{M}_c$, mass ratio $q$, luminosity distance $D_L$, and EOS samples,
* `GWprior` - a prior file for gravitational wave sources

## Estimating BNS properties

Here, we take the observed gamma-ray burst [GRB211211A](https://arxiv.org/abs/2204.10864) as an example and assume that associated electromagnetic signals
originated from a BNS merger. For this signal, a joint inference (kilonova + GRB) can be carried out and will provide you with the required `EMsamples`.
For the `GWsamples` input file, we need to generate some fiducial dummy GW samples. A script for the generation can be found [here](https://github.com/nuclear-multimessenger-astronomy/nmma/blob/main/example_files/tools/gwem_resampling/gwsamples_generation.py).
The GW sample generation is based on the EOS set `15nsat_cse_uniform_R14` which can be found on [Zenodo](https://zenodo.org/record/6106130#.Y1pdM9JBxhG).
The `EMprior` file is the same as used for the KN+GRB inference (see [priors](https://github.com/nuclear-multimessenger-astronomy/nmma/tree/main/priors)) and the GWprior file should be adjusted to the GWsamples.

Finally, we can use this command:

gwem_resampling --outdir outdir --GWsamples example_files/tools/gwem_resampling/GWsamples.dat --GWprior priors/GWBNS.prior --EMsamples example_files/tools/gwem_resampling/GRB211211A_posterior_samples.dat --EOSpath 15nsat_cse_uniform_R14/macro/ --Neos 5000 --EMprior priors/Bu2019lm_TrPi2018GRB211211A.prior --nlive 1024

The result will be a posterior file containing information on:

* the chirp mass $\mathcal{M}_c$,
* mass ratio $q$,
* Tidal deformability $\tilde{\Lambda}$,
* dynamical ejecta mass error $α$,
* dynamical ejecta mass fraction $ζ$, and
* equation of state EOS

A corner plot is shown below:

![GWEMcornerplot](images/corner_samples.png)


## Estimating NSBH properties

In order to estimate the properties of a NSBH system, you need to adjust the `GWsamples` and `GWprior` file accordingly and run the resampling
with the argument `withNSBH` (otherwise, you will run for a BNS system).

gwem_resampling --outdir outdir --GWsamples example_files/tools/gwem_resampling/GWsamples_NSBH.dat --GWprior priors/GWNSBH.prior --withNSBH --EMsamples example_files/tools/gwem_resampling/GRB211211A_NSBH_posterior_samples.dat --EOSpath 15nsat_cse_uniform_R14/macro/ --Neos 5000 --EMprior priors/Bu2019nsbh_TrPi2018_GRB211211A.prior --nlive 1024






91 changes: 91 additions & 0 deletions doc/combined_analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
## Perform combined analyses

NMMA is capable of performing combined analyses to constrain the neutron star equation of state (EOS) and Hubble Constant. In the following, we will take as an example the EOS analysis.

### Generate a simulation set

First of all, you need to create an output directory, this output will host all the data that will be used to constrain the EOS.

mkdir -p ./output

Running the following command line will generate a json file (injection.json) with the BILBY processing of compact binary merging events. We take here binaries of type BNS, NSBH is also an option. This injection contents a simulation set of parameters : luminosity_distance, log10_mej_wind, KNphi, inclination_EM, KNtimeshift, geocent_time for the Bu2019lm model. This creates an injection.json file in the ./output directory.

nmma_create_injection --prior-file ./priors/Bu2019lm.prior --eos-file ./example_files/eos/ALF2.dat --binary-type BNS -f ./output/injection --n-injection 100 --original-parameters --extension json


### lightcurve posterior

EMdata will house the posteriors of the electromagnetic data you will produce: in particular the lc.csv (./example_files/csv_lightcurve/outdir/macroeventID, where macroeventID in range(0, 100)) lightcurves. We now compute posteriors using NMMA on this simulated set of 100 events, of which we assume a fraction is detectable by ZTF. The result can be find at ./output/EMdata

for macroeventID in {0..99}

do
mkdir -p ./output/EMdata/outdir/$macroeventID/
light_curve_analysis --model Bu2019lm --svd-path ./svdmodels --interpolation_type tensorflow --outdir ./output/EMdata/outdir/$macroeventID --label injection_Bu2019lm --prior ./priors/Bu2019lm.prior --tmin 0 --tmax 7 --dt 0.5 --error-budget 1.0 --nlive 256 --Ebv-max 0 --injection ./output/injection.json --injection-num $macroeventID --injection-detection-limit 22,22,22 --injection-outfile ./output/EMdata/outdir/$macroeventID/lc.csv --generation-seed 42 --filters g,r,i --ztf-sampling --ztf-uncertainties --plot --remove-nondetections --photometry-augmentation --photometry-augmentation-filters u,g,r,i,z,y,J,H,K --photometry-augmentation-N-points 100
done


### Download GW posteriors

The gravitational wave samples can be can be downloaded at https://zenodo.org/record/6045029#.YgZzwITMKV5. At this link there are simulated posteriors for a number of gravitational-wave waveform models, here, we take the PhenDNRTv2 files.
This only concern the PhenDNRTv2 files on this link. These we can directly download by using this command line:

Create an outdir directory to put GW data that you will upload.

mkdir -p ./output/GWdata/outdir

Go to the GWdata directory

cd ./output/GWdata/outdir

Running the next command line:

xargs -n 1 curl -# -O < ../../../example_files/zenodo/gw_posteriors.txt

or use this one :

for url in `cat ../../../example_files/zenodo/gw_posteriors.txt`
do
curl -# -O $url
done


The gw_posteriors.txt contains a list of all links to the PhenDNRTv2 files. When the download is complete, return to the main directory

cd ../../..

### Download the EOS repository

All of the NMMA EOS simulation sets are kept in a separate github repository here:
https://github.com/diettim/NMMA

For this particular example, we have put the simulation set in Zenodo here:
https://zenodo.org/record/6094691#.YgwA8YTMI5k

### EoS from GW + EM

This command line combines the EOS measurements for each simulation. As stated above, we assume only a fraction is detectable by ZTF (based on simulations of the associated kilonova brightnesses). The indices of the 26 detectable events are {0, 3, 5, 7, 8, 10, 12, 13, 14, 15, 17, 19, 21, 22, 23, 24, 26, 27, 28, 31, 32,34, 36, 37, 38, 39}.

for macroeventID in 0 3 5 7 8 10 12 13 14 15 17 19 21 22 23 24 26 27 28 31 32 34 36 37 38 39

do
mkdir -p ./output/GW_EMdata/$macroeventID/
gwem_resampling --outdir ./output/GW_EMdata/$macroeventID --EMsamples ./output/EMdata/outdir/$macroeventID/injection_Bu2019lm_posterior_samples.dat --GWsamples ./output/GWdata/outdir/inj_PhD_posterior_samples_$macroeventID.dat --EOS ./example_files/eos/eos_sorted --nlive 8192 --GWprior ./priors/aligned_spin.priors --EMprior ./priors/EM.prior --total-ejecta-mass --Neos 5000

done


### A combined EOS analysis

We provide a helper function to combine the EOS results.

First of all create a foder to put the final data about EoS:

mkdir -p ./output/Figures

Then run the last one command line

combined_EOS --outdir ./output/Figures --label ZTF --gwR14trend ./example_files/ --GWEMsamples ./output/GW_EMdata --detections-file ./example_files/csv_lightcurve/detectable.txt --EOS-prior ./example_files/eos/EOS_sorted_weight.dat --EOSpath ./example_files/eos/eos_sorted --pdet ./example_files/eos/pdet_of_Mmax.dat --R14_true 11.55 --Neos 5000 --seed 42 --cred-interval 0.95


This should return a EoS plot, R14_trend_GW_EM_ZTF.pdf, and GW_EM_R14trend_ZTF.dat at ./output/Figures.
10 changes: 5 additions & 5 deletions doc/contributing.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# How to Contribute
## How to Contribute

## License
### License

NMMA is released under the MIT license, which means that you are allowed to modify the code for your own purposes, as long as you retain our [copyright notice](https://github.com/nuclear-multimessenger-astronomy/nmma/blob/master/LICENSE.txt).

However, we would love to grow the NMMA community, and integrate improvements directly into our [code repository on GitHub](https://github.com/nuclear-multimessenger-astronomy/nmma).

## Including your changes
### Including your changes

To make a code contribution to the project, follow these steps (which
are outlined in more detail in [this GitHub
Expand All @@ -26,7 +26,7 @@ For a more detailed explanation of the open contribution process, see
the [scikit-image contributors' guide](http://scikit-image.org/docs/stable/contribute.html).
We follow a very similar process; some guidance follows below.

## Bug Reports
### Bug Reports

While we appreciate code changes, it is also very helpful simply to
know when NMMA does not function correctly. Please [file any
Expand All @@ -39,7 +39,7 @@ If possible, provide:
2. A minimal way to reproduce the problem you see; these can be either
a set of instructions, or a script.

## Process guidelines
### Process guidelines

Because many developers work on NMMA, and PRs sometimes come in
at a rapid pace, we have guidelines to streamline review and
Expand Down
Loading