Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
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
Container 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
Tom Rink
python
Commits
48989aad
Commit
48989aad
authored
11 months ago
by
tomrink
Browse files
Options
Downloads
Patches
Plain Diff
snapshot...
parent
28dc0810
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
modules/util/hdf5_conversion.py
+3
-3
3 additions, 3 deletions
modules/util/hdf5_conversion.py
with
3 additions
and
3 deletions
modules/util/hdf5_conversion.py
+
3
−
3
View file @
48989aad
...
@@ -3,7 +3,7 @@ import numpy as np
...
@@ -3,7 +3,7 @@ import numpy as np
import
pandas
as
pd
import
pandas
as
pd
def
hdf5_to_npz_csv
(
hdf5_filename
,
output_file_prefix
,
chunk_size
=
1000
):
def
hdf5_to_npz_csv
(
hdf5_filename
,
output_file_prefix
,
chunk_size
=
1000
0
):
"""
"""
Convert HDF5 files to NumPy
'
s NPZ and CSV formats in chunks.
Convert HDF5 files to NumPy
'
s NPZ and CSV formats in chunks.
Only values where the boolean mask is True are included.
Only values where the boolean mask is True are included.
...
@@ -16,10 +16,10 @@ def hdf5_to_npz_csv(hdf5_filename, output_file_prefix, chunk_size=1000):
...
@@ -16,10 +16,10 @@ def hdf5_to_npz_csv(hdf5_filename, output_file_prefix, chunk_size=1000):
# Step 1: Open HDF5 file
# Step 1: Open HDF5 file
with
h5py
.
File
(
hdf5_filename
,
"
r
"
)
as
file
:
with
h5py
.
File
(
hdf5_filename
,
"
r
"
)
as
file
:
mask
=
np
.
asarray
(
file
[
"
mask
"
])
# If mask needs to be applied, load it into memory
mask
=
np
.
asarray
(
file
[
"
FOV_
mask
"
])
# If mask needs to be applied, load it into memory
# For each dataset
# For each dataset
for
dataset_name
in
file
.
keys
():
for
dataset_name
in
filter
(
lambda
key
:
key
!=
"
FOV_mask
"
,
file
.
keys
()
)
:
dataset
=
file
[
dataset_name
]
dataset
=
file
[
dataset_name
]
# Determine how many chunks are needed (rounded up)
# Determine how many chunks are needed (rounded up)
...
...
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