Skip to content

Commit

Permalink
Fix screen extent computation return type
Browse files Browse the repository at this point in the history
  • Loading branch information
jank324 committed Dec 11, 2023
1 parent 02b0469 commit ff9c409
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cheetah/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,12 +1328,14 @@ def effective_pixel_size(self) -> torch.Tensor:
return self.pixel_size * self.binning

@property
def extent(self) -> tuple[float, float, float, float]:
return (
-self.resolution[0] * self.pixel_size[0] / 2,
self.resolution[0] * self.pixel_size[0] / 2,
-self.resolution[1] * self.pixel_size[1] / 2,
self.resolution[1] * self.pixel_size[1] / 2,
def extent(self) -> torch.Tensor:
return torch.stack(
[
-self.resolution[0] * self.pixel_size[0] / 2,
self.resolution[0] * self.pixel_size[0] / 2,
-self.resolution[1] * self.pixel_size[1] / 2,
self.resolution[1] * self.pixel_size[1] / 2,
]
)

@property
Expand Down

0 comments on commit ff9c409

Please sign in to comment.