Skip to content

Commit

Permalink
Fixing rotation angle in renderer.py (#277)
Browse files Browse the repository at this point in the history
closes #276
  • Loading branch information
charlotteaward authored Feb 15, 2023
1 parent 11d1363 commit 5b0b5e0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scarlet/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,29 +322,29 @@ def __init__(self, data_frame, model_frame, padding=10):
Y_unrot = (
(coord_hr[:, 0] - center_y) * self.angle[0]
- (coord_hr[:, 1] - center_x) * self.angle[1]
).reshape(lr_shape)
).reshape(lr_shape[0])
X_unrot = (
(coord_hr[:, 1] - center_x) * self.angle[0]
+ (coord_hr[:, 0] - center_y) * self.angle[1]
).reshape(lr_shape)
).reshape(lr_shape[1])

# Removing redundancy
self.Y_unrot = Y_unrot[:, 0]
self.X_unrot = X_unrot[0, :]
self.Y_unrot = Y_unrot
self.X_unrot = X_unrot

if self.small_axis:
self.shifts = np.array(
[self.Y_unrot * self.angle[0], self.Y_unrot * self.angle[1]]
[self.Y_unrot * self.angle[0], -self.Y_unrot * self.angle[1],]
)
self.other_shifts = np.array(
[-self.angle[1] * self.X_unrot, self.angle[0] * self.X_unrot,]
[self.angle[1] * self.X_unrot, self.angle[0] * self.X_unrot,]
)
else:
self.shifts = np.array(
[-self.angle[1] * self.X_unrot, self.angle[0] * self.X_unrot,]
[self.angle[1] * self.X_unrot, self.angle[0] * self.X_unrot,]
)
self.other_shifts = np.array(
[self.Y_unrot * self.angle[0], self.Y_unrot * self.angle[1],]
[self.Y_unrot * self.angle[0], -self.Y_unrot * self.angle[1],]
)

axes = (1, 2)
Expand Down

0 comments on commit 5b0b5e0

Please sign in to comment.