-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
176 changed files
with
532 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,86 @@ | ||
## Installation Guide | ||
|
||
### Quickstart | ||
### Instructions to install PISA on Madison working group servers cobalts (current guide from August 2023): | ||
|
||
Assuming you already are in the directory where you want to store fridge/pisa source files and the python virtualenv and build pisa. You also need access to github through your account. | ||
|
||
|
||
#### Clone into the fridge and pisa (ideally your own fork): | ||
|
||
``` | ||
git clone [email protected]:icecube/wg-oscillations-fridge.git ./fridge | ||
git clone [email protected]:USERNAME/pisa.git ./pisa | ||
``` | ||
|
||
|
||
#### Load cvmfs environment: | ||
|
||
``` | ||
unset OS_ARCH; eval `/cvmfs/icecube.opensciencegrid.org/py3-v4.2.1/setup.sh` | ||
``` | ||
|
||
`which python` should now point to `/cvmfs/icecube.opensciencegrid.org/py3-v4.2.1/RHEL_7_x86_64/bin/python` | ||
|
||
**Note:** It's not tested whether this works with a cvmfs version newer than `py3-v4.2.1`. | ||
|
||
|
||
#### Create virtual environment: | ||
|
||
``` | ||
python -m venv ./YOUR_PISA_PY3_VENV | ||
``` | ||
|
||
|
||
#### Start the virtual environment and install pisa from source: | ||
|
||
``` | ||
source ./YOUR_PISA_PY3_VENV/bin/activate | ||
``` | ||
|
||
(should now show that you are in the environment) | ||
|
||
``` | ||
pip install -e pisa | ||
``` | ||
|
||
|
||
#### Modify your environment by adding lines to `./YOUR_PISA_PY3_VENV/bin/activate` | ||
|
||
Every time you want to use pisa now, you need to activate your virtual environment by running `source ./YOUR_PISA_PY3_VENV/bin/activate`. In order to set some useful environment variables you might want to add the following lines (or more if needed) to the end of the `./YOUR_PISA_PY3_VENV/bin/activate` script: | ||
|
||
``` | ||
# PISA source | ||
export PISA="/data/user/USERNAME/PATH_TO_PISA" | ||
# set some custom environment variables and load fridge | ||
export PISA_RESOURCES="/data/user/USERNAME/PATH_TO_FRIDGE/analysis/common" | ||
export PISA_RESOURCES=$PISA_RESOURCES:"/data/user/USERNAME/PATH_TO_FRIDGE/analysis" | ||
source "/data/user/USERNAME/PATH_TO_FRIDGE/setup_fridge.sh" | ||
# Add this project to the python path | ||
export PYTHONPATH=$FRIDGE_DIR:$PYTHONPATH | ||
# Madison | ||
export PISA_RESOURCES=/data/ana/LE:$PISA_RESOURCES | ||
export PISA_RESOURCES=/data/ana/BSM/HNL/:$PISA_RESOURCES | ||
export PISA_RESOURCES=$FRIDGE_DIR:$FRIDGE_DIR/analysis:$FRIDGE_DIR/analysis/YOUR_ANALYSIS/settings:$FRIDGE_DIR/analysis/YOUR_ANALYSIS/analysis:$FRIDGE_DIR/analysis/common:$PISA_RESOURCES | ||
export PISA_CACHE=~/cache/ | ||
export PISA_FTYPE=fp64 | ||
export HDF5_USE_FILE_LOCKING='FALSE' | ||
``` | ||
|
||
|
||
#### Install any additional packages that you might want | ||
|
||
`pip install PACKAGE` (for example `jupyter`) | ||
|
||
|
||
|
||
### Quickstart (old guide) | ||
|
||
_Note that terminal commands below are intended for the bash shell. You'll have to translate if you use a different shell._ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# author: Anil Kumar ([email protected]) | ||
# date: 2023 | ||
|
||
""" | ||
DecayParams: Characterize neutrino decay parameters | ||
(alpha3) | ||
""" | ||
|
||
from __future__ import division | ||
|
||
import numpy as np | ||
|
||
from pisa import FTYPE, CTYPE | ||
|
||
__all__ = ['DecayParams'] | ||
|
||
class DecayParams(object): | ||
""" | ||
Holds neutrino decay parameters, i.e., alpha | ||
Parameters | ||
---------- | ||
decay_alpha3: float | ||
expected to be given in [eV^2] | ||
Attributes | ||
---------- | ||
decay_alpha3 : float | ||
Cf. parameters | ||
decay_matrix : 3d complex array | ||
""" | ||
def __init__(self): | ||
|
||
self._decay_alpha3 = 0. | ||
self._decay_matrix = np.zeros((3, 3), dtype=CTYPE) | ||
|
||
# --- theta12 --- | ||
@property | ||
def decay_alpha3(self): | ||
"""alpha3""" | ||
return self._decay_alpha3 | ||
|
||
@decay_alpha3.setter | ||
def decay_alpha3(self, value): | ||
self._decay_alpha3 = value | ||
|
||
@property | ||
def decay_matrix(self): | ||
"""Neutrino decay matrix""" | ||
decay_mat = np.zeros((3, 3), dtype=CTYPE) | ||
|
||
decay_mat[2, 2] = 0 -self.decay_alpha3*1j | ||
|
||
return decay_mat | ||
|
||
def test_decay_params(): | ||
""" | ||
# TODO: implement me! | ||
""" | ||
pass | ||
|
||
|
||
if __name__=='__main__': | ||
from pisa import TARGET | ||
from pisa.utils.log import set_verbosity, logging | ||
assert TARGET == 'cpu', "Cannot test functions on GPU, set PISA_TARGET to 'cpu'" | ||
set_verbosity(1) | ||
test_decay_params() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.