Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Live integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Koziej Lab
X-ray Diffraction
PDF
Live integration
Commits
2cc95d92
Commit
2cc95d92
authored
3 months ago
by
Gröne, Tjark Leon Raphael
Browse files
Options
Downloads
Patches
Plain Diff
Update file maxwell_integrate_to_h5.py
parent
5ccabac9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
maxwell_integrate_to_h5.py
+24
-21
24 additions, 21 deletions
maxwell_integrate_to_h5.py
with
24 additions
and
21 deletions
maxwell_integrate_to_h5.py
+
24
−
21
View file @
2cc95d92
...
@@ -16,6 +16,8 @@ from watchdog.events import PatternMatchingEventHandler
...
@@ -16,6 +16,8 @@ from watchdog.events import PatternMatchingEventHandler
from
multiprocessing.pool
import
ThreadPool
as
Pool
from
multiprocessing.pool
import
ThreadPool
as
Pool
import
pandas
as
pd
import
pandas
as
pd
global
NPROC
global
NPROC
...
@@ -50,9 +52,6 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
...
@@ -50,9 +52,6 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
global
POLARIZATION
global
POLARIZATION
global
ERRORMODE
global
ERRORMODE
if
not
os
.
path
.
isdir
(
path_int
):
os
.
mkdir
(
path_int
)
im
=
fabio
.
open
(
fname_im
).
data
im
=
fabio
.
open
(
fname_im
).
data
basename_int
=
os
.
path
.
basename
(
fname_im
)[:
-
len
(
dtype_im
)]
+
dtype_int
basename_int
=
os
.
path
.
basename
(
fname_im
)[:
-
len
(
dtype_im
)]
+
dtype_int
fname_int
=
os
.
path
.
join
(
path_int
,
basename_int
)
fname_int
=
os
.
path
.
join
(
path_int
,
basename_int
)
...
@@ -93,10 +92,14 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
...
@@ -93,10 +92,14 @@ def integrate_ims_in_dir(path_im, path_int, dtype_im=".tif", dtype_int=".dat"):
pool
=
Pool
(
int
(
NPROC
))
pool
=
Pool
(
int
(
NPROC
))
for
subdir
in
set
(
os
.
path
.
dirname
(
fname
)
for
fname
in
fnames_ims
):
for
subdir
in
set
(
os
.
path
.
dirname
(
fname
)
for
fname
in
fnames_ims
):
subdir_fnames
=
[
fname
for
fname
in
fnames_ims
if
os
.
path
.
dirname
(
fname
)
==
subdir
]
subdir_fnames
=
[
fname
for
fname
in
fnames_ims
if
os
.
path
.
dirname
(
fname
)
==
subdir
]
subdir_path_int
=
path_int_list
[
fnames_ims
.
index
(
subdir_fnames
[
0
])]
subdir_path_int
=
path_int_list
[
fnames_ims
.
index
(
subdir_fnames
[
0
])]
results
=
[]
if
not
os
.
path
.
isdir
(
subdir_path_int
):
os
.
mkdir
(
subdir_path_int
)
filtered_fnames
=
[
fname_im
for
fname_im
in
subdir_fnames
if
"
metadata
"
not
in
fname_im
]
filtered_fnames
=
[
fname_im
for
fname_im
in
subdir_fnames
if
"
metadata
"
not
in
fname_im
]
if
filtered_fnames
:
if
filtered_fnames
:
...
...
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
sign in
to comment