Skip to content

Commit

Permalink
fixing isort failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Zahraa Zaher committed Dec 6, 2023
1 parent c659f73 commit 47eaed9
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions tomopt/volume/kuhn_scatter_model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Dict, Optional
import math
import numpy as np
import random
from typing import Dict, Optional

import numpy as np
import torch
from torch import Tensor


__all__ = ["KUHN_SCATTER_MODEL"]


Expand All @@ -21,26 +21,8 @@ def compute_scattering(self, mom: Tensor, b: Tensor, Z_A_rho: Tensor, theta: Ten
if self._device is None:
self.device = theta.device

# if (mom.shape[0]<1):
# return {
# "dtheta_m" : Tensor([]),
# "dtheta_x_vol": Tensor([]),
# "dtheta_y_vol": Tensor([]),
# "dx_vol": Tensor([]),
# "dy_vol": Tensor([]),
# "dz_vol": Tensor([]),
# "dtheta_x_m": Tensor([]),
# "dtheta_y_m": Tensor([]),
# "dx_m": Tensor([]),
# "dy_m": Tensor([]),
# }

# delta_s = dz*100/np.cos(theta)
delta_s = dz * 100
mom *= 1000
# density = self.getZA_density(x0)[:,0]
# Z = self.getZA_density(x0)[:,1]
# A = self.getZA_density(x0)[:,2]

Z = Z_A_rho[0]
A = Z_A_rho[1]
Expand Down Expand Up @@ -84,9 +66,7 @@ def compute_scattering(self, mom: Tensor, b: Tensor, Z_A_rho: Tensor, theta: Ten

# dtheta=torch.clamp(dtheta, max=math.pi / 2.2)
dtheta_x = np.arctan(np.tan(dtheta) * np.cos(dphi))
# dtheta_x[(dtheta >= torch.pi / 2)] = torch.nan
dtheta_y = np.arctan(np.tan(dtheta) * np.sin(dphi))
# dtheta_y[(dtheta >= torch.pi / 2)] = torch.nan

z1 = torch.randn((2, dtheta.shape[0]), device=self.device)
z2 = torch.randn((2, dtheta.shape[0]), device=self.device)
Expand Down

0 comments on commit 47eaed9

Please sign in to comment.