# FIXME convert to years (use some lal or pylal thing in the future) vA.array /= secs_in_year vA2.array /= secs_in_year * secs_in_year #two powers for this squared quantity #Trim the array to have sane values outside the total mass area of interest try: minvol = scipy.unique(vA.array)[1]/10.0 except: minvol = 0 UL.trim_mass_space(dvA, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) UL.trim_mass_space(vA, instruments, minthresh=minvol, minM=UL.mintotal, maxM=UL.maxtotal) UL.trim_mass_space(vA2, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) #output an XML file with the result xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA, "2DsearchvolumeFirstMoment")) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA2, "2DsearchvolumeSecondMoment")) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(dvA, "2DsearchvolumeDerivative")) # DONE with vA, so it is okay to mess it up... # Compute range vA.array = (vA.array * secs_in_year / UL.livetime[instruments] / (4.0/3.0 * pi)) **(1.0/3.0) UL.trim_mass_space(vA, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA, "2DsearchvolumeDistance")) # make a live time UL.trim_mass_space(ltA, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(ltA, "2DsearchvolumeLiveTime")) utils.write_filename(xmldoc, "2Dsearchvolume-%s-%s.xml" % (opts.output_name_tag, "".join(sorted(list(instruments)))))
#gw = rate.gaussian_window2d(2,2,8) gw = None #Get derivative of volume with respect to FAR #dvA = get_volume_derivative(opts.injfnames, twoDMassBins, dBin, FAR, zero_lag_segments, gw) vA, vA2 = twoD_SearchVolume(Found, Missed, twoDMassBins, dBin, gw, 1.0, bootnum=int(opts.bootstrap_iterations)) # FIXME convert to years (use some lal or pylal thing in the future) #vA.array /= secs_in_year #vA2.array /= secs_in_year * secs_in_year #two powers for this squared quantity #Trim the array to have sane values outside the total mass area of interest try: minvol = scipy.unique(vA.array)[1]/10.0 except: minvol = 0 #trim_mass_space(dvA, twoDMassBins, minthresh=0.0, minM=min_mtotal, maxM=max_mtotal) trim_mass_space(vA, twoDMassBins, minthresh=minvol, minM=min_mtotal, maxM=max_mtotal) trim_mass_space(vA2, twoDMassBins, minthresh=0.0, minM=min_mtotal, maxM=max_mtotal) #output an XML file with the result xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA, "2DsearchvolumeFirstMoment")) xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA2, "2DsearchvolumeSecondMoment")) #xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(dvA, "2DsearchvolumeDerivative")) # DONE with vA, so it is okay to mess it up... # Compute range #vA.array = (vA.array * secs_in_year / live_time / (4.0/3.0 * pi)) **(1.0/3.0) #xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA, "2DsearchvolumeDistance")) utils.write_filename(xmldoc, "2Dsearchvolume-%s-%s.xml" % (opts.output_name_tag, "".join(sorted(opts.instruments))))
UL.trim_mass_space(vA, instruments, minthresh=minvol, minM=UL.mintotal, maxM=UL.maxtotal) UL.trim_mass_space(vA2, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) #output an XML file with the result xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) xmldoc.childNodes[-1].appendChild( rate.binned_array_to_xml(vA, "2DsearchvolumeFirstMoment")) xmldoc.childNodes[-1].appendChild( rate.binned_array_to_xml(vA2, "2DsearchvolumeSecondMoment")) xmldoc.childNodes[-1].appendChild( rate.binned_array_to_xml(dvA, "2DsearchvolumeDerivative")) # DONE with vA, so it is okay to mess it up... # Compute range vA.array = (vA.array * secs_in_year / UL.livetime[instruments] / (4.0 / 3.0 * pi))**(1.0 / 3.0) UL.trim_mass_space(vA, instruments, minthresh=0.0, minM=UL.mintotal, maxM=UL.maxtotal) xmldoc.childNodes[-1].appendChild(
minvol = scipy.unique(vA.array)[1] / 10.0 except: minvol = 0 #trim_mass_space(dvA, twoDMassBins, minthresh=0.0, minM=min_mtotal, maxM=max_mtotal) trim_mass_space(vA, twoDMassBins, minthresh=minvol, minM=min_mtotal, maxM=max_mtotal) trim_mass_space(vA2, twoDMassBins, minthresh=0.0, minM=min_mtotal, maxM=max_mtotal) #output an XML file with the result xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) xmldoc.childNodes[-1].appendChild( rate.binned_array_to_xml(vA, "2DsearchvolumeFirstMoment")) xmldoc.childNodes[-1].appendChild( rate.binned_array_to_xml(vA2, "2DsearchvolumeSecondMoment")) #xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(dvA, "2DsearchvolumeDerivative")) # DONE with vA, so it is okay to mess it up... # Compute range #vA.array = (vA.array * secs_in_year / live_time / (4.0/3.0 * pi)) **(1.0/3.0) #xmldoc.childNodes[-1].appendChild(rate.binned_array_to_xml(vA, "2DsearchvolumeDistance")) utils.write_filename( xmldoc, "2Dsearchvolume-%s-%s.xml" % (opts.output_name_tag, "".join(sorted(opts.instruments))))