Skip to content

Commit 39c0125

Browse files
committed
remove rotation debug plots
1 parent 0dd3433 commit 39c0125

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

XPointMLTest.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,12 @@ def expand_xpoints_mask(binary_mask, kernel_size=9):
5959

6060
return expanded_mask
6161

62-
def plotSimple(arr, outfile):
63-
plt.imshow(arr, interpolation="nearest", origin="upper")
64-
plt.colorbar()
65-
plt.savefig(outfile)
66-
plt.clf()
67-
6862
def rotate(frameData,deg):
6963
if deg not in [90, 180, 270]:
7064
print(f"invalid rotation specified... exiting")
7165
sys.exit()
7266
psi = v2.functional.rotate(frameData["psi"], deg, v2.InterpolationMode.BILINEAR)
7367
all = v2.functional.rotate(frameData["all"], deg, v2.InterpolationMode.BILINEAR)
74-
75-
plotSimple(all[0], f"{frameData['fnum']}_rotation{deg}_all0.png")
76-
plotSimple(all[1], f"{frameData['fnum']}_rotation{deg}_all1.png")
77-
plotSimple(all[2], f"{frameData['fnum']}_rotation{deg}_all2.png")
78-
plotSimple(all[3], f"{frameData['fnum']}_rotation{deg}_all3.png")
79-
8068
mask = v2.functional.rotate(frameData["mask"], deg, v2.InterpolationMode.BILINEAR)
8169
return {
8270
"fnum": frameData["fnum"],
@@ -97,10 +85,6 @@ def reflect(frameData,axis):
9785
sys.exit()
9886
psi = torch.flip(frameData["psi"][0], dims=(axis,)).unsqueeze(0)
9987
all = torch.flip(frameData["all"], dims=(axis,))
100-
plotSimple(all[0], f"{frameData['fnum']}_reflectionAxis{axis}_all0.png")
101-
plotSimple(all[1], f"{frameData['fnum']}_reflectionAxis{axis}_all1.png")
102-
plotSimple(all[2], f"{frameData['fnum']}_reflectionAxis{axis}_all2.png")
103-
plotSimple(all[3], f"{frameData['fnum']}_reflectionAxis{axis}_all3.png")
10488
mask = torch.flip(frameData["mask"][0], dims=(axis,)).unsqueeze(0)
10589
return {
10690
"fnum": frameData["fnum"],
@@ -274,10 +258,6 @@ def load(self, fnum):
274258
by_torch = torch.from_numpy(fields["By"]).float().unsqueeze(0)
275259
jz_torch = torch.from_numpy(fields["Jz"]).float().unsqueeze(0)
276260
all_torch = torch.cat((psi_torch,bx_torch,by_torch,jz_torch)) # [4, Nx, Ny]
277-
plotSimple(all_torch[0], f"{fnum}_all0.png")
278-
plotSimple(all_torch[1], f"{fnum}_all1.png")
279-
plotSimple(all_torch[2], f"{fnum}_all2.png")
280-
plotSimple(all_torch[3], f"{fnum}_all3.png")
281261
mask_torch = torch.from_numpy(binaryMap).float().unsqueeze(0) # [1, Nx, Ny]
282262

283263
if self.verbosity > 0:

0 commit comments

Comments
 (0)