Skip to content

Commit

Permalink
Centre
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyroddy committed Sep 2, 2024
1 parent 2489d82 commit 6095ecc
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_bird.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 2
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0.27
CENTER_Y = 0
CENTER_Z = -0.08
CENTRE_X = 0.27
CENTRE_Y = 0
CENTRE_Z = -0.08
DEFAULT_COLOURBAR_POS = 0.98
DEFAULT_ZOOM = 1.49
FILENAME = "bird.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_cheetah.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 3
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = -0.275
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = -0.275
DEFAULT_COLOURBAR_POS = 0.75
DEFAULT_ZOOM = 1.89
FILENAME = "cheetah.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_cube.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 1
CAMERA_Y = 1
CAMERA_Z = 1
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = 0.25
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = 0.25
DEFAULT_COLOURBAR_POS = 0.85
DEFAULT_ZOOM = 0.81
FILENAME = "cube.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_dragon.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 1
CAMERA_Y = 1
CAMERA_Z = 0
CENTER_X = 0.15
CENTER_Y = 0
CENTER_Z = 0.07
CENTRE_X = 0.15
CENTRE_Y = 0
CENTRE_Z = 0.07
DEFAULT_COLOURBAR_POS = 0.99
DEFAULT_ZOOM = 0.95
FILENAME = "dragon.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_homer.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 0
CAMERA_Y = 1
CAMERA_Z = 0.5
CENTER_X = 0
CENTER_Y = 0
CENTER_Z = 0.49
CENTRE_X = 0
CENTRE_Y = 0
CENTRE_Z = 0.49
DEFAULT_COLOURBAR_POS = 0.69
DEFAULT_ZOOM = 0.5
FILENAME = "homer.off"
Expand Down
6 changes: 3 additions & 3 deletions src/sleplet/_data/meshes_regions_teapot.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CAMERA_X = 0
CAMERA_Y = 1
CAMERA_Z = 1
CENTER_X = -0.055
CENTER_Y = 0
CENTER_Z = 0.1
CENTRE_X = -0.055
CENTRE_Y = 0
CENTRE_Z = 0.1
DEFAULT_COLOURBAR_POS = 0.95
DEFAULT_ZOOM = 0.8
FILENAME = "teapot.off"
Expand Down
8 changes: 4 additions & 4 deletions src/sleplet/_plotly_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def create_camera( # noqa: PLR0913
z_eye: float,
zoom: float,
*,
x_center: float = 0,
y_center: float = 0,
z_center: float = 0,
x_centre: float = 0,
y_centre: float = 0,
z_centre: float = 0,
) -> go.layout.scene.Camera:
"""Create default camera view with a zoom factor."""
return go.layout.scene.Camera(
eye=go.layout.scene.camera.Eye(x=x_eye / zoom, y=y_eye / zoom, z=z_eye / zoom),
center=go.layout.scene.camera.Center(x=x_center, y=y_center, z=z_center),
center=go.layout.scene.camera.Center(x=x_centre, y=y_centre, z=z_centre),
)


Expand Down
8 changes: 4 additions & 4 deletions src/sleplet/harmonic_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ def rotate_earth_to_south_america(
L: int,
) -> npt.NDArray[np.complex128]:
"""
Rotates the harmonic coefficients of the Earth to a view centered on South America.
Rotates the harmonic coefficients of the Earth to a view centred on South America.
Args:
earth_flm: The spherical harmonic coefficients of the Earth.
L: The spherical harmonic bandlimit.
Returns:
The spherical harmonic coefficients of the Earth centered on South America.
The spherical harmonic coefficients of the Earth centred on South America.
"""
return ssht.rotate_flms(
earth_flm,
Expand All @@ -201,13 +201,13 @@ def rotate_earth_to_africa(
L: int,
) -> npt.NDArray[np.complex128]:
"""
Rotates the harmonic coefficients of the Earth to a view centered on Africa.
Rotates the harmonic coefficients of the Earth to a view centred on Africa.
Args:
earth_flm: The spherical harmonic coefficients of the Earth.
L: The spherical harmonic bandlimit.
Returns:
The spherical harmonic coefficients of the Earth centered on Africa.
The spherical harmonic coefficients of the Earth centred on Africa.
"""
return ssht.rotate_flms(earth_flm, _AFRICA_ALPHA, _AFRICA_BETA, _AFRICA_GAMMA, L)
6 changes: 3 additions & 3 deletions src/sleplet/meshes/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def __post_init__(self: typing_extensions.Self) -> None:
mesh_config["CAMERA_Y"],
mesh_config["CAMERA_Z"],
mesh_config["REGION_ZOOM"] if self.zoom else mesh_config["DEFAULT_ZOOM"],
x_center=mesh_config["CENTER_X"] if self.zoom else 0,
y_center=mesh_config["CENTER_Y"] if self.zoom else 0,
z_center=mesh_config["CENTER_Z"] if self.zoom else 0,
x_centre=mesh_config["CENTRE_X"] if self.zoom else 0,
y_centre=mesh_config["CENTRE_Y"] if self.zoom else 0,
z_centre=mesh_config["CENTRE_Z"] if self.zoom else 0,
)
self._colourbar_pos = (
mesh_config["REGION_COLOURBAR_POS"]
Expand Down

0 comments on commit 6095ecc

Please sign in to comment.