Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
baa8373f
There was a problem fetching the pipeline summary.
Commit
baa8373f
authored
Dec 6, 2016
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
adding utility functions to aLIGO
parent
94b579d9
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/GWdetectors/aLIGO.py
+44
-3
44 additions, 3 deletions
pykat/GWdetectors/aLIGO.py
with
44 additions
and
3 deletions
pykat/GWdetectors/aLIGO.py
+
44
−
3
View file @
baa8373f
...
...
@@ -3,19 +3,49 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
unicode_literals
#import pykat.exceptions as pkex
import
numpy
as
np
import
math
import
copy
import
warnings
import
cmath
import
pykat.components
import
pykat.exceptions
as
pkex
nsilica
=
1.44963098985906
#class aLIGO():
class
aLIGO
(
object
):
def
__init__
(
self
,
_name
=
"
default
"
):
names
=
[
'
default
'
,
'
LLO
'
,
'
LHO
'
]
if
_name
not
in
names
:
printf
(
"
aLIGO name `{}
'
not recognised, must be
'
default
'
,
'
LLO
'
or
'
LHO
'"
,
_name
)
def
make_transparent
(
kat
,
_components
):
"""
Function to make certain mirror or beamsplitter objects transparent
Usage:
make_transparent(kat,
"
PRM
"
)
or
make_transparent(kat, [
"
PRM
"
,
"
SRM
"
])
The function modifies the kat object. Use something like
kat = copy.deepcopy(basekat)
before if you want to preseve the original kat object
"""
components
=
make_list_copy
(
_components
)
for
o
in
kat
.
components
.
values
():
if
o
.
name
in
components
:
if
isinstance
(
o
,
pykat
.
components
.
AbstractMirrorComponent
):
o
.
setRTL
(
0.0
,
1.0
,
0.0
)
components
=
[
c
for
c
in
components
if
c
!=
o
.
name
]
else
:
raise
pkex
.
BasePyKatException
(
"
{} is not a mirror or beamsplitter
"
.
format
(
o
))
print
(
'
Made {} transparent,
'
.
format
(
o
))
if
len
(
components
)
!=
0
:
raise
pkex
.
BasePyKatException
(
"
Cannot find component {}
"
.
format
(
components
))
return
kat
def
BSpath
(
thickness
,
n
=
nsilica
,
angle
=
45.0
):
def
BS
_optical_
path
(
thickness
,
n
=
nsilica
,
angle
=
45.0
):
"""
Compute optical path length in BS substrate, default
parameters assume angle of incidence of 45 deg and fused
...
...
@@ -29,3 +59,14 @@ def BSpath(thickness, n=nsilica, angle=45.0):
L
=
thickness
/
math
.
cos
(
angle_subst
)
return
math
.
degrees
(
angle_subst
),
L
def
make_list_copy
(
_l
):
"""
Utility function, takes a list of strings or single string
and returns a copy of a list, e.g.
"
string
"
copy to [
"
string
"
]
[
"
string1
"
,
"
string2
"
] copy to [
"
string1
"
,
"
string2
"
]
"""
if
not
isinstance
(
_l
,
list
):
_l
=
[
_l
]
return
_l
[:]
# copy the list, just to be save
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