Maintenance will be performed on git.ligo.org, chat.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 7th July 2020 starting at approximately 10am PDT and lasting for around 15 minutes. There will be a short period of downtime towards the end of the maintenance window. Please direct any comments, questions, or concerns to uwm-help@cgca.uwm.edu.

Commit 8c175895 authored by Anchal Gupta's avatar Anchal Gupta

Total will be calculated with upper and lower bounds now

parent 535bfd28
......@@ -1049,12 +1049,27 @@ class noiseBudget:
lno = len(lsList)
# Creating total expected noise
if doTotal:
totalPSD = np.zeros(len(self.freq))*uf(0, 0)
for psd in self.calcPSDList:
if psd in self.PSDList:
totalPSD = totalPSD + self.PSDList[psd][0]
totalPSD = np.zeros(len(self.freq))
totalPSDlb = np.zeros(len(self.freq))
totalPSDub = np.zeros(len(self.freq))
for key in self.calcPSDList:
if key in self.PSDList:
PSD = self.PSDList[key][0]
if isinstance(PSD[0], unc.core.AffineScalarFunc):
totalPSD = totalPSD + unpnv(PSD)
totalPSDlb = totalPSDlb + unpnv(PSD) - unpstd(PSD)
totalPSDub = totalPSDub + unpnv(PSD) + unpstd(PSD)
elif len(self.PSDList[key]) == 5:
totalPSD = totalPSD + PSD
totalPSDlb = totalPSDlb + self.PSDList[key][3]
totalPSDub = totalPSDub + self.PSDList[key][4]
else:
totalPSD = totalPSD + PSD
totalPSDlb = totalPSDlb + PSD
totalPSDub = totalPSDub + PSD
self.PSDList['total'] = [totalPSD, self.freq,
'Total expected noise']
'Total expected noise',
totalPSDlb, totalPSDub]
if 'total' not in plotList:
plotList += ['total']
psdPlot = plt.figure(figsize=(16, 12))
......@@ -1136,12 +1151,27 @@ class noiseBudget:
# Creating total expected noise
if doTotal:
totalPSD = np.zeros(len(self.freq))*uf(0, 0)
for psd in self.calcPSDList:
if psd in self.PSDList:
totalPSD = totalPSD + self.PSDList[psd][0]
totalPSD = np.zeros(len(self.freq))
totalPSDlb = np.zeros(len(self.freq))
totalPSDub = np.zeros(len(self.freq))
for key in self.calcPSDList:
if key in self.PSDList:
PSD = self.PSDList[key][0]
if isinstance(PSD[0], unc.core.AffineScalarFunc):
totalPSD = totalPSD + unpnv(PSD)
totalPSDlb = totalPSDlb + unpnv(PSD) - unpstd(PSD)
totalPSDub = totalPSDub + unpnv(PSD) + unpstd(PSD)
elif len(self.PSDList[key]) == 5:
totalPSD = totalPSD + PSD
totalPSDlb = totalPSDlb + self.PSDList[key][3]
totalPSDub = totalPSDub + self.PSDList[key][4]
else:
totalPSD = totalPSD + PSD
totalPSDlb = totalPSDlb + PSD
totalPSDub = totalPSDub + PSD
self.PSDList['total'] = [totalPSD, self.freq,
'Total expected noise']
'Total expected noise',
totalPSDlb, totalPSDub]
if 'total' not in saveList:
saveList += ['total']
......@@ -1204,7 +1234,8 @@ class noiseBudget:
tempdf.to_csv(filename + time.strftime("%Y%m%d_%H%M%S") + '.csv',
sep=',', index=False)
def loadPSD(self, filename, overridePresentPSD=False):
def loadPSD(self, filename, overridePresentPSD=False,
overridePresentFreq=False):
'''
This function loads the PSDs saved earlier using savePSD
Input arguments:
......@@ -1220,6 +1251,10 @@ class noiseBudget:
colList = list(tempdf.columns)
# Change self.freq if asked
if overridePresentFreq:
self.freq = tempdf['Freq (Hz)']
# Create loadList which is list of PSD names only
loadList = []
for col in colList:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment