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
b816be12
Commit
b816be12
authored
11 months ago
by
Egor Sobolev
Committed by
Philipp Schmidt
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add ShimadzuHVX2 conditions and detector abstraction
parent
de7ef3e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!939
[Generic][Shimadzu] Dynamic flat-field characterization and correction for MHz microscopy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cal_tools/shimadzu.py
+52
-0
52 additions, 0 deletions
src/cal_tools/shimadzu.py
with
52 additions
and
0 deletions
src/cal_tools/shimadzu.py
0 → 100644
+
52
−
0
View file @
b816be12
from
dataclasses
import
dataclass
from
cal_tools.calcat_interface2
import
ConditionsBase
@dataclass
class
ShimadzuHPVX2Conditions
(
ConditionsBase
):
frame_size
:
float
calibration_types
=
{
"
Offset
"
:
[
"
Frame Size
"
],
"
DynamicFF
"
:
[
"
Frame Size
"
],
}
class
ShimadzuHPVX2
:
channel
=
"
daqOutput
"
image_key
=
"
data.image.pixels
"
def
__init__
(
self
,
source_name_pattern
:
str
,
channel
=
None
,
image_key
=
None
):
self
.
source_name_pattern
=
source_name_pattern
if
channel
is
not
None
:
self
.
channel
=
channel
if
image_key
is
not
None
:
self
.
image_key
=
image_key
self
.
image_index_group
=
self
.
image_key
.
partition
(
'
.
'
)[
0
]
self
.
instrument
=
source_name_pattern
.
split
(
'
_
'
)[
0
]
def
conditions
(
self
,
dc
:
"
DataCollection
"
,
module
=
None
):
# noqa: F821
if
module
is
None
:
source_pattern
=
self
.
source_name_pattern
.
format
(
f
"
*:
{
self
.
channel
}
"
)
det_dc
=
dc
.
select
(
source_pattern
)
if
not
det_dc
.
instrument_sources
:
raise
ValueError
(
"
No detector sources are found
"
)
source_name
=
list
(
det_dc
.
instrument_sources
)[
0
]
else
:
source_name
=
self
.
instrument_source
(
module
)
keydata
=
dc
[
source_name
,
self
.
image_key
]
num_frames
=
keydata
.
shape
[
-
3
]
return
ShimadzuHPVX2Conditions
(
frame_size
=
num_frames
/
256
)
def
instrument_source
(
self
,
module
:
int
):
source_name
=
self
.
source_name_pattern
.
format
(
module
)
return
f
"
{
source_name
}
:
{
self
.
channel
}
"
def
corrected_source
(
self
,
module
:
int
):
source_name
=
self
.
source_name_pattern
.
format
(
module
)
parts
=
source_name
.
split
(
'
/
'
)
parts
[
1
]
=
"
CORR
"
source_name
=
'
/
'
.
join
(
parts
)
return
f
"
{
source_name
}
:output
"
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