Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

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

Fix PhiFile interpolation for spam-ddic

parent 00ba57c3
Pipeline #59766 passed with stages
in 25 minutes and 41 seconds
......@@ -261,6 +261,9 @@ if mpiRank == boss or not mpi:
# Loop over each point of the current grid
for label in range(numberOfLabels):
# reset F to zero, since we'll be doing an additive interpolation at the bottom here
PhiField[label][0:3, 0:3] = 0
# Calculate the distance of the point of the current grid to the points of the input F field
distance, indices = fieldTree.query(centresOfMass[label], k=nNeighbours)
#print(label, distance, indices)
......
......@@ -48,6 +48,12 @@ parser = argparse.ArgumentParser(description="spam-deformImageFromField "+spam.h
# Parse arguments with external helper function
args = spam.helpers.optionsParser.deformImageFromFieldParser(parser)
print("spam-deformImageFromField: Current Settings:")
argsDict = vars(args)
for key in sorted(argsDict):
print("\t{}: {}".format(key, argsDict[key]))
print()
# Read displacements file
TSV = spam.helpers.readCorrelationTSV(args.PHIFILE.name, fieldBinRatio=args.PHIFILE_BIN_RATIO, readConvergence=True)
......
......@@ -42,7 +42,9 @@ class testAll(unittest.TestCase):
try:
rm(testFolder+"snow-ref.tif")
rm(testFolder+"snow-def.tif")
rm(testFolder+"snow-def-zoom.tif")
rm(testFolder+"snow-def-cgs.tif")
rm(testFolder+"snow-def-cgs-zoom.tif")
rm(testFolder+"snow-ref-lab-displaced.tif")
rm(testFolder+"snow-ref-lab.tif")
rm(testFolder+"snow-ref-snow-def-bin1-registration.tsv")
......@@ -347,22 +349,22 @@ class testAll(unittest.TestCase):
"PSCC\terror\titerations\treturnStatus\tdeltaPhiNorm")
exitCode = subprocess.call(["spam-deformImageFromField", "-pf", testFolder+"zoom.tsv", testFolder+"snow-ref.tif",
'-pre', 'snow-def'],
'-pre', 'snow-def-zoom'],
stdout=FNULL, stderr=FNULL)
self.assertEqual(exitCode, 0)
imDefScript = tifffile.imread('snow-def.tif')
imDefScript = tifffile.imread('snow-def-zoom.tif')
# Except for the boundaries, should be same as imDef:
self.assertAlmostEqual(numpy.mean((imDefScript-imDef)[10:-10, 10:-10, 10:-10])/numpy.mean(im), 0, places=3)
exitCode = subprocess.call(["spam-deformImageFromField", "-pf", testFolder+"zoom.tsv", testFolder+"snow-ref.tif",
'-pre', 'snow-def-cgs', '-cgs' ],
'-pre', 'snow-def-cgs-zoom', '-cgs' ],
stdout=FNULL, stderr=FNULL)
self.assertEqual(exitCode, 0)
imDefScriptCGS = tifffile.imread('snow-def-cgs.tif')
imDefScriptCGS = tifffile.imread('snow-def-cgs-zoom.tif')
self.assertEqual(numpy.mean(imDefScript[10:-10, 10:-10, 10:-10]) > numpy.mean(imDefScriptCGS[10:-10, 10:-10, 10:-10]), True)
......
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