Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Minke
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Daniel Williams
Minke
Commits
1a2dc2b5
Verified
Commit
1a2dc2b5
authored
7 years ago
by
Daniel Williams
Committed by
Daniel Williams
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added a new Yakunin class to address #10
parent
3258e243
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
minke/sources.py
+91
-1
91 additions, 1 deletion
minke/sources.py
with
91 additions
and
1 deletion
minke/sources.py
+
91
−
1
View file @
1a2dc2b5
...
...
@@ -992,7 +992,6 @@ class Dimmelmeier08(Supernova):
return
output
class
Ringdown
(
Waveform
):
"""
A class to handle Rindown waveforms.
...
...
@@ -1001,7 +1000,98 @@ class Ringdown(Waveform):
waveform
=
"
GenericRingdown
"
class
Yakunin10
(
Supernova
):
"""
The Yakunin10 waveform.
"""
waveform
=
"
Yakunin+10
"
def
__init__
(
self
,
time
,
sky_dist
=
uniform_sky
,
filepath
=
"
s12-time-rhplus_matter.txt
"
,
decomposed_path
=
None
,
):
"""
Parameters
----------
time : float or list
The time period over which the injection should be made. If
a list is given they should be the start and end times, and
the waveform will be produced at some random point in that
time range. If a float is given then the injection will be
made at that specific time.
sky_dist : func
The function describing the sky distribution which the injections
should be made over. Defaults to a uniform sky.
filepath : str
The filepath to the numerical relativity waveform.
decomposed_path : str
The location where the decomposed waveform file should be stored. Optional.
"""
self
.
_clear_params
()
self
.
time
=
time
self
.
sky_dist
=
sky_dist
if
not
decomposed_path
:
decomposed_path
=
filepath
+
"
.dec
"
if
not
os
.
path
.
isfile
(
decomposed_path
)
:
decomposed
=
self
.
decompose
(
filepath
,
sample_rate
=
16384.0
,
step_back
=
0.01
)
np
.
savetxt
(
decomposed_path
,
decomposed
,
header
=
"
time (2,-2) (2,-1) (2,0) (2,1) (2,2)
"
,
fmt
=
'
%.8e
'
)
self
.
params
[
'
phi
'
]
=
0
self
.
params
[
'
incl
'
]
=
90
self
.
params
[
'
numrel_data
'
]
=
decomposed_path
def
decompose
(
self
,
numrel_file
,
sample_rate
=
16384.0
,
step_back
=
0.01
):
"""
Produce the spherial harmonic decompositions of the Dimmelmeier numerical
waveform. This is a special case since it is axisymmetric.
Parameters
----------
numrel_file : str
The location of the numerical relativity waveform file.
sample_rate : float
The sample rate of the NR file. Defaults to 16384.0 Hz.
step_back : float
The amount of time, in seconds, of the data which should be included
before the peak amplitude. Defaults to 0.01 sec.
Returns
-------
decomposition : ndarray
The l=2 mode spherical decompositions of the waveform.
"""
extract_dist
=
10e-3
# Load the times from the file
data
=
np
.
loadtxt
(
numrel_file
)
data
=
data
.
T
times
=
data
[
0
]
times
-=
times
[
0
]
# Load the hp components
strain
=
data
[
1
]
# Make the new time vector for the requried sample rate
target_times
=
np
.
arange
(
times
[
0
],
times
[
-
1
],
1.0
/
sample_rate
)
# Prepare the output matrix
output
=
np
.
zeros
((
len
(
target_times
),
11
))
# Add the times in to the first column of said matrix
output
[:,
0
]
=
target_times
#/ lal.MTSUN_SI
#
# Resample to uniform spacing at 16384 kHz
#
strain_new
=
self
.
interpolate
(
times
,
strain
,
target_times
)
#
# Make the output, and rescale it into dimensionless strain values
#
output
[:,
5
]
=
strain_new
#/* ( extract_dist * lal.PC_SI * 1.0e6)
return
output
class
LongDuration
(
Supernova
):
"""
...
...
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