Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
bilby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
12
Merge Requests
12
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
bilby
Commits
d53208e8
Commit
d53208e8
authored
May 17, 2018
by
Moritz Huebner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moritz Huebner: Sped up code by checking which mode is needed in get_sampling_frequency
parent
469c5ee5
Pipeline
#19469
passed with stages
in 5 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
tupak/utils.py
tupak/utils.py
+15
-14
No files found.
tupak/utils.py
View file @
d53208e8
...
...
@@ -246,23 +246,24 @@ def get_polarization_tensor(ra, dec, time, psi, mode):
v
=
np
.
array
([
-
np
.
sin
(
phi
),
np
.
cos
(
phi
),
0
])
m
=
-
u
*
np
.
sin
(
psi
)
-
v
*
np
.
cos
(
psi
)
n
=
-
u
*
np
.
cos
(
psi
)
+
v
*
np
.
sin
(
psi
)
omega
=
np
.
cross
(
m
,
n
)
polarization_tensors
=
{
"plus"
:
np
.
einsum
(
'i,j->ij'
,
m
,
m
)
-
np
.
einsum
(
'i,j->ij'
,
n
,
n
),
"cross"
:
np
.
einsum
(
'i,j->ij'
,
m
,
n
)
+
np
.
einsum
(
'i,j->ij'
,
n
,
m
),
"breathing"
:
np
.
einsum
(
'i,j->ij'
,
m
,
m
)
+
np
.
einsum
(
'i,j->ij'
,
n
,
n
),
"longitudinal"
:
np
.
sqrt
(
2
)
*
np
.
einsum
(
'i,j->ij'
,
omega
,
omega
),
"x"
:
np
.
einsum
(
'i,j->ij'
,
m
,
omega
)
+
np
.
einsum
(
'i,j->ij'
,
omega
,
m
),
"y"
:
np
.
einsum
(
'i,j->ij'
,
n
,
omega
)
+
np
.
einsum
(
'i,j->ij'
,
omega
,
n
)
}
if
mode
in
polarization_tensors
.
keys
():
polarization_tensor
=
polarization_tensors
[
mode
]
if
mode
.
lower
()
==
'plus'
:
return
np
.
einsum
(
'i,j->ij'
,
m
,
m
)
-
np
.
einsum
(
'i,j->ij'
,
n
,
n
)
elif
mode
.
lower
()
==
'cross'
:
return
np
.
einsum
(
'i,j->ij'
,
m
,
n
)
+
np
.
einsum
(
'i,j->ij'
,
n
,
m
)
elif
mode
.
lower
()
==
'breathing'
:
return
np
.
einsum
(
'i,j->ij'
,
m
,
m
)
+
np
.
einsum
(
'i,j->ij'
,
n
,
n
)
omega
=
np
.
cross
(
m
,
n
)
if
mode
.
lower
()
==
'longitudinal'
:
return
np
.
sqrt
(
2
)
*
np
.
einsum
(
'i,j->ij'
,
omega
,
omega
)
elif
mode
.
lower
()
==
'x'
:
return
np
.
einsum
(
'i,j->ij'
,
m
,
omega
)
+
np
.
einsum
(
'i,j->ij'
,
omega
,
m
)
elif
mode
.
lower
()
==
'y'
:
return
np
.
einsum
(
'i,j->ij'
,
n
,
omega
)
+
np
.
einsum
(
'i,j->ij'
,
omega
,
n
)
else
:
logging
.
warning
(
"{} not a polarization mode!"
.
format
(
mode
))
polarization_tensor
=
None
return
polarization_tensor
return
None
def
get_vertex_position_geocentric
(
latitude
,
longitude
,
elevation
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment