Skip to content
Snippets Groups Projects
Commit ca4f1dee authored by Soichiro Kuwahara's avatar Soichiro Kuwahara
Browse files

cherenkov/rankingstat.py: add some pdf noramalization

- not needed just being done for safety
parent f7a463d0
No related branches found
No related tags found
No related merge requests found
......@@ -494,12 +494,16 @@ class RankingStatPDF(object):
# populate from XML
self.noise_lr_lnpdf = rate.BinnedLnPDF.from_xml(xml, "noise_lr_lnpdf")
self.zl_lr_lnpdf = rate.BinnedLnPDF.from_xml(xml, "zl_lr_lnpdf")
# shouldn't be needed, but just in case
self.noise_lr_lnpdf.normalize()
self.zl_lr_lnpdf.normalize()
return self
def to_xml(self, name):
# do not allow ourselves to be written to disk without our
# PDFs' internal normalization metadata being up to date
self.noise_lr_lnpdf.normalize()
self.zl_lr_lnpdf.normalize()
xml = ligolw.LIGO_LW({"Name": "%s:%s" % (name, self.ligo_lw_name_suffix)})
xml.appendChild(self.noise_lr_lnpdf.to_xml("noise_lr_lnpdf"))
xml.appendChild(self.zl_lr_lnpdf.to_xml("zl_lr_lnpdf"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment