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

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

parent b9f392ab
No related branches found
No related tags found
1 merge request!94Quantum noise sub-budgets
......@@ -168,8 +168,20 @@ def precomp_suspension(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']
##################################################
......@@ -249,7 +261,7 @@ class QuantumVacuumAS(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['asvac']
return self.ifo.gwinc.Quantum.ASvac
class QuantumVacuumArm(nb.Noise):
......@@ -268,7 +280,7 @@ class QuantumVacuumArm(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['arm']
return self.ifo.gwinc.Quantum.Arm
class QuantumVacuumSRC(nb.Noise):
......@@ -287,8 +299,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):
......@@ -307,13 +318,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):
......@@ -332,7 +337,7 @@ class QuantumVacuumInjection(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['injection']
return self.ifo.gwinc.Quantum.Injection
class QuantumVacuumReadout(nb.Noise):
......@@ -351,7 +356,7 @@ class QuantumVacuumReadout(nb.Noise):
]
def calc(self):
return self.ifo.gwinc.quantum['pd']
return self.ifo.gwinc.Quantum.PD
class StandardQuantumLimit(nb.Noise):
......@@ -364,6 +369,10 @@ class StandardQuantumLimit(nb.Noise):
linestyle=":",
)
precomp = [
precomp_mirror,
]
def calc(self):
ETM = mirror_struct(self.ifo, 'ETM')
return 8 * const.hbar / (ETM.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