Skip to content

Commit

Permalink
models: Add optional file name to SSUSI coeffs
Browse files Browse the repository at this point in the history
Adds the option to pass a different file name to the SSUSI model
coefficient reader. Makes it consistent with the ZP2008 interface,
although it should not be necessary because there are already other ways
to pass custom coefficients.
  • Loading branch information
st-bender committed Apr 5, 2024
1 parent e7659ce commit 6820793
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/eppaurora/models/ssusiq2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,24 @@ def _interp(ds, method="linear", method_non_numeric="nearest", **kwargs):
return xr.merge([ds_n, ds_nn], join="left")


def ssusiq2023_coeffs():
def ssusiq2023_coeffs(file=None):
"""SSUSI ionization rate model coefficients
Returns the fitted ionization rate model coefficents as
read from the coefficient netcdf file.
Parameters
----------
file: str, optional
The coefficient file, defaults to the packaged coefficients.
Returns
-------
coeffs: `xarray.Dataset`
The default fitted model coefficients as read from the file.
"""
return xr.open_dataset(
COEFF_PATH, decode_times=False, engine="h5netcdf"
file or COEFF_PATH, decode_times=False, engine="h5netcdf"
)


Expand Down

0 comments on commit 6820793

Please sign in to comment.