Skip to content

Commit

Permalink
Merge pull request #228 from sahiljhawar/GRB_model_pin
Browse files Browse the repository at this point in the history
This PR pins GRB parameters for a test.
  • Loading branch information
mcoughlin authored Sep 8, 2023
2 parents b688b93 + f9ffd2e commit ad3d1e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: mpi4py/setup-mpi@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
Expand All @@ -26,12 +26,12 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
key: ${{ runner.os }}-pip-2-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-pip-2-
- name: Install dependencies
run: |
#sudo apt-get install gfortran swig libhdf5-serial-dev libmpich-dev
Expand Down
16 changes: 16 additions & 0 deletions nmma/tests/data/TrPi2018_pinned_parameters.prior
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
luminosity_distance = 6942.0
timeshift = 0
inclination_EM = 0.7
log10_E0 = 50
thetaCore = 0.7
thetaWing = 0.7
log10_n0 = 10
p = 7
log10_epsilon_e = -9
log10_epsilon_B = -3
ksiN=1.0
L0=0.0
dL = 3.09e19
b = 6
q = 0.0
ts = 0.0
6 changes: 4 additions & 2 deletions nmma/tests/injections.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def create_injection_from_command_line(model_name):

if model_name == "nugent-hyper":
prior_path = os.path.join( priorDir, "sncosmo-generic" + ".prior")
elif model_name == "TrPi2018":
prior_path = os.path.join( dataDir, "TrPi2018_pinned_parameters" + ".prior") #pinning the parameter svalues in the prior file
else:
prior_path = os.path.join( priorDir, model_name + ".prior")
assert os.path.exists(prior_path), "prior file does not exist"
Expand Down Expand Up @@ -292,8 +294,8 @@ def test_injections():
"salt2": SupernovaLightCurveModel,
"Me2017": SimpleKilonovaLightCurveModel,
"Piro2021": ShockCoolingLightCurveModel,
# "TrPi2018": GRBLightCurveModel,
"TrPi2018": GRBLightCurveModel,
"Ka2017": SVDLightCurveModel,
}
for model_name, model_lightcurve_function in lightcurve_models.items():
lightcurveInjectionTest(model_name, model_lightcurve_function)
lightcurveInjectionTest(model_name, model_lightcurve_function)

0 comments on commit ad3d1e1

Please sign in to comment.