Skip to content

Commit

Permalink
add injection file and injection path
Browse files Browse the repository at this point in the history
  • Loading branch information
sahiljhawar committed Jul 18, 2024
1 parent eee9b22 commit bda86e8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nmma/tests/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
from tools import analysis_slurm


WORKING_DIR = os.path.dirname(__file__)
DATA_DIR = os.path.join(WORKING_DIR, "data")

@pytest.fixture(scope="module")
def args():
workingDir = os.path.dirname(__file__)
dataDir = os.path.join(workingDir, "data")

args = Namespace(
model="Bu2019nsbh",
interpolation_type="tensorflow",
svd_path=dataDir,
svd_path=DATA_DIR,
outdir="outdir",
label="injection",
trigger_time=None,
Expand All @@ -40,7 +40,7 @@ def args():
nlive=64,
reactive_sampling=False,
seed=42,
injection=f"{dataDir}/Bu2019lm_injection.json",
injection=f"{DATA_DIR}/Bu2019lm_injection.json",
injection_num=0,
injection_detection_limit=None,
injection_outfile="outdir/lc.csv",
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_nn_analysis(args):
args.dt = 0.25
args.filters = "ztfg,ztfr,ztfi"
args.local_only = False

args.injection=f"{DATA_DIR}/Ka2017_injection.json"
analysis.main(args)

def test_analysis_slurm(args):
Expand Down
28 changes: 28 additions & 0 deletions nmma/tests/data/Ka2017_injection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"injections": {
"__dataframe__": true,
"content": {
"simulation_id": [
0
],
"luminosity_distance": [
41.521910341458366
],
"timeshift": [
0.0
],
"log10_mej": [
-2.1686855651216765
],
"log10_vej": [
-0.9281116614254382
],
"log10_Xlan": [
-4.9135946404939235
],
"geocent_time": [
58940.94264517932
]
}
}
}

0 comments on commit bda86e8

Please sign in to comment.