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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
5b47eae8
Commit
5b47eae8
authored
10 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
adding worst error to EI object, also fixing parsing for pd, qnoised and qshots
parent
32391cdc
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/test_fsig.py
+7
-6
7 additions, 6 deletions
bin/test_fsig.py
pykat/SIfloat.py
+6
-1
6 additions, 1 deletion
pykat/SIfloat.py
pykat/detectors.py
+21
-3
21 additions, 3 deletions
pykat/detectors.py
pykat/optics/romhom.py
+3
-2
3 additions, 2 deletions
pykat/optics/romhom.py
with
37 additions
and
12 deletions
bin/test_fsig.py
+
7
−
6
View file @
5b47eae8
...
@@ -15,16 +15,17 @@ m m2 0.99 0.01 -0.1 n3 n4
...
@@ -15,16 +15,17 @@ m m2 0.99 0.01 -0.1 n3 n4
attr m2 m 1 # mech sus1
attr m2 m 1 # mech sus1
ad up_refl
0
n1
ad up_refl
$fs
n1
ad low_refl
0
n1
ad low_refl
$fs
n1
qd refl_A 0 0 n1
qd refl_A 0 0 n1
qd refl_Q 0 90 n1
qd refl_Q 0 90 n1
qd tran_A 0 0 n4
qd tran_A 0 0 n4
qd tran_Q 0 90 n4
qd tran_Q 0 90 n4
put up_refl f $x1
qnoised qnd 1 $fs max n4
put low_refl f $mx1
qshot qsd 1 $fs max n4
pd1 p1 $fs max n4
yaxis log re:im
yaxis log re:im
...
@@ -47,10 +48,10 @@ a_up = out.y[:,0] + out.y[:,1]*1j
...
@@ -47,10 +48,10 @@ a_up = out.y[:,0] + out.y[:,1]*1j
a_lo
=
out
.
y
[:,
2
]
+
out
.
y
[:,
3
]
*-
1j
a_lo
=
out
.
y
[:,
2
]
+
out
.
y
[:,
3
]
*-
1j
pl
.
figure
(
1
)
pl
.
figure
(
1
)
pl
.
loglog
(
out
.
x
,
np
.
abs
(
a_up
+
a_lo
),
out
.
x
,
np
.
abs
((
a_up
-
a_lo
)
/
(
1j
))
)
pl
.
loglog
(
out
.
x
,
out
[
"
p1
"
]
)
pl
.
xlabel
(
out
.
xlabel
)
pl
.
xlabel
(
out
.
xlabel
)
pl
.
title
(
"
Reflection quadratures with no relative carrier phase
"
)
pl
.
title
(
"
Reflection quadratures with no relative carrier phase
"
)
pl
.
legend
([
"
Amplitude
"
,
"
Phase
"
])
pl
.
legend
([
"
Amplitude
"
,
"
Phase
"
])
#
pl.show()
pl
.
show
()
kat
.
remove
(
kat
.
signals
)
kat
.
remove
(
kat
.
signals
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pykat/SIfloat.py
+
6
−
1
View file @
5b47eae8
...
@@ -25,8 +25,13 @@ __suffix = {'y': 'e-24', # yocto
...
@@ -25,8 +25,13 @@ __suffix = {'y': 'e-24', # yocto
'
P
'
:
'
e15
'
# peta
'
P
'
:
'
e15
'
# peta
}
}
__exceptions
=
[
"
$fs
"
,
"
$mfs
"
]
def
SIfloat
(
value
):
def
SIfloat
(
value
):
if
value
==
None
:
if
value
is
None
:
return
value
if
value
in
__exceptions
:
return
value
return
value
value
=
np
.
array
(
value
)
value
=
np
.
array
(
value
)
...
...
This diff is collapsed.
Click to expand it.
pykat/detectors.py
+
21
−
3
View file @
5b47eae8
...
@@ -597,7 +597,13 @@ class pd(Detector1):
...
@@ -597,7 +597,13 @@ class pd(Detector1):
alt_str
=
"
*
"
alt_str
=
"
*
"
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
self
.
__getattribute__
(
"
f
"
+
str
(
n
))))
_f
=
self
.
__getattribute__
(
"
f
"
+
str
(
n
))
if
_f
==
"
$fs
"
:
fphi_str
+=
"
$fs
"
else
:
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
_f
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
if
phi_val
!=
None
:
if
phi_val
!=
None
:
...
@@ -703,7 +709,13 @@ class qnoised(pd):
...
@@ -703,7 +709,13 @@ class qnoised(pd):
alt_str
=
"
*
"
alt_str
=
"
*
"
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
self
.
__getattribute__
(
"
f
"
+
str
(
n
))))
_f
=
self
.
__getattribute__
(
"
f
"
+
str
(
n
))
if
_f
==
"
$fs
"
:
fphi_str
+=
"
$fs
"
else
:
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
_f
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
if
phi_val
!=
None
:
if
phi_val
!=
None
:
...
@@ -795,7 +807,13 @@ class qshot(pd):
...
@@ -795,7 +807,13 @@ class qshot(pd):
alt_str
=
"
*
"
alt_str
=
"
*
"
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
for
n
in
range
(
1
,
1
+
self
.
num_demods
):
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
self
.
__getattribute__
(
"
f
"
+
str
(
n
))))
_f
=
self
.
__getattribute__
(
"
f
"
+
str
(
n
))
if
_f
==
"
$fs
"
:
fphi_str
+=
"
$fs
"
else
:
fphi_str
+=
"
{0:.16g}
"
.
format
(
float
(
_f
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
phi_val
=
self
.
__getattribute__
(
"
phi
"
+
str
(
n
))
if
phi_val
!=
None
:
if
phi_val
!=
None
:
...
...
This diff is collapsed.
Click to expand it.
pykat/optics/romhom.py
+
3
−
2
View file @
5b47eae8
...
@@ -22,7 +22,7 @@ from scipy.integrate import newton_cotes
...
@@ -22,7 +22,7 @@ from scipy.integrate import newton_cotes
from
multiprocessing
import
Process
,
Queue
,
Array
,
Value
,
Event
from
multiprocessing
import
Process
,
Queue
,
Array
,
Value
,
Event
EmpiricalInterpolant
=
collections
.
namedtuple
(
'
EmpiricalInterpolant
'
,
'
B nodes node_indices limits x
'
)
EmpiricalInterpolant
=
collections
.
namedtuple
(
'
EmpiricalInterpolant
'
,
'
B nodes node_indices limits x
worst_error
'
)
ReducedBasis
=
collections
.
namedtuple
(
'
ReducedBasis
'
,
'
RB limits x
'
)
ReducedBasis
=
collections
.
namedtuple
(
'
ReducedBasis
'
,
'
RB limits x
'
)
ROMLimits
=
collections
.
namedtuple
(
'
ROMLimits
'
,
'
zmin zmax w0min w0max R mapSamples max_order
'
)
ROMLimits
=
collections
.
namedtuple
(
'
ROMLimits
'
,
'
zmin zmax w0min w0max R mapSamples max_order
'
)
...
@@ -795,7 +795,8 @@ def MakeROMFromHDF5(hdf5Filename, greedyFilename=None, EIFilename=None, tol=1e-1
...
@@ -795,7 +795,8 @@ def MakeROMFromHDF5(hdf5Filename, greedyFilename=None, EIFilename=None, tol=1e-1
nodes
=
np
.
array
(
x_nodes
).
squeeze
(),
nodes
=
np
.
array
(
x_nodes
).
squeeze
(),
node_indices
=
np
.
array
(
EI_indices
).
squeeze
(),
node_indices
=
np
.
array
(
EI_indices
).
squeeze
(),
limits
=
limits
,
limits
=
limits
,
x
=
x
.
squeeze
())
x
=
x
.
squeeze
(),
worst_error
=
worst_error
)
if
EIFilename
is
not
None
:
if
EIFilename
is
not
None
:
with
open
(
"
%s.p
"
%
EIFilename
,
'
wb
'
)
as
f
:
with
open
(
"
%s.p
"
%
EIFilename
,
'
wb
'
)
as
f
:
...
...
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