Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
pykat
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
finesse
pykat
Commits
e9ce2b6f
Commit
e9ce2b6f
authored
Mar 06, 2018
by
Daniel Toyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added conditioned printing to adv-tools
parent
6cbd2f79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
pykat/ifo/adv/__init__.py
pykat/ifo/adv/__init__.py
+12
-8
No files found.
pykat/ifo/adv/__init__.py
View file @
e9ce2b6f
...
...
@@ -884,7 +884,7 @@ class ADV_IFO(IFO):
def
find_maxtem
(
self
,
tol
=
5e-3
,
verbose
=
False
):
def
find_maxtem
(
self
,
tol
=
5e-3
,
start
=
0
,
stop
=
10
,
verbose
=
False
):
'''
Finding the minimum required maxtem for the power to converge to within the relative tolerance tol.
'''
...
...
@@ -899,7 +899,8 @@ class ADV_IFO(IFO):
P
=
np
.
zeros
(
3
,
dtype
=
float
)
+
1e-9
rdiff
=
np
.
ones
([
2
,
3
],
dtype
=
float
)
mxtm
=
0
while
run
:
while
run
and
mxtm
<=
stop
:
vprint
(
verbose
,
mxtm
,
": "
)
P_old
[
0
,:]
=
P_old
[
1
,:]
P_old
[
1
,:]
=
P
rdiff_old
=
rdiff
[
1
,:]
...
...
@@ -911,15 +912,18 @@ class ADV_IFO(IFO):
rdiff
=
np
.
abs
((
P
-
P_old
)
/
P_old
)
if
rdiff
.
max
()
<
tol
:
run
=
False
vprint
(
verbose
,
"{0[0]:.2e} {0[1]:.2e} {0[2]:.2e}"
.
format
(
rdiff
[
1
,:]))
# print(kat1.maxtem, rdiff, rdiff.max())
mxtm
+=
1
# Stepping back to the lowest acceptable maxtem
mxtm
-=
2
# One more step back if the two previous iterations were within the tolerance
if
rdiff_old
.
max
()
<
tol
:
mxtm
-=
1
if
not
run
:
# Stepping back to the lowest acceptable maxtem
mxtm
-=
2
# One more step back if the two previous iterations were within the tolerance
if
rdiff_old
.
max
()
<
tol
:
mxtm
-=
1
self
.
kat
.
maxtem
=
mxtm
vprint
(
verbose
,
"Maxtem set to {}"
.
format
(
mxtm
))
vprint
(
verbose
,
"
\n
Maxtem set to {}"
.
format
(
mxtm
))
def
find_warm_detector
(
self
,
mirror_list
,
DCoffset
,
verbose
=
False
):
...
...
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