Commit d544b6b5 authored by Edward Andò's avatar Edward Andò
Browse files

[skip-ci] work on spam-passPhiField

parent b714356e
Pipeline #64418 skipped
......@@ -79,7 +79,7 @@ triangulationAvailable = False
print("\nspam-discreteStrain: Loading kinematics...")
if args.inFile.name[-3::] == "tsv":
if args.RETURN_STAT_THRESHOLD is not None:
if args.RETURN_STATUS_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_STATUS_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_STATUS_THRESHOLD is not None:
points[returnStat < args.RETURN_STATUS_THRESHOLD] = numpy.nan
### 2020-03-23 EA and OS, nan mask for safety
#mask = numpy.sum(numpy.isnan(points), axis=1) > 0
......
......@@ -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_STATUS_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):
......
......@@ -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
#######################################################
......
......@@ -1206,7 +1206,7 @@ def discreteStrainsCalcParser(parser):
'--return-status-threshold',
type=int,
default=None,
dest='RETURN_STAT_THRESHOLD',
dest='RETURN_STATUS_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_STATUS_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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment