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
17af3dcb
Commit
17af3dcb
authored
8 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Patches
Plain Diff
Fixed integer division for Python 3 compatibility
parent
e89ba2ba
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
cfelgeom.py
+6
-6
6 additions, 6 deletions
cfelgeom.py
with
6 additions
and
6 deletions
cfelgeom.py
+
6
−
6
View file @
17af3dcb
...
...
@@ -83,7 +83,7 @@ def pixel_maps_for_image_view(geometry_filename):
of the physical layout of the detector in a pyqtgraph ImageView widget (i.e.
they apply the detector geometry setting the origin of the reference
system is in the top left corner of the output array).
Args:
geometry_filename (str): geometry filename.
...
...
@@ -108,8 +108,8 @@ def pixel_maps_for_image_view(geometry_filename):
m
=
2
*
int
(
max
(
abs
(
x
.
max
()),
abs
(
x
.
min
())))
+
2
# convert y x values to i j values
i
=
numpy
.
array
(
y
,
dtype
=
numpy
.
int
)
+
n
/
2
-
1
j
=
numpy
.
array
(
x
,
dtype
=
numpy
.
int
)
+
m
/
2
-
1
i
=
numpy
.
array
(
y
,
dtype
=
numpy
.
int
)
+
n
/
/
2
-
1
j
=
numpy
.
array
(
x
,
dtype
=
numpy
.
int
)
+
m
/
/
2
-
1
yx
=
(
i
.
flatten
(),
j
.
flatten
())
img_shape
=
(
n
,
m
)
...
...
@@ -125,8 +125,8 @@ def parse_xy(string):
string (str): the string to be parsed.
Returns:
x, y (float, float): the values of x and y.
x, y (float, float): the values of x and y.
"""
x
=
y
=
0
...
...
@@ -136,7 +136,7 @@ def parse_xy(string):
x
=
float
(
xs
)
else
:
x
=
1.
if
string
.
find
(
'
y
'
)
is
not
-
1
:
ys
=
string
.
split
(
'
y
'
)[
0
].
split
(
'
'
)[
-
1
]
if
len
(
ys
)
>
0
:
...
...
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