Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sybenzvi authored Aug 14, 2024
1 parent 1ecab0e commit 49c4c3d
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,51 @@
# BEMEWS: Better Earth Matter Effect calculation With SNEWPY

![image](https://github.com/SNEWS2/BEMEWS/assets/44247426/22dc06cb-e3b9-49d8-90ce-807a3308930f)
Image by dreamstudio.ai

## Description

`BEMEWS` is a python module for calculating the Earth-matter effect on neutrino flavor transformations. It is a standalone module that [SNEWPY](https://github.com/SNEWS2/snewpy) uses to compute the Earth-Matter Effect for supernova neutrinos. The `BEMEWS_example.py` script shows how to use the module in standalone mode. The `EarthMatter` flavor transformation class in [SNEWPY](https://github.com/SNEWS2/snewpy) is essentially the same script but with the output options turned off.

## Installation

# BEMEWS
A python module for calculating the Earth-matter Effect. BEMEWS is a standalone module which SNEWPY uses to compute the Earth-Matter Effect for supernova neutrinos. The BEMEWS_example.py script shows how to use the module in the standalone mode. The EarthMatter flavor transformation class in SNEWPY is essentially the same script but with the output turned off.
`BEMEWS` is available as a PyPI package and can be installed using
```
pip install BEMEWS
```
As of mid-August 2024, installation with `pip` is only available for Mac users.

1) You will need the python-devel, pybind11 and setuptools packages
If you need or wish to manually install `BEMEWS`, you can follow the instructions below:

2) Modify setup.py to use the correct libraries and paths.
1) You will need the packages python-devel (in Linux), [pybind11](https://pypi.org/project/pybind11/), and [setuptools](https://pypi.org/project/setuptools/)

2) Modify `setup.py` to use the correct libraries and paths.

3) To compile enter

sudo python3 setup.py install
`sudo python3 setup.py install`

4) If you don't want to sudo you may want to use the option

--install-lib=destination/directory/
`--install-lib=destination/directory/`

## Using BEMEWS

1) The python code `BEMEWS.py` uses the module to compute the Earth matter effects upon a neutrino signal from Betelgeuse in SuperK. It will generate a lot of files in `out` folder named in the script. The output can be switched off by changing the `outputflag` parameter to `False`.

5) The python code BEMEWS.py uses the module to compute the Earth matter effects upon a neutrino signal
from Betelgeuse in SuperK. It will generate a lot of files in the whichever folder is named
in the script. The output can be switched off by changing the outputflag to False
2) A script is provided that allows [SNEWPY](https://github.com/SNEWS2/snewpy) to include the Earth-matter Effect in its flavor transformation prescription.

6) A script is provided that allows SNEWPY to include the Earth-matter Effect in its flavor transformation
prescription.
## Troubleshooting

TROUBLESHOOTING:
1) When using `BEMEWS` you may have to set the `PYTHONPATH` environment variable to your PWD and/or wherever the `BEMEWS` module was installed in steps 3) or step 4)

1) When using BEMEWS you may have to set the PYTHONPATH environment variable to your PWD
and/or wherever the BEMEWS module was installed in steps 3) or step 4)
2) If your script still cannot find the module you may need to put the *.so library in the same directory as the file. The *.so library is in one of the subfolders in the build directory.

2) If your script still cannot find the module you may need to put the *.so library in the same directory
as the file. The *.so library is in one of the subfolders in the build directory.
3) BEMEWS uses [OpenMP](https://www.openmp.org/). You may want to set the `OMP_NUM_THREADS` environment variable to a number suitable for your machine.

3) BEMEWS uses OpenMP. You may want to set the OMP_NUM_THREADS environment variable to a number suitable for your machine.
4) During compilation, you may need to set the `LIBOMP_INCLUDE` variable to enable the build. If you are a homebrew user on Mac OS X, you can do this with the command
```
export LIBOMP_INCLUDE=`brew --prefix libomp`/include
```


0 comments on commit 49c4c3d

Please sign in to comment.