Skip to content
Snippets Groups Projects
Commit 49126072 authored by Kevin Kuns's avatar Kevin Kuns
Browse files

precomp_quantum stores data as structs instead of dicts in the ifo struct

parent de24d3b1
No related branches found
No related tags found
No related merge requests found
......@@ -140,8 +140,20 @@ def precomp_cavity(f, ifo):
def precomp_quantum(f, ifo):
if 'gwinc' not in ifo:
ifo.gwinc = Struct()
ifo.gwinc.Quantum = Struct()
noise_dict = noise.quantum.shotrad(f, ifo)
ifo.gwinc.quantum = noise_dict
ifo.gwinc.Quantum.ASvac = noise_dict['asvac']
ifo.gwinc.Quantum.SRC = noise_dict['src']
ifo.gwinc.Quantum.Arm = noise_dict['arm']
ifo.gwinc.Quantum.Injection = noise_dict['injection']
# FC0 are the noises from the filter cavity losses and FC0_unsqzd_back
# are noises from the unsqueezed vacuum injected at the back mirror
# Right now there are at most one filter cavity in all the models;
# if there were two, there would also be FC1 and FC1_unsqzd_back, etc.
ifo.gwinc.Quantum.FC = noise_dict['FC0'] + noise_dict['FC0_unsqzd_back']
ifo.gwinc.Quantum.PD = noise_dict['pd']
##################################################
......@@ -228,7 +240,7 @@ class QuantumVacuumAS(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['asvac']
return self.ifo.gwinc.Quantum.ASvac
class QuantumVacuumArm(nb.Noise):
......@@ -247,7 +259,7 @@ class QuantumVacuumArm(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['arm']
return self.ifo.gwinc.Quantum.Arm
class QuantumVacuumSRC(nb.Noise):
......@@ -266,8 +278,7 @@ class QuantumVacuumSRC(nb.Noise):
]
def calc(self):
noise_dict = noise.quantum.shotrad(self.freq, self.ifo)
return self.ifo.gwinc.quantum['src']
return self.ifo.gwinc.Quantum.SRC
class QuantumVacuumFilterCavity(nb.Noise):
......@@ -286,13 +297,7 @@ class QuantumVacuumFilterCavity(nb.Noise):
]
def calc(self):
noise_dict = self.ifo.gwinc.quantum
# FC0 are the noises from the filter cavity losses and FC0_unsqzd_back
# are noises from the unsqueezed vacuum injected at the back mirror
# Right now there are at most one filter cavity in all the models;
# if there were two, there would also be FC1 and FC1_unsqzd_back, etc.
total = noise_dict['FC0'] + noise_dict['FC0_unsqzd_back']
return total
return self.ifo.gwinc.Quantum.FC
class QuantumVacuumInjection(nb.Noise):
......@@ -311,7 +316,7 @@ class QuantumVacuumInjection(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['injection']
return self.ifo.gwinc.Quantum.Injection
class QuantumVacuumReadout(nb.Noise):
......@@ -330,7 +335,7 @@ class QuantumVacuumReadout(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['pd']
return self.ifo.gwinc.Quantum.PD
class StandardQuantumLimit(nb.Noise):
......@@ -343,6 +348,10 @@ class StandardQuantumLimit(nb.Noise):
linestyle=":",
)
precomp = [
precomp_mirror,
]
def calc(self):
return 8 * const.hbar / (self.ifo.Materials.MirrorMass * (2 * np.pi * self.freq) ** 2)
......
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