Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/weathergen/datasets/tokenizer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
numpy_argsort_args = {"stable": True} if int(np.__version__.split(".")[0]) >= 2 else {}


def arc_alpha(sin_alpha, cos_alpha):
"""Maps a point on the unit circle (np.array or torch.tensor), defined by its (cosine, sine)
coordinates to its spherical coordinate in [0,2pi)
"""
t = torch.arccos(cos_alpha)
mask = sin_alpha < 0.0
t[mask] = (2.0 * np.pi) - t[mask]
return t


def theta_phi_to_standard_coords(coords):
thetas = ((90.0 - coords[:, 0]) / 180.0) * np.pi
phis = ((coords[:, 1] + 180.0) / 360.0) * 2.0 * np.pi
Expand Down
9 changes: 0 additions & 9 deletions src/weathergen/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@
from weathergen.datasets.batch import BatchSamples


####################################################################################################
def arc_alpha(sin_alpha, cos_alpha):
"""Invert cosine/sine for alpha in [0,2pi] using both functions"""
t = torch.arccos(cos_alpha)
mask = sin_alpha < 0.0
t[mask] = (2.0 * np.pi) - t[mask]
return t


####################################################################################################
def vecs_to_rots(vecs):
"""
Expand Down
Loading