Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-slsdetector
Commits
c0fbd343
Commit
c0fbd343
authored
Feb 10, 2021
by
Alejandro Homs Puron
Committed by
operator for beamline
Feb 18, 2021
Browse files
Jungfrau: add det_map with chip identification
parent
7695a1e7
Changes
10
Hide whitespace changes
Inline
Side-by-side
include/SlsDetectorEiger.h
View file @
c0fbd343
...
...
@@ -220,6 +220,8 @@ class Eiger : public Model
virtual
void
getFrameDim
(
FrameDim
&
frame_dim
,
bool
raw
=
false
);
virtual
void
getDetMap
(
Data
&
det_map
);
virtual
std
::
string
getName
();
virtual
void
getPixelSize
(
double
&
x_size
,
double
&
y_size
);
...
...
include/SlsDetectorJungfrau.h
View file @
c0fbd343
...
...
@@ -63,6 +63,8 @@ class Jungfrau : public Model
virtual
void
getFrameDim
(
FrameDim
&
frame_dim
,
bool
raw
=
false
);
virtual
void
getDetMap
(
Data
&
det_map
);
virtual
std
::
string
getName
();
virtual
void
getPixelSize
(
double
&
x_size
,
double
&
y_size
);
...
...
include/SlsDetectorModel.h
View file @
c0fbd343
...
...
@@ -61,6 +61,8 @@ class Model
int
getNbDetModules
()
{
return
m_nb_det_modules
;
}
virtual
void
getDetMap
(
Data
&
det_map
)
=
0
;
virtual
void
setNbUDPInterfaces
(
int
nb_udp_ifaces
);
virtual
void
getNbUDPInterfaces
(
int
&
nb_udp_ifaces
);
...
...
sip/SlsDetectorEiger.sip
View file @
c0fbd343
...
...
@@ -51,6 +51,9 @@ class Eiger : public SlsDetector::Model
Eiger(SlsDetector::Camera *cam);
virtual void getFrameDim(FrameDim& frame_dim /Out/, bool raw = false);
virtual void getDetMap(Data& det_map /Out/);
SlsDetector::Eiger::Correction *createCorrectionTask() /Factory/;
virtual std::string getName();
...
...
sip/SlsDetectorJungfrau.sip
View file @
c0fbd343
...
...
@@ -51,6 +51,8 @@ class Jungfrau : public SlsDetector::Model
virtual void getFrameDim(FrameDim& frame_dim /Out/, bool raw = false);
virtual void getDetMap(Data& det_map /Out/);
SlsDetector::Jungfrau::ImgProcTask *createImgProcTask() /Factory/;
virtual std::string getName();
...
...
sip/SlsDetectorModel.sip
View file @
c0fbd343
...
...
@@ -41,6 +41,8 @@ public:
virtual void getFrameDim(FrameDim& frame_dim /Out/,
bool raw = false) = 0;
virtual void getDetMap(Data& det_map /Out/) = 0;
SlsDetector::Camera *getCamera();
SlsDetector::Type getType();
...
...
slsDetectorPackage
@
942f599e
Compare
0604528d
...
942f599e
Subproject commit
0604528d4ac4a99f8307c4c422d11c1b930957c0
Subproject commit
942f599edfda51283f162edd75808367a960056e
src/SlsDetectorEiger.cpp
View file @
c0fbd343
...
...
@@ -765,6 +765,12 @@ void Eiger::getFrameDim(FrameDim& frame_dim, bool raw)
DEB_RETURN
()
<<
DEB_VAR1
(
frame_dim
);
}
void
Eiger
::
getDetMap
(
Data
&
/*det_map*/
)
{
DEB_MEMBER_FUNCT
();
THROW_HW_ERROR
(
NotSupported
)
<<
"DetMap not implemented yet"
;
}
string
Eiger
::
getName
()
{
DEB_MEMBER_FUNCT
();
...
...
src/SlsDetectorJungfrau.cpp
View file @
c0fbd343
...
...
@@ -411,6 +411,48 @@ int Jungfrau::getModuleDataOffset(int idx, bool raw)
return
data_offset
;
}
void
Jungfrau
::
getDetMap
(
Data
&
det_map
)
{
DEB_MEMBER_FUNCT
();
bool
raw
;
getCamera
()
->
getRawMode
(
raw
);
FrameDim
frame_dim
;
getFrameDim
(
frame_dim
,
raw
);
Buffer
*
b
=
new
Buffer
(
frame_dim
.
getMemSize
()
*
2
);
det_map
.
type
=
Data
::
UINT32
;
Size
size
=
frame_dim
.
getSize
();
std
::
vector
<
int
>
dims
=
{
size
.
getWidth
(),
size
.
getHeight
()};
det_map
.
dimensions
=
dims
;
det_map
.
setBuffer
(
b
);
b
->
unref
();
DEB_ALWAYS
()
<<
DEB_VAR1
(
det_map
.
size
());
auto
f
=
[
&
](
auto
det_geom
)
{
using
namespace
sls
::
Geom
;
// gap pixels are set to -1
unsigned
int
*
p
=
(
unsigned
int
*
)
det_map
.
data
();
memset
(
p
,
0xff
,
det_map
.
size
());
int
chip_idx
=
0
;
det_for_each_mod
(
det_geom
,
mod
,
mod_geom
,
mod_for_each_recv
(
mod_geom
,
recv
,
recv_geom
,
recv_for_each_iface
(
recv_geom
,
iface
,
iface_geom
,
iface_for_each_chip
(
iface_geom
,
chip
,
chip_view
,
view_for_each_pixel
(
chip_view
,
pixel
,
int
i
=
chip_view
.
calcMapPixelIndex
(
pixel
);
p
[
i
]
=
chip_idx
;
);
++
chip_idx
;
);
);
);
);
};
applyDetGeom
(
this
,
f
,
raw
);
DEB_ALWAYS
()
<<
DEB_VAR1
(
det_map
);
}
string
Jungfrau
::
getName
()
{
DEB_MEMBER_FUNCT
();
...
...
tango/SlsDetector.py
View file @
c0fbd343
...
...
@@ -509,6 +509,11 @@ class SlsDetector(PyTango.Device_4Impl):
self
.
printPixelDepthCPUAffinityMap
(
aff_map
)
self
.
cam
.
setPixelDepthCPUAffinityMap
(
aff_map
)
@
Core
.
DEB_MEMBER_FUNCT
def
read_det_map
(
self
,
attr
):
det_map
=
self
.
model
.
getDetMap
();
attr
.
set_value
(
det_map
.
buffer
)
@
Core
.
DEB_MEMBER_FUNCT
def
read_jungfrau_gain_map
(
self
,
attr
):
jungfrau
=
_SlsDetectorJungfrau
...
...
@@ -688,6 +693,10 @@ class SlsDetectorClass(PyTango.DeviceClass):
[[
PyTango
.
DevULong
,
PyTango
.
SPECTRUM
,
PyTango
.
READ
,
64
]],
'det_map'
:
[[
PyTango
.
DevULong
,
PyTango
.
IMAGE
,
PyTango
.
READ
,
8192
,
8192
]],
'jungfrau_gain_map'
:
[[
PyTango
.
DevUChar
,
PyTango
.
IMAGE
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment