Commit 2e4e9415 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Change ser_type kwarg.

parent 0cd2a1df
......@@ -142,7 +142,7 @@ def master_curve(args):
# create a master curve using the core function, check is performed
# in args2times
curves = core.master_curve(times, (args.lat, args.lon), args.model,
ser_type=args.type, check=False)
field_type=args.type, check=False)
# output formats for dif and nez components
fmts = {'dif': ('%.2f', '%2.6f', '%2.6f', '%1.7e'),
'nez': ('%.2f', '%1.7e', '%1.7e', '%1.7e')}
......
......@@ -167,7 +167,7 @@ class Model(object):
f'degree {self.l_max}. Input {max(degrees)} is '
f'invalid.')
if len(degrees) != len(orders):
raise ValueError(f'Different number of degrees and orders given!')
raise ValueError('Different number of degrees and orders given!')
inds = np.empty_like(degrees, dtype=int)
for it, (ell, m) in enumerate(zip(degrees, orders)):
if ell < abs(m):
......@@ -176,7 +176,7 @@ class Model(object):
return inds
def master_curve(times, loc, splines, cov_splines=None, ser_type='dif',
def master_curve(times, loc, splines, cov_splines=None, field_type='dif',
check=True):
'''Create master curves from a splines object.
......@@ -188,7 +188,7 @@ def master_curve(times, loc, splines, cov_splines=None, ser_type='dif',
lat, lon tuple of the location at which to create the master curve.
splines : scipy.interpolate.BSpline or Model
An instance of Model or splines specifying the model.
ser_type : {'dif', 'nez'}
field_type : {'dif', 'nez'}
The type of the master curves. May be either 'dif' (default) for
declination, inclination and intensity or 'nez' for north, east, down.
cov_splines : scipy.interpolate.BSpline, optional
......@@ -202,19 +202,19 @@ def master_curve(times, loc, splines, cov_splines=None, ser_type='dif',
-------
ndarray
The first component master curve. Either declination or north,
depending on the ser_type kwarg. If cov_splines is given, a tuple
depending on the field_type kwarg. If cov_splines is given, a tuple
containing the component and the standard deviation is returned.
ndarray
The second component master curve. Either inclination or east,
depending on the ser_type kwarg. If cov_splines is given, a tuple
depending on the field_type kwarg. If cov_splines is given, a tuple
containing the component and the standard deviation is returned.
ndarray
The third component master curve. Either intensity or down,
depending on the ser_type kwarg. If cov_splines is given, a tuple
depending on the field_type kwarg. If cov_splines is given, a tuple
containing the component and the standard deviation is returned.
'''
if ser_type not in ['nez', 'dif']:
raise ValueError(f"{ser_type} is not a valid series type. 'dif' and "
if field_type not in ['nez', 'dif']:
raise ValueError(f"{field_type} is not a valid series type. 'dif' and "
f"'nez' are supported.")
if isinstance(splines, Model):
if check:
......@@ -235,7 +235,7 @@ def master_curve(times, loc, splines, cov_splines=None, ser_type='dif',
z_mst[3] = times
# the master curves are just field values at a constant location
mst_cv = field(z_mst, splines, cov_splines=cov_splines,
field_type=ser_type)
field_type=field_type)
if cov_splines is None:
return mst_cv[0], mst_cv[1], mst_cv[2]
......
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