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
2ec6ee84
Commit
2ec6ee84
authored
7 years ago
by
Valerio Mariani
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup. Instroduced underscore notation for private functions, methods and attributes
parent
9675f57c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cfel_cxi.py
+10
-2
10 additions, 2 deletions
cfel_cxi.py
cfel_fabio.py
+2
-2
2 additions, 2 deletions
cfel_fabio.py
cfel_vtk.py
+4
-0
4 additions, 0 deletions
cfel_vtk.py
with
16 additions
and
4 deletions
cfel_cxi.py
+
10
−
2
View file @
2ec6ee84
...
...
@@ -33,6 +33,7 @@ import numpy
_CXISimpleEntry
=
namedtuple
(
'
SimpleEntry
'
,
[
'
path
'
,
'
data
'
,
'
overwrite
'
])
class
_Stack
:
def
__init__
(
self
,
path
,
data
,
axes
):
...
...
@@ -47,6 +48,13 @@ class _Stack:
self
.
_path
=
path
self
.
_axes
=
axes
def
is_there_data_to_write
(
self
):
if
self
.
_data_to_write
is
not
None
:
return
True
else
:
return
False
def
write_initial_slice
(
self
,
file_handle
,
max_num_slices
):
file_handle
.
create_dataset
(
self
.
_path
,
shape
=
(
max_num_slices
,)
+
self
.
_data_shape
,
...
...
@@ -337,7 +345,7 @@ class CXIWriter:
raise
RuntimeError
(
'
The file already holds the maximum allowed number of slices, and should be closed
'
)
for
entry
in
self
.
_cxi_stacks
.
values
():
if
entry
.
_data_to_write
is
Non
e
:
if
entry
.
is_there
_data_to_write
is
Fals
e
:
raise
RuntimeError
(
'
The slice is incomplete and will not be written. The following stack is not
'
'
present in the current slice:
'
,
entry
.
path
)
...
...
@@ -376,4 +384,4 @@ class CXIWriter:
self
.
_fh
.
close
()
self
.
_file_is_open
=
False
\ No newline at end of file
self
.
_file_is_open
=
False
This diff is collapsed.
Click to expand it.
cfel_fabio.py
+
2
−
2
View file @
2ec6ee84
...
...
@@ -64,8 +64,8 @@ def read_cbf_from_stream(stream):
if
len
(
cbf_obj
.
cif
[
cbf_obj
.
CIF_BINARY_BLOCK_KEY
])
>
int
(
cbf_obj
.
header
[
"
X-Binary-Size
"
])
+
cbf_obj
.
start_binary
+
len
(
cbf_obj
.
STARTER
):
cbf_obj
.
cbs
=
cbf_obj
.
cif
[
cbf_obj
.
CIF_BINARY_BLOCK_KEY
][:
int
(
cbf_obj
.
header
[
"
X-Binary-Size
"
])
+
cbf_obj
.
start_binary
+
len
(
cbf_obj
.
STARTER
)]
cbf_obj
.
start_binary
+
len
(
cbf_obj
.
STARTER
)]
else
:
cbf_obj
.
cbs
=
cbf_obj
.
cif
[
cbf_obj
.
CIF_BINARY_BLOCK_KEY
]
binary_data
=
cbf_obj
.
cbs
[
cbf_obj
.
start_binary
+
len
(
cbf_obj
.
STARTER
):]
...
...
This diff is collapsed.
Click to expand it.
cfel_vtk.py
+
4
−
0
View file @
2ec6ee84
...
...
@@ -460,8 +460,12 @@ def scatterplot_3d(data, color=None, point_size=None, cmap="jet", point_shape=No
color (Optional[numpy.ndimage]): 1D Array of floating points with same length as the data array.
These numbers give the color of each point.
point_size (Optional[float]): The size of each points. Behaves differently depending on the point_shape.
If shape is spheres the size is relative to the scene and if squares the size is relative to the window.
cmap (Optional[str]): Color map
point_shape (Optional[
"
spheres
"
or
"
squares
"
]):
"
spheres
"
plots each point as a sphere, recommended for
small data sets.
"
squares
"
plot each point as a square without any 3D structure, recommended for
large data sets.
...
...
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