Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cfel_fmt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
dataAnalysis
cfel_fmt
Commits
79be8de3
Commit
79be8de3
authored
6 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Patches
Plain Diff
Added radial maps to default pixel maps
parent
76224d15
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cfelpyutils/geometry_utils.py
+28
-6
28 additions, 6 deletions
cfelpyutils/geometry_utils.py
with
28 additions
and
6 deletions
cfelpyutils/geometry_utils.py
+
28
−
6
View file @
79be8de3
...
...
@@ -28,15 +28,18 @@ import numpy
PixelMaps
=
collections
.
namedtuple
(
# pylint: disable=C0103
typename
=
'
PixelMaps
'
,
field_names
=
[
'
x
'
,
'
y
'
,
'
r
'
]
field_names
=
[
'
x
'
,
'
y
'
,
'
z
'
,
'
r
'
,
'
phi
'
]
)
"""
Pixel maps storing geometry information.
The first two fields, named
"
x
"
and
"
y
"
respectively, store the pixel
maps for the x coordinate and the y coordinate. The third field,
named
"
r
"
, is instead a pixel map storing the distance of each
pixel in the data array from the center of the reference system.
The first three fields, named
"
x
"
"
y
"
and
"
z
"
respectively, store the
pixel maps for the x,the y and the z coordinates. The fourth field,
named
"
r
"
, is a pixel map storing the distance of each pixel in the
data array from the center of the reference system. The fifth field,
'
phi
'
, is instead a pixel map that stores the angles that vectors
connecting each pixel with the center of the reference system make with
respect to the x axis of the reference system.
"""
...
...
@@ -82,10 +85,21 @@ def compute_pix_maps(geometry):
dtype
=
numpy
.
float32
# pylint: disable=E1101
)
z_map
=
numpy
.
zeros
(
shape
=
(
max_ss_in_slab
+
1
,
max_fs_in_slab
+
1
),
dtype
=
numpy
.
float32
# pylint: disable=E1101
)
# Iterate over the panels. For each panel, determine the pixel
# indices, then compute the x,y vectors. Finally, copy the
# panel pixel maps into the detector-wide pixel maps.
for
pan
in
geometry
[
'
panels
'
]:
if
'
clen
'
in
geometry
[
'
panels
'
][
pan
]:
pan_clen
=
geometry
[
'
panels
'
][
pan
][
'
clen
'
]
else
:
pan_clen
=
0.0
ss_grid
,
fs_grid
=
numpy
.
meshgrid
(
numpy
.
arange
(
geometry
[
'
panels
'
][
pan
][
'
max_ss
'
]
-
...
...
@@ -126,9 +140,17 @@ def compute_pix_maps(geometry):
geometry
[
'
panels
'
][
pan
][
'
max_fs
'
]
+
1
]
=
y_panel
z_map
[
geometry
[
'
panels
'
][
pan
][
'
min_ss
'
]:
geometry
[
'
panels
'
][
pan
][
'
max_ss
'
]
+
1
,
geometry
[
'
panels
'
][
pan
][
'
min_fs
'
]:
geometry
[
'
panels
'
][
pan
][
'
max_fs
'
]
+
1
]
=
pan_clen
r_map
=
numpy
.
sqrt
(
numpy
.
square
(
x_map
)
+
numpy
.
square
(
y_map
))
phi_map
=
numpy
.
arctan2
(
y_map
,
x_map
)
return
PixelMaps
(
x_map
,
y_map
,
r
_map
)
return
PixelMaps
(
x_map
,
y_map
,
z_map
,
r_map
,
phi
_map
)
def
compute_min_array_size
(
pixel_maps
):
...
...
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