Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
1a9a2705
Commit
1a9a2705
authored
5 years ago
by
Steffen Hauf
Browse files
Options
Downloads
Patches
Plain Diff
Adress feedback from review
parent
9e54f77a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!79
Propagate backlog of cal_tools related changes from production system as of 06/2019
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cal_tools/cal_tools/agipdlib.py
+7
-7
7 additions, 7 deletions
cal_tools/cal_tools/agipdlib.py
cal_tools/cal_tools/lpdlib.py
+4
-5
4 additions, 5 deletions
cal_tools/cal_tools/lpdlib.py
with
11 additions
and
12 deletions
cal_tools/cal_tools/agipdlib.py
+
7
−
7
View file @
1a9a2705
...
@@ -2,14 +2,15 @@ import copy
...
@@ -2,14 +2,15 @@ import copy
from
enum
import
Enum
from
enum
import
Enum
import
h5py
import
h5py
import
numpy
as
np
from
cal_tools.enums
import
BadPixels
from
cal_tools.tools
import
get_constant_from_db
,
get_constant_from_db_and_time
from
iCalibrationDB
import
Constants
,
Conditions
,
Detectors
from
iCalibrationDB
import
Constants
,
Conditions
,
Detectors
import
numpy
as
np
from
scipy.signal
import
cwt
,
ricker
from
scipy.signal
import
cwt
,
ricker
from
sklearn.mixture
import
GaussianMixture
from
sklearn.mixture
import
GaussianMixture
from
sklearn.preprocessing
import
StandardScaler
from
sklearn.preprocessing
import
StandardScaler
from
cal_tools.enums
import
BadPixels
from
cal_tools.tools
import
get_constant_from_db
,
get_constant_from_db_and_time
def
get_num_cells
(
fname
,
loc
,
module
):
def
get_num_cells
(
fname
,
loc
,
module
):
with
h5py
.
File
(
fname
,
"
r
"
)
as
f
:
with
h5py
.
File
(
fname
,
"
r
"
)
as
f
:
...
@@ -1125,7 +1126,6 @@ class AgipdCorrections:
...
@@ -1125,7 +1126,6 @@ class AgipdCorrections:
single_image
.
shape
[
2
])
single_image
.
shape
[
2
])
self
.
firange
=
firange
self
.
firange
=
firange
self
.
single_image
=
single_image
self
.
single_image
=
single_image
self
.
can_calibrate
=
can_calibrate
def
copy_and_sanitize_non_cal_data
(
self
):
def
copy_and_sanitize_non_cal_data
(
self
):
"""
Copy and sanitize data in `infile` that is not touched by
"""
Copy and sanitize data in `infile` that is not touched by
...
@@ -1142,7 +1142,7 @@ class AgipdCorrections:
...
@@ -1142,7 +1142,7 @@ class AgipdCorrections:
firange
=
firange
[
0
::
2
]
firange
=
firange
[
0
::
2
]
alltrains
=
self
.
infile
[
agipd_base
+
"
image/trainId
"
]
alltrains
=
self
.
infile
[
agipd_base
+
"
image/trainId
"
]
alltrains
=
np
.
squeeze
(
alltrains
=
np
.
squeeze
(
alltrains
[
first_index
:
last_index
,
...])
# [self.can_calibrate]
alltrains
[
first_index
:
last_index
,
...])
# these are touched in the correct function, do not copy them here
# these are touched in the correct function, do not copy them here
dont_copy
=
[
"
data
"
,
"
cellId
"
,
"
trainId
"
,
"
pulseId
"
,
"
status
"
,
dont_copy
=
[
"
data
"
,
"
cellId
"
,
"
trainId
"
,
"
pulseId
"
,
"
status
"
,
...
@@ -1471,8 +1471,8 @@ class AgipdCorrections:
...
@@ -1471,8 +1471,8 @@ class AgipdCorrections:
photon_energy
,
photon_energy
,
pixels_x
=
512
,
pixels_x
=
512
,
pixels_y
=
128
,
pixels_y
=
128
,
beam_energy
=
None
),
beam_energy
=
None
),
# noqa
# noqa
np
.
ones
((
128
,
512
,
max_cells_db
,
2
)),
np
.
ones
((
128
,
512
,
max_cells_db
,
2
)),
cal_db_interface
,
cal_db_interface
,
creation_time
=
creation_time
,
creation_time
=
creation_time
,
...
...
This diff is collapsed.
Click to expand it.
cal_tools/cal_tools/lpdlib.py
+
4
−
5
View file @
1a9a2705
...
@@ -93,11 +93,11 @@ class LpdCorrections:
...
@@ -93,11 +93,11 @@ class LpdCorrections:
# emprically determined from APD datasets p900038, r155,r156
# emprically determined from APD datasets p900038, r155,r156
self
.
cnl_const
=
{
self
.
cnl_const
=
{
'
high
'
:
{
'
A
'
:
-
0.000815934
,
'
lam
'
:
0.00811281
,
'
c
'
:
1908.89
,
'
high
'
:
{
'
A
'
:
-
0.000815934
,
'
lam
'
:
0.00811281
,
'
c
'
:
1908.89
,
'
m
'
:
0
,
'
b
'
:
0
},
# noqa
'
m
'
:
0
,
'
b
'
:
0
},
'
med
'
:
{
'
A
'
:
0.0999894
,
'
lam
'
:
-
0.00137652
,
'
c
'
:
3107.83
,
'
med
'
:
{
'
A
'
:
0.0999894
,
'
lam
'
:
-
0.00137652
,
'
c
'
:
3107.83
,
'
m
'
:
3.89982e-06
,
'
b
'
:
-
0.116811
},
# noqa
'
m
'
:
3.89982e-06
,
'
b
'
:
-
0.116811
},
'
low
'
:
{
'
A
'
:
0.0119132
,
'
lam
'
:
-
0.0002
,
'
c
'
:
36738.6
,
'
low
'
:
{
'
A
'
:
0.0119132
,
'
lam
'
:
-
0.0002
,
'
c
'
:
36738.6
,
'
m
'
:
2.00273e-08
,
'
b
'
:
0.245537
}}
# noqa
'
m
'
:
2.00273e-08
,
'
b
'
:
0.245537
}}
def
get_iteration_range
(
self
):
def
get_iteration_range
(
self
):
"""
Returns a range expression over which to iterate in chunks
"""
Returns a range expression over which to iterate in chunks
...
@@ -662,8 +662,7 @@ class LpdCorrections:
...
@@ -662,8 +662,7 @@ class LpdCorrections:
pixels_x
=
256
,
pixels_x
=
256
,
pixels_y
=
256
,
pixels_y
=
256
,
beam_energy
=
None
,
beam_energy
=
None
,
capacitor
=
capacitor
),
capacitor
=
capacitor
),
# noqa
# noqa
np
.
ones
((
256
,
256
)),
np
.
ones
((
256
,
256
)),
cal_db_interface
,
cal_db_interface
,
creation_time
=
creation_time
,
creation_time
=
creation_time
,
...
...
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