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
42c528bf
Commit
42c528bf
authored
6 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in load_crystfel_geometry
parent
3818901c
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/crystfel_utils.py
+15
-11
15 additions, 11 deletions
cfelpyutils/crystfel_utils.py
with
15 additions
and
11 deletions
cfelpyutils/crystfel_utils.py
+
15
−
11
View file @
42c528bf
...
@@ -91,7 +91,17 @@ def _set_dim_structure_entry(key, value, panel):
...
@@ -91,7 +91,17 @@ def _set_dim_structure_entry(key, value, panel):
else
:
else
:
dim
=
[]
dim
=
[]
dim_index
=
int
(
key
[
3
])
try
:
dim_index
=
int
(
key
[
3
])
except
IndexError
:
raise
RuntimeError
(
"'
dim
'
must be followed by a number, e.g.
'
dim0
'
)
"
)
except
ValueError
:
raise
RuntimeError
(
"
Invalid dimension number {}
"
.
format
(
key
[
3
])
)
if
dim_index
>
len
(
dim
)
-
1
:
if
dim_index
>
len
(
dim
)
-
1
:
for
_
in
range
(
len
(
dim
),
dim_index
+
1
):
for
_
in
range
(
len
(
dim
),
dim_index
+
1
):
dim
.
append
(
None
)
dim
.
append
(
None
)
...
@@ -593,8 +603,8 @@ def load_crystfel_geometry(filename):
...
@@ -593,8 +603,8 @@ def load_crystfel_geometry(filename):
panel
[
'
name
'
]
panel
[
'
name
'
]
)
)
)
)
elif
entry
==
'
ss
'
:
elif
entry
==
'
ss
'
:
found_ss
+=
1
if
found_ss
!=
1
:
if
found_ss
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Exactly one slow scan dim coordinate is needed
"
"
Exactly one slow scan dim coordinate is needed
"
...
@@ -603,10 +613,8 @@ def load_crystfel_geometry(filename):
...
@@ -603,10 +613,8 @@ def load_crystfel_geometry(filename):
panel
[
'
name
'
]
panel
[
'
name
'
]
)
)
)
)
else
:
found_ss
+=
1
elif
entry
==
'
fs
'
:
elif
entry
==
'
fs
'
:
found_fs
+=
1
if
found_fs
!=
1
:
if
found_fs
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Exactly one fast scan dim coordinate is needed
"
"
Exactly one fast scan dim coordinate is needed
"
...
@@ -615,10 +623,8 @@ def load_crystfel_geometry(filename):
...
@@ -615,10 +623,8 @@ def load_crystfel_geometry(filename):
panel
[
'
name
'
]
panel
[
'
name
'
]
)
)
)
)
else
:
found_fs
+=
1
elif
entry
==
'
%
'
:
elif
entry
==
'
%
'
:
found_placeholder
+=
1
if
found_placeholder
!=
1
:
if
found_placeholder
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Only one placeholder dim coordinate is allowed.
"
"
Only one placeholder dim coordinate is allowed.
"
...
@@ -628,8 +634,6 @@ def load_crystfel_geometry(filename):
...
@@ -628,8 +634,6 @@ def load_crystfel_geometry(filename):
panel
[
'
name
'
]
panel
[
'
name
'
]
)
)
)
)
else
:
found_placeholder
+=
1
if
dim_length
is
None
:
if
dim_length
is
None
:
dim_length
=
len
(
panel
[
'
dim_structure
'
])
dim_length
=
len
(
panel
[
'
dim_structure
'
])
...
@@ -746,6 +750,6 @@ def load_crystfel_geometry(filename):
...
@@ -746,6 +750,6 @@ def load_crystfel_geometry(filename):
# The code of this function is synced with the code of the function
# The code of this function is synced with the code of the function
# 'get_detector_geometry_2' in CrystFEL at commit
# 'get_detector_geometry_2' in CrystFEL at commit
#
92f2ebfd11d0ccd91ab299f95ffb2d99a457643d
#
dabbe320ff1d54d8ad24954b1e391f1b58ec0866
return
detector
return
detector
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