Commit 065acbdc authored by Christopher Wipf's avatar Christopher Wipf Committed by Lee McCuller

coatingthermal: dOpt may be a list or a numpy array

parent 877f4c7c
Pipeline #28816 passed with stage
in 57 seconds
...@@ -78,10 +78,10 @@ def getCoatBrownian(f, ifo, wBeam, dOpt): ...@@ -78,10 +78,10 @@ def getCoatBrownian(f, ifo, wBeam, dOpt):
nL = coat.Indexlown nL = coat.Indexlown
# make vectors of material properties # make vectors of material properties
nN = zeros(dOpt.size) nN = zeros(len(dOpt))
yN = zeros(dOpt.size) yN = zeros(len(dOpt))
pratN = zeros(dOpt.size) pratN = zeros(len(dOpt))
phiN = zeros(dOpt.size) phiN = zeros(len(dOpt))
# make simple alternating structure (low-index, high-index doublets) # make simple alternating structure (low-index, high-index doublets)
# (adapted from the more general calculation in # (adapted from the more general calculation in
...@@ -101,7 +101,7 @@ def getCoatBrownian(f, ifo, wBeam, dOpt): ...@@ -101,7 +101,7 @@ def getCoatBrownian(f, ifo, wBeam, dOpt):
phiN[1::2] = phihighn phiN[1::2] = phihighn
# geometrical thickness of each layer and total # geometrical thickness of each layer and total
dGeo = lambda_ * dOpt / nN dGeo = lambda_ * np.asarray(dOpt) / nN
dCoat = sum(dGeo) dCoat = sum(dGeo)
################################### ###################################
...@@ -411,7 +411,7 @@ def getCoatLayers(ifo, dOpt): ...@@ -411,7 +411,7 @@ def getCoatLayers(ifo, dOpt):
nLayer[1::2] = nH nLayer[1::2] = nH
# and geometrical thickness # and geometrical thickness
dLayer = lambda_ * np.array(dOpt) / nLayer dLayer = lambda_ * np.asarray(dOpt) / nLayer
# and sigma correction # and sigma correction
sLayer = zeros(Nlayer) sLayer = zeros(Nlayer)
...@@ -502,7 +502,7 @@ def getCoatTOPhase(nIn, nOut, nLayer, dOpt, aLayer, bLayer, sLayer): ...@@ -502,7 +502,7 @@ def getCoatTOPhase(nIn, nOut, nLayer, dOpt, aLayer, bLayer, sLayer):
rCoat, dcdp = getCoatRefl2(nIn, nOut, nLayer, dOpt)[:2] rCoat, dcdp = getCoatRefl2(nIn, nOut, nLayer, dOpt)[:2]
# geometrical distances # geometrical distances
dGeo = dOpt / nLayer dGeo = np.asarray(dOpt) / nLayer
# phase derivatives # phase derivatives
dphi_dd = 4 * pi * dcdp dphi_dd = 4 * pi * dcdp
...@@ -759,7 +759,7 @@ def getCoatRefl(ifo, dOpt): ...@@ -759,7 +759,7 @@ def getCoatRefl(ifo, dOpt):
nL = pC.Indexlown nL = pC.Indexlown
nH = pC.Indexhighn nH = pC.Indexhighn
Nlayer = dOpt.size Nlayer = len(dOpt)
# refractive index of input, coating, and output materials # refractive index of input, coating, and output materials
nAll = zeros(Nlayer + 2) nAll = zeros(Nlayer + 2)
...@@ -806,10 +806,10 @@ def getCoatRefl2(nIn, nOut, nLayer, dOpt): ...@@ -806,10 +806,10 @@ def getCoatRefl2(nIn, nOut, nLayer, dOpt):
# round-trip phase in each layer # round-trip phase in each layer
ephi[0] = 1 ephi[0] = 1
ephi[1:] = exp(4j * zdir * pi * dOpt) ephi[1:] = exp(4j * zdir * pi * np.asarray(dOpt))
rbar[-1] = ephi[-1] * r[-1] rbar[-1] = ephi[-1] * r[-1]
for n in range(dOpt.size, 0, -1): for n in range(len(dOpt), 0, -1):
# accumulate reflectivity # accumulate reflectivity
rbar[n-1] = ephi[n-1] * (r[n-1] + rbar[n]) / (1 + r[n-1] * rbar[n]) rbar[n-1] = ephi[n-1] * (r[n-1] + rbar[n]) / (1 + r[n-1] * rbar[n])
......
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