Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MVCM
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
Paolo Veglio
MVCM
Commits
3bc82d4d
Commit
3bc82d4d
authored
11 months ago
by
Paolo Veglio
Browse files
Options
Downloads
Patches
Plain Diff
cleaned conf.py
parent
77a87848
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mvcm/conf.py
+10
-14
10 additions, 14 deletions
mvcm/conf.py
with
10 additions
and
14 deletions
mvcm/conf.py
+
10
−
14
View file @
3bc82d4d
"""
Module defining confidence computations.
"""
import
numpy
as
np
def
conf_test_new
(
rad
:
np
.
ndarray
,
thr
:
np
.
ndarray
)
->
np
.
ndarray
:
"""
Compute confidence based on thresholds.
"""
"""
Assuming a linear function between min and max confidence level, the plot below shows
how the confidence (y axis) is computed as function of radiance (x axis).
This case illustrates alpha < gamma, obviously in case alpha > gamma, the plot would be
...
...
@@ -50,13 +52,13 @@ def conf_test_new(rad: np.ndarray, thr: np.ndarray) -> np.ndarray:
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
0
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
idx
=
np
.
nonzero
((
rad
<=
beta
)
&
(
flipped
==
1
))
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
1.0
-
(
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
)
# Rad between beta and gamma
range_
=
2.0
*
(
beta
-
gamma
)
s1
=
(
rad
-
gamma
)
/
range_
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
0
))
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[
idx
]
=
1.0
-
(
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
)
idx
=
np
.
nonzero
((
rad
>
beta
)
&
(
flipped
==
1
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
...
...
@@ -72,6 +74,7 @@ def conf_test_new(rad: np.ndarray, thr: np.ndarray) -> np.ndarray:
def
conf_test
(
rad
,
thr
):
"""
Compute confidence based on thresholds.
"""
"""
Assuming a linear function between min and max confidence level, the plot below shows
how the confidence (y axis) is computed as function of radiance (x axis).
...
...
@@ -144,6 +147,7 @@ def conf_test(rad, thr):
def
conf_test_dble
(
rad
,
coeffs
):
"""
Compute confidence based on thresholds.
"""
# '''
# gamma1 gamma2
# c 1_______ ________
...
...
@@ -222,31 +226,23 @@ def conf_test_dble(rad, coeffs):
# Value is within range of lower set of limits
range_
=
2
*
(
beta1
-
alpha1
)
s1
=
(
rad
-
alpha1
)
/
range_
idx
=
np
.
nonzero
(
(
rad
>
alpha1
)
&
(
rad
<=
gamma1
)
&
(
rad
<=
beta1
)
&
(
alpha1
-
gamma1
<=
0
)
)
idx
=
np
.
nonzero
((
rad
>
alpha1
)
&
(
rad
<=
gamma1
)
&
(
rad
<=
beta1
)
&
(
alpha1
-
gamma1
<=
0
))
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
range_
=
2
*
(
beta1
-
gamma1
)
s1
=
(
rad
-
gamma1
)
/
range_
idx
=
np
.
nonzero
(
(
rad
>
alpha1
)
&
(
rad
<=
gamma1
)
&
(
rad
>
beta1
)
&
(
alpha1
-
gamma1
<=
0
)
)
idx
=
np
.
nonzero
((
rad
>
alpha1
)
&
(
rad
<=
gamma1
)
&
(
rad
>
beta1
)
&
(
alpha1
-
gamma1
<=
0
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
# Values is within range of upper set of limits
range_
=
2
*
(
beta2
-
alpha2
)
s1
=
(
rad
-
alpha2
)
/
range_
idx
=
np
.
nonzero
(
(
rad
>
gamma2
)
&
(
rad
<
alpha2
)
&
(
rad
>=
beta2
)
&
(
alpha1
-
gamma1
<=
0
)
)
idx
=
np
.
nonzero
((
rad
>
gamma2
)
&
(
rad
<
alpha2
)
&
(
rad
>=
beta2
)
&
(
alpha1
-
gamma1
<=
0
))
confidence
[
idx
]
=
1.0
-
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
range_
=
2
*
(
beta2
-
gamma2
)
s1
=
(
rad
-
gamma2
)
/
range_
idx
=
np
.
nonzero
(
(
rad
>
gamma2
)
&
(
rad
<
alpha2
)
&
(
rad
<
beta2
)
&
(
alpha1
-
gamma1
<=
0
)
)
idx
=
np
.
nonzero
((
rad
>
gamma2
)
&
(
rad
<
alpha2
)
&
(
rad
<
beta2
)
&
(
alpha1
-
gamma1
<=
0
))
confidence
[
idx
]
=
coeff
[
idx
]
*
np
.
power
(
s1
[
idx
],
power
[
idx
])
confidence
[(
alpha1
-
gamma1
<=
0
)
&
((
rad
>
gamma1
)
|
(
rad
<
gamma2
))]
=
0
...
...
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