Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ttk
spam
Commits
d544b6b5
Commit
d544b6b5
authored
Apr 09, 2021
by
Edward Andò
Browse files
[skip-ci] work on spam-passPhiField
parent
b714356e
Pipeline
#64418
skipped
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/spam-discreteStrain
View file @
d544b6b5
...
...
@@ -79,7 +79,7 @@ triangulationAvailable = False
print
(
"
\n
spam-discreteStrain: Loading kinematics..."
)
if
args
.
inFile
.
name
[
-
3
::]
==
"tsv"
:
if
args
.
RETURN_STAT_THRESHOLD
is
not
None
:
if
args
.
RETURN_STAT
US
_THRESHOLD
is
not
None
:
TSV
=
spam
.
helpers
.
readCorrelationTSV
(
args
.
inFile
.
name
,
readOnlyDisplacements
=
True
,
readConvergence
=
True
)
returnStat
=
TSV
[
'returnStatus'
][
start
:]
else
:
...
...
@@ -95,7 +95,7 @@ if args.inFile.name[-3::] == "tsv":
radii
=
None
del
TSV
elif
args
.
inFile
.
name
[
-
3
::]
==
"vtk"
:
if
args
.
RETURN_STAT_THRESHOLD
is
not
None
:
if
args
.
RETURN_STAT
US
_THRESHOLD
is
not
None
:
returnStat
=
VTK
[
'returnStatus'
]
VTK
=
spam
.
helpers
.
readUnstructuredVTK
(
args
.
inFile
.
name
)
#dims = VTK[0].shape[0]
...
...
@@ -114,8 +114,8 @@ else:
### 2019-10-14 EA: Attempt to catch undesirable return statuses.
# HACK: Set the failing particles positions to NaN
if
args
.
RETURN_STAT_THRESHOLD
is
not
None
:
points
[
returnStat
<
args
.
RETURN_STAT_THRESHOLD
]
=
numpy
.
nan
if
args
.
RETURN_STAT
US
_THRESHOLD
is
not
None
:
points
[
returnStat
<
args
.
RETURN_STAT
US
_THRESHOLD
]
=
numpy
.
nan
### 2020-03-23 EA and OS, nan mask for safety
#mask = numpy.sum(numpy.isnan(points), axis=1) > 0
...
...
scripts/spam-ereg-discrete
View file @
d544b6b5
...
...
@@ -85,7 +85,7 @@ class MainWindow(QWidget):
# Issue #192 will be fixed here, by making sure the loew return stat list also has real boundin boxes
# (i.e., grains are really defined)
nonConvergedGrains
=
DDIC
[
'returnStatus'
][
0
:
REFlabBB
.
shape
[
0
]]
<
args
.
RETURN_STAT_THRESHOLD
nonConvergedGrains
=
DDIC
[
'returnStatus'
][
0
:
REFlabBB
.
shape
[
0
]]
<
args
.
RETURN_STAT
US
_THRESHOLD
presentGrains
=
REFlabBB
[:,
1
]
>
REFlabBB
[:,
0
]
# In the very unlucky case that there is a nax numbered nonConverged grain that is not present at all:
if
REFlabBB
.
shape
[
0
]
<
len
(
nonConvergedGrains
):
...
...
tests/test_scripts.py
View file @
d544b6b5
...
...
@@ -688,7 +688,7 @@ class testAll(unittest.TestCase):
self
.
assertEqual
(
numpy
.
mean
(
imDefScript
[
10
:
-
10
,
10
:
-
10
,
10
:
-
10
])
>
numpy
.
mean
(
imDefScriptCGS
[
10
:
-
10
,
10
:
-
10
,
10
:
-
10
]),
True
)
def
_
test_discreteDICtools
(
self
):
def
test_discreteDICtools
(
self
):
#######################################################
### 1. Generate Data
#######################################################
...
...
tools/helpers/optionsParser.py
View file @
d544b6b5
...
...
@@ -1206,7 +1206,7 @@ def discreteStrainsCalcParser(parser):
'--return-status-threshold'
,
type
=
int
,
default
=
None
,
dest
=
'RETURN_STAT_THRESHOLD'
,
dest
=
'RETURN_STAT
US
_THRESHOLD'
,
help
=
'Lowest return status value to preserve in the triangulation. Default = 2'
)
parser
.
add_argument
(
'-pre'
,
...
...
@@ -1298,7 +1298,7 @@ def eregDiscreteParser(parser):
'--return-status-threshold'
,
type
=
int
,
default
=
2
,
dest
=
'RETURN_STAT_THRESHOLD'
,
dest
=
'RETURN_STAT
US
_THRESHOLD'
,
help
=
'Skip labels already correlated with at least this return status (requires -pf obviously). Default = 2'
)
parser
.
add_argument
(
'-ld'
,
...
...
@@ -2542,11 +2542,25 @@ def passPhiField(parser):
help
=
"Size of im1 in pixels Z Y X"
)
parser
.
add_argument
(
'-nr'
,
'--neighbourhood-radius'
,
'--neighbourhood-radius
-px
'
,
type
=
float
,
default
=
None
,
dest
=
'RADIUS'
,
help
=
"Radius (in pixels) inside which to select neighbours. Default = mean(hws)+mean(sr)"
)
dest
=
'NEIGHBOUR_RADIUS'
,
help
=
"Radius (in pixels) inside which to select neighbours for field interpolation. Excludes -nn option"
)
parser
.
add_argument
(
'-nn'
,
'--number-of-neighbours'
,
type
=
int
,
default
=
None
,
dest
=
'NUMBER_OF_NEIGHBOURS'
,
help
=
"Number of neighbours for field interpolation. Default = None (radius mode is default)"
)
parser
.
add_argument
(
'-rst'
,
'--return-status-threshold'
,
type
=
int
,
default
=-
5
,
dest
=
'RETURN_STATUS_THRESHOLD'
,
help
=
'Lowest return status value to preserve in input PhiField. Default = -5'
)
parser
.
add_argument
(
'-od'
,
'--out-dir'
,
...
...
@@ -2576,6 +2590,7 @@ def passPhiField(parser):
dest
=
'TIFF'
,
help
=
'Activate TIFFoutput format. Default = False'
)
args
=
parser
.
parse_args
()
if
args
.
PHIFILE
is
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment