Skip to content

Commit

Permalink
Making MIO scaling by the (1 + N*F10.7) factor optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
pacesm committed Mar 23, 2023
1 parent 7f57779 commit 4a1849e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions eoxmagmod/eoxmagmod/magnetic_model/model_mio.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,14 @@ def _subset(data, mask):
)

# MIO scaling factor
mio_scale = 1.0 + self.wolf_ratio * asarray(options.pop('f107'))
mask = True
mio_scale = options.pop('f107', None)
if mio_scale is not None:
mio_scale = 1.0 + self.wolf_ratio * asarray(mio_scale)
mask = ~isnan(mio_scale)

start, end = self.validity
mask = (time >= start) & (time <= end) & ~isnan(mio_scale)
mask = (time >= start) & (time <= end) & mask
result = full(location.shape, nan)
result[mask, :] = self._eval(
self._eval_fourier2d, self.coefficients,
Expand All @@ -182,9 +186,11 @@ def _subset(data, mask):
lon_sol=_subset(options.pop('lon_sol', None), mask),
**options,
)
if mio_scale.ndim > 0:
mio_scale = reshape_array(location.shape, mio_scale)
result *= mio_scale

if mio_scale is not None:
if mio_scale.ndim > 0:
mio_scale = reshape_array(location.shape, mio_scale)
result *= mio_scale

return result

Expand Down

0 comments on commit 4a1849e

Please sign in to comment.