Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Duncan Macleod
gstlal
Commits
19df1e50
Commit
19df1e50
authored
7 years ago
by
Chad Hanna
Browse files
Options
Downloads
Patches
Plain Diff
tree.py: disable hacking on the m1=m2 line
parent
17391797
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-ugly/python/tree.py
+15
-15
15 additions, 15 deletions
gstlal-ugly/python/tree.py
with
15 additions
and
15 deletions
gstlal-ugly/python/tree.py
+
15
−
15
View file @
19df1e50
...
...
@@ -16,10 +16,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import
itertools
import
metric
as
metric_module
from
gstlal
import
metric
as
metric_module
import
numpy
from
numpy
import
random
from
scipy.special
import
gamma
from
gstlal.metric
import
DELTA
def
uber_constraint
(
vertices
,
mtotal
=
100
,
ns_spin
=
0.05
):
# Assumes coords are m_1, m2, s1, s2
...
...
@@ -87,20 +88,18 @@ def packing_density(n):
def
mc_m2_singularity
(
c
):
center
=
c
.
copy
()
return
center
F
=
1.
/
2
**
.
2
if
F
*
.
67
<
center
[
0
]
/
center
[
1
]
<=
F
:
center
[
1
]
*=
1.5
if
F
*
1.5
>
center
[
0
]
/
center
[
1
]
>
F
:
center
[
1
]
*=
0.67
if
F
*
.
85
<
center
[
0
]
/
center
[
1
]
<=
F
*
1.176
:
center
[
1
]
=
0.85
*
center
[
0
]
return
center
def
m1_m2_singularity
(
c
):
center
=
c
.
copy
()
return
center
F
=
1.
if
F
*
.
80
<
center
[
0
]
/
center
[
1
]
<=
F
:
center
[
1
]
*=
1.25
if
F
*
1.25
>
center
[
0
]
/
center
[
1
]
>
F
:
center
[
1
]
*=
0.80
if
F
*
.
85
<
center
[
0
]
/
center
[
1
]
<=
F
*
1.176
:
center
[
1
]
=
0.85
*
center
[
0
]
return
center
class
HyperCube
(
object
):
...
...
@@ -127,9 +126,9 @@ class HyperCube(object):
self
.
deltas
=
numpy
.
array
([
c
[
1
]
-
c
[
0
]
for
c
in
boundaries
])
self
.
metric
=
metric
# FIXME don't assume m1 m2 and the spin coords are the coordinates we have here.
deltas
=
1e-6
*
numpy
.
ones
(
len
(
self
.
center
))
deltas
=
DELTA
*
numpy
.
ones
(
len
(
self
.
center
))
#deltas = 5e-7 * numpy.ones(len(self.center))
deltas
[
0
:
2
]
*=
self
.
center
[
0
:
2
]
#
deltas[0:2] *= self.center[0:2]
**2
#deltas[2:] = 1.3e-4
#deltas[2:] = 1.0e-5
self
.
singularity
=
singularity
...
...
@@ -285,15 +284,16 @@ class Node(object):
# get our number of templates
numtmps
=
self
.
cube
.
num_templates
(
mismatch
)
metric_diff
=
self
.
cube
.
metric_tensor
-
self
.
sibling
.
cube
.
metric_tensor
metric_diff
=
numpy
.
linalg
.
norm
(
metric_diff
)
/
numpy
.
linalg
.
norm
(
self
.
cube
.
metric_tensor
)
**
.
5
/
numpy
.
linalg
.
norm
(
self
.
sibling
.
cube
.
metric_tensor
)
**
.
5
metric_diff
=
max
(
abs
((
numtmps
-
sib_numtmps
)
/
(
numtmps
+
sib_numtmps
)
/
2
),
abs
((
numtmps
-
par_numtmps
)
/
(
numtmps
+
par_numtmps
)
/
2
))
#metric_diff = self.cube.metric_tensor - self.sibling.cube.metric_tensor
#metric_diff = numpy.linalg.norm(metric_diff) / numpy.linalg.norm(self.cube.metric_tensor)**.5 / numpy.linalg.norm(self.sibling.cube.metric_tensor)**.5
# take the bigger of self, sibling and parent
numtmps
=
max
(
max
(
numtmps
,
par_numtmps
),
sib_numtmps
)
*
aspect_factor
q
=
self
.
cube
.
center
[
1
]
/
self
.
cube
.
center
[
0
]
metric_tol
=
0.03
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
((
numtmps
>=
split_num_templates
)):
metric_tol
=
0.
0
03
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
((
numtmps
>=
split_num_templates
)
or
(
metric_diff
>
metric_tol
and
numtmps
>=
split_num_templates
/
2.0
)
):
self
.
template_count
[
0
]
=
self
.
template_count
[
0
]
+
1
bifurcation
+=
1
if
metric_diff
<=
metric_tol
:
# and aspect_factor <= 1.0:
...
...
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