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
4650e8b3
Commit
4650e8b3
authored
6 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Patches
Plain Diff
Updated load_crystfel_geometry to commit 41a8fa9819010fe8ddeb66676fee717f5226c7b8
parent
79be8de3
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
+30
-14
30 additions, 14 deletions
cfelpyutils/crystfel_utils.py
with
30 additions
and
14 deletions
cfelpyutils/crystfel_utils.py
+
30
−
14
View file @
4650e8b3
...
@@ -582,38 +582,54 @@ def load_crystfel_geometry(filename):
...
@@ -582,38 +582,54 @@ def load_crystfel_geometry(filename):
if
panel
[
'
dim_structure
'
]
is
None
:
if
panel
[
'
dim_structure
'
]
is
None
:
panel
[
'
dim_structure
'
]
=
copy
.
deepcopy
(
default_dim
)
panel
[
'
dim_structure
'
]
=
copy
.
deepcopy
(
default_dim
)
found_ss
=
False
found_ss
=
0
found_fs
=
False
found_fs
=
0
found_placeholder
=
False
found_placeholder
=
0
for
entry
in
panel
[
'
dim_structure
'
]:
for
dim_index
,
entry
in
enumerate
(
panel
[
'
dim_structure
'
]
)
:
if
entry
is
None
:
if
entry
is
None
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Not all dim entries are defined for all panels.
"
"
Dimension {} for panel {} is undefined.
"
.
format
(
dim_index
,
panel
[
'
name
'
]
)
)
)
elif
entry
==
'
ss
'
:
elif
entry
==
'
ss
'
:
if
found_ss
is
True
:
if
found_ss
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Only one slow scan dim coordinate is allowed.
"
"
Exactly one slow scan dim coordinate is needed
"
"
(found {} for panel {})
"
.
format
(
found_ss
,
panel
[
'
name
'
]
)
)
)
else
:
else
:
found_ss
=
True
found_ss
+
=
1
elif
entry
==
'
fs
'
:
elif
entry
==
'
fs
'
:
if
found_fs
is
True
:
if
found_fs
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Only one fast scan dim coordinate is allowed.
"
"
Exactly one fast scan dim coordinate is needed
"
"
(found {} for panel {})
"
.
format
(
found_fs
,
panel
[
'
name
'
]
)
)
)
else
:
else
:
found_fs
=
True
found_fs
+
=
1
elif
entry
==
'
%
'
:
elif
entry
==
'
%
'
:
if
found_placeholder
is
True
:
if
found_placeholder
!=
1
:
raise
RuntimeError
(
raise
RuntimeError
(
"
Only one placeholder dim coordinate is allowed.
"
"
Only one placeholder dim coordinate is allowed.
"
"
Maximum one placeholder dim coordinate is
"
"
allowed (found {} for panel {})
"
.
format
(
found_placeholder
,
panel
[
'
name
'
]
)
)
)
else
:
else
:
found_placeholder
=
True
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
'
])
...
@@ -730,6 +746,6 @@ def load_crystfel_geometry(filename):
...
@@ -730,6 +746,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
#
41a8fa9819010fe8ddeb66676fee717f5226c7b8
#
92f2ebfd11d0ccd91ab299f95ffb2d99a457643d
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