Skip to content

Commit

Permalink
added chunking to interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
rbooth200 committed Oct 31, 2024
1 parent 484e6f4 commit 651a29e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion frank/statistical_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,27 @@ def interpolate(self, f, r, space='Real'):
"""
if space == 'Real':
r = r / rad_to_arcsec
return self._DHT.interpolate(f, r, space)

r = np.array(r)
shape = r.shape
r = r.reshape(-1)

if self._chunking:
Ni = int(self._chunk_size / len(r) + 1)
else:
Ni = len(r)

end = 0
start = 0
I = []
while end < len(r):
start = end
end = start + Ni
ri = r[start:end]

I.append(self._DHT.interpolate(f, ri, space))

return np.concatenate(I).reshape(*shape)


def _get_mapping_coefficients(self, qs, ks, geometry=None, inverse=False):
Expand Down

0 comments on commit 651a29e

Please sign in to comment.