Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pygwinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lee McCuller
pygwinc
Commits
abaa3bd3
Commit
abaa3bd3
authored
6 years ago
by
Jameson Graef Rollins
Browse files
Options
Downloads
Patches
Plain Diff
rename precomp module and cleanup
clarify PRFixed to be bool and True by default
parent
d6bb4c2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
gwinc/__init__.py
+1
-1
1 addition, 1 deletion
gwinc/__init__.py
gwinc/__main__.py
+1
-0
1 addition, 0 deletions
gwinc/__main__.py
gwinc/gwinc.py
+3
-3
3 additions, 3 deletions
gwinc/gwinc.py
gwinc/precomp.py
+9
-12
9 additions, 12 deletions
gwinc/precomp.py
with
14 additions
and
16 deletions
gwinc/__init__.py
+
1
−
1
View file @
abaa3bd3
from
.ifo
import
load_ifo
from
.
util
import
precompIFO
from
.
precomp
import
precompIFO
from
.gwinc
import
noise_calc
from
.gwinc
import
gwinc
from
.plot
import
plot_noise
This diff is collapsed.
Click to expand it.
gwinc/__main__.py
+
1
−
0
View file @
abaa3bd3
...
...
@@ -8,6 +8,7 @@ import logging
logging
.
basicConfig
(
level
=
logging
.
INFO
)
from
.ifo
import
available_ifos
,
load_ifo
from
.precomp
import
precompIFO
from
.
import
plot_noise
##################################################
...
...
This diff is collapsed.
Click to expand it.
gwinc/gwinc.py
+
3
−
3
View file @
abaa3bd3
...
...
@@ -3,7 +3,7 @@ import numpy as np
from
numpy
import
log10
,
pi
,
sqrt
import
copy
from
.
util
import
precompIFO
from
.
precomp
import
precompIFO
from
.
import
noise
from
.
import
plot
...
...
@@ -115,8 +115,8 @@ def gwinc(freq, ifoin, source=None, fig=False):
ifo
=
copy
.
deepcopy
(
ifoin
)
modeSR
=
0
PRfixed
=
0
modeSR
=
False
PRfixed
=
True
# stick it into the IFO so that it gets passed around
ifo
.
modeSR
=
modeSR
...
...
This diff is collapsed.
Click to expand it.
gwinc/
util
.py
→
gwinc/
precomp
.py
+
9
−
12
View file @
abaa3bd3
from
__future__
import
division
,
print_function
from
__future__
import
division
from
numpy
import
pi
,
sqrt
from
scipy.io.matlab.mio5_params
import
mat_struct
from
scipy.io
import
loadmat
import
scipy.special
import
logging
from
.struct
import
Struct
from
.noise.coatingthermal
import
getCoatDopt
def
precompIFO
(
ifo
,
PRfixed
=
0
):
def
precompIFO
(
ifo
,
PRfixed
=
True
):
"""
Add precomputed data to the IFO model.
To prevent recomputation of these precomputed data, if the
ifo argument contains ifo.gwinc.PRfixed, and this matches
the argument PRfixed, no changes are made.
"""
# check PRfixed
#if 'gwinc' in ifo.__dict__:
# && isfield(ifo.gwinc, 'PRfixed') && ifo.gwinc.PRfixed == PRfixed
#return
ifo
.
gwinc
=
mat_struct
()
if
'
gwinc
'
not
in
ifo
:
ifo
.
gwinc
=
Struct
()
ifo
.
gwinc
.
PRfixed
=
PRfixed
################################# DERIVED TEMP
...
...
@@ -47,7 +44,7 @@ def precompIFO(ifo, PRfixed=0):
dL
=
ifo
.
Optics
.
ETM
.
CoatingThicknessLown
dCap
=
ifo
.
Optics
.
ETM
.
CoatingThicknessCap
ifo
.
Optics
.
ETM
.
CoatLayerOpticalThickness
=
getCoatDopt
(
ifo
,
T
,
dL
,
dCap
=
dCap
)
# compute power on BS
pbs
,
parm
,
finesse
,
prfactor
,
Tpr
=
precompPower
(
ifo
,
PRfixed
)
ifo
.
gwinc
.
pbs
=
pbs
...
...
@@ -82,7 +79,7 @@ def precompIFO(ifo, PRfixed=0):
return
ifo
def
precompPower
(
ifo
,
PRfixed
):
def
precompPower
(
ifo
,
PRfixed
=
True
):
"""
Compute power on beamsplitter and finesse and power recycling factor.
"""
...
...
@@ -114,7 +111,7 @@ def precompPower(ifo, PRfixed):
garm
=
t1
/
(
1
-
r1
*
r2
*
sqrt
(
1
-
2
*
loss
))
# amplitude gain wrt input field
rarm
=
r1
-
t1
*
r2
*
sqrt
(
1
-
2
*
loss
)
*
garm
if
(
PRfixed
==
1
)
:
if
PRfixed
:
Tpr
=
ifo
.
Optics
.
PRM
.
Transmittance
# use given value
else
:
#prfactor = 1/(2*loss * neff + bsloss); % power recycling factor
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment