pyissm.model.classes.lovenumbers

class pyissm.model.classes.lovenumbers(other=None)

Bases: manage_state

Love numbers parameters class for ISSM.

This class encapsulates Love numbers parameters for the ISSM (Ice Sheet System Model) framework. Love numbers describe the elastic and viscoelastic response of the solid Earth to surface loading, including ice mass changes. They are essential for modeling sea level change and solid Earth deformation.

Parameters:

other (any, optional) – Any other class object that contains common fields to inherit from. If values in other differ from default values, they will override the default values.

h

Load Love number for radial displacement (provided by PREM model).

Type:

float, default=nan

k

Load Love number for gravitational potential perturbation (provided by PREM model).

Type:

float, default=nan

l

Load Love number for horizontal displacements (provided by PREM model).

Type:

float, default=nan

th

Tidal load Love number (degree 2) for radial displacement.

Type:

float, default=nan

tk

Tidal load Love number (degree 2) for gravitational potential.

Type:

float, default=nan

tl

Tidal load Love number (degree 2) for horizontal displacement.

Type:

float, default=nan

tk2secular

Secular fluid Love number (degree 2).

Type:

float, default=0

pmtf_colinear

Colinear component of the Polar Motion Transfer Function (e.g. x-motion due to x-component perturbation of the inertia tensor).

Type:

float, default=nan

pmtf_ortho

Orthogonal component of the Polar Motion Transfer Function (couples x and y components, only used for Chandler Wobble).

Type:

float, default=nan

timefreq

Time/frequency vector [yr or 1/yr].

Type:

float, default=nan

istime

Time (1, default) or frequency love numbers (0).

Type:

int, default=1

__init__(self, other=None)

Initializes the lovenumbers parameters, optionally inheriting from another instance.

__repr__(self)

Returns a detailed string representation of the lovenumbers parameters.

__str__(self)

Returns a short string identifying the class.

marshall_class(self, fid, prefix, md=None)

Marshall parameters to a binary file

Notes

This functionality is not yet fully implemented in the current version.

Examples

md.lovenumbers = pyissm.model.classes.lovenumbers() md.lovenumbers.h = h_love_numbers md.lovenumbers.k = k_love_numbers md.lovenumbers.l = l_love_numbers

__init__(other=None)

Initialize the instance with optional field inheritance.

Parameters:

other (object, optional) – Another instance to inherit field values from. If provided, any fields in the current instance that differ from the default values and exist in ‘other’ will be replaced with the values from ‘other’.

Notes

The inheritance process:

  1. Iterates through all attributes of the current instance

  2. Checks if the same attribute exists in the ‘other’ instance

  3. Compares field values using _fields_equal()

  4. If different, replaces the current value with the ‘other’ value

This enables the common ISSM pattern where classes can inherit configurations from existing instances while maintaining their default values for unspecified fields.

Methods

__init__([other])

Initialize the instance with optional field inheritance.

check_consistency(md, solution, analyses)

Check consistency of the [lovenumbers.lovenumbers] parameters.

issm_enum_string()

Default ISSM C++ enum string used during marshalling.

marshall_class(fid, prefix[, md])

Marshall [lovenumbers.lovenumbers] parameters to a binary file.

check_consistency(md, solution, analyses)

Check consistency of the [lovenumbers.lovenumbers] parameters.

Parameters:
  • md (pyissm.model.Model) – The model object to check.

  • solution (str) – The solution name to check.

  • analyses (list of str) – List of analyses to check consistency for.

Returns:

md – The model object with any consistency errors noted.

Return type:

pyissm.model.Model

marshall_class(fid, prefix, md=None)

Marshall [lovenumbers.lovenumbers] parameters to a binary file.

Parameters:
  • fid (file object) – The file object to write the binary data to.

  • prefix (str) – Prefix string used for data identification in the binary file.

  • md (ISSM model object, optional.) – ISSM model object needed in some cases.

Return type:

None