Commit 5a6d52dd authored by Thorsten Kurth's avatar Thorsten Kurth
Browse files

and one more

parent 30f7802b
......@@ -75,9 +75,9 @@ class ResampleS2(nn.Module):
# we need to expand the solution to the poles before interpolating
self.expand_poles = (self.lats_out > self.lats_in[-1]).any() or (self.lats_out < self.lats_in[0]).any()
if self.expand_poles:
self.lats_in = torch.cat([torch.as_tensor([0.], dtype=torch.float64),
self.lats_in = torch.cat([torch.as_tensor([0.], dtype=torch.float64, device=self.lats_in.device),
self.lats_in,
torch.as_tensor([math.pi], dtype=torch.float64)]).contiguous()
torch.as_tensor([math.pi], dtype=torch.float64, device=self.lats_in.device)]).contiguous()
# prepare the interpolation by computing indices to the left and right of each output latitude
lat_idx = torch.searchsorted(self.lats_in, self.lats_out, side="right") - 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment