Skip to content

Commit

Permalink
Add ability to make html reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
transientlunatic committed Sep 3, 2024
1 parent e20cfb2 commit d8ff2ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
18 changes: 16 additions & 2 deletions minke/injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import astropy.units as u

import otter

from .models.lalsimulation import SEOBNRv3, IMRPhenomPv2
from .models.lalnoise import KNOWN_PSDS
from .detector import KNOWN_IFOS
Expand Down Expand Up @@ -39,7 +41,6 @@ def make_injection(

waveform_model = waveform()


injections = {}
for detector, psd_model in detectors.items():
logger.info(f"Making injection for {detector}")
Expand Down Expand Up @@ -151,10 +152,18 @@ def injection(settings):
}

logging.basicConfig(level=LOGGER_LEVELS[level])

settings_ = settings
settings = settings["injection"]
parameters = injection_parameters_add_units(settings["parameters"])

report = otter.Otter(os.path.join(settings_.get("pages directory", "."), "injection.html")
title="Minke Injection"
)

with report:
report + "# Injection frames"
report + settings

detector_dict = {
settings["interferometers"][ifo]: settings["psds"][ifo]
for ifo in settings["interferometers"]
Expand All @@ -171,3 +180,8 @@ def injection(settings):
psdfile="psd",
)
data = injections

for injection in injections:
f = injection.plot()
with report:
report + f
9 changes: 0 additions & 9 deletions minke/models/lalsimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ def time_domain(self, parameters=None, times=None, **kwargs):
self._cache = WaveformDict(parameters=parameters, plus=hp_ts, cross=hx_ts)

return self._cache

class IMRPhenomPv1(LALSimulationApproximant):
def __init__(self):
super().__init__()
self._args["approximant"] = lalsimulation.GetApproximantFromString(
"IMRPhenomP"
)

class IMRPhenomPv2(LALSimulationApproximant):
def __init__(self):
Expand All @@ -203,5 +196,3 @@ class SEOBNRv3(LALSimulationApproximant):
def __init__(self):
super().__init__()
self._args["approximant"] = lalsimulation.GetApproximantFromString("SEOBNRv3")


0 comments on commit d8ff2ed

Please sign in to comment.