Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calng
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
Model registry
Operate
Environments
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
calibration
calng
Commits
385420de
Commit
385420de
authored
3 years ago
by
David Hammer
Browse files
Options
Downloads
Patches
Plain Diff
Hopefully better handling of empty DAQ hashes
parent
f39d435b
No related branches found
Branches containing commit
Tags
0.1.1-2.12.0
Tags containing commit
1 merge request
!12
Snapshot: field test deployed version as of end of run 202201
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/calng/base_correction.py
+11
-18
11 additions, 18 deletions
src/calng/base_correction.py
with
11 additions
and
18 deletions
src/calng/base_correction.py
+
11
−
18
View file @
385420de
...
...
@@ -928,36 +928,30 @@ class BaseCorrection(PythonDevice):
elif
not
data_hash
.
has
(
self
.
_image_data_path
):
self
.
log_status_info
(
"
Ignoring hash without image node
"
)
return
train_id
=
metadata
.
getAttribute
(
"
timestamp
"
,
"
tid
"
)
self
.
_train_ratio_tracker
.
update
(
train_id
)
cell_table
=
data_hash
.
get
(
self
.
_cell_table_path
)
if
(
isinstance
(
cell_table
,
np
.
ndarray
)
and
(
len
(
cell_table
.
shape
)
==
0
or
cell_table
.
size
==
0
)
)
or
len
(
cell_table
)
==
0
:
self
.
log_status_warn
(
"
Empty cell table, DAQ probably not sending data.
"
)
elif
len
(
self
.
input_data_shape
)
!=
len
(
data_hash
.
get
(
f
"
{
self
.
_image_data_path
}
.shape
"
)):
self
.
log_status_info
(
"
DAQ probably not sending data
"
)
return
cell_table
=
np
.
ravel
(
cell_table
)
# no more common reasons to skip input, so go to processing
if
state
is
State
.
ON
:
self
.
updateState
(
State
.
PROCESSING
)
self
.
log_status_info
(
"
Processing data
"
)
correction_cell_num
=
self
.
unsafe_get
(
"
constantParameters.memoryCells
"
)
cell_table_max
=
np
.
max
(
cell_table
)
train_id
=
metadata
.
getAttribute
(
"
timestamp
"
,
"
tid
"
)
self
.
_train_ratio_tracker
.
update
(
train_id
)
cell_table
=
data_hash
.
get
(
self
.
_cell_table_path
).
ravel
()
if
self
.
unsafe_get
(
"
constantParameters.memoryCells
"
)
<=
cell_table
.
max
():
self
.
log_status_warn
(
"
Input cell IDs out of range of constants
"
)
image_data
=
data_hash
.
get
(
self
.
_image_data_path
)
if
cell_table
.
size
!=
self
.
unsafe_get
(
"
dataFormat.memoryCells
"
):
self
.
log_status_info
(
f
"
Updating new input shape
{
image_data
.
shape
}
, updating buffer
s
"
f
"
Updating new input shape
to account for
{
cell_table
.
size
}
cell
s
"
)
self
.
set
(
"
dataFormat.memoryCells
"
,
cell_table
.
size
)
with
self
.
_buffer_lock
:
self
.
_update_frame_filter
()
self
.
_lock_and_update_in_background
(
self
.
_update_frame_filter
)
image_data
=
data_hash
.
get
(
self
.
_image_data_path
)
# DataAggregator typically tells us the wrong axis order
if
self
.
unsafe_get
(
"
dataFormat.overrideInputAxisOrder
"
):
expected_shape
=
self
.
input_data_shape
...
...
@@ -986,7 +980,6 @@ class BaseCorrection(PythonDevice):
self
.
_rate_tracker
.
update
()
def
_update_rate_and_state
(
self
):
if
self
.
get
(
"
state
"
)
is
State
.
PROCESSING
:
self
.
_buffered_status_update
.
set
(
"
performance.rate
"
,
self
.
_rate_tracker
.
get
()
...
...
This diff is collapsed.
Click to expand it.
David Hammer
@hammerd
mentioned in commit
3566342d
·
2 years ago
mentioned in commit
3566342d
mentioned in commit 3566342d031db1bb435b6430f100afdbaaa6c4bf
Toggle commit list
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