read_love_numbers
Reads sets of load Love/Shida numbers computed using outputs from the Preliminary Reference Earth Model (PREM) or other Earth models
Linearly interpolates load Love/Shida numbers for missing degrees
Linearly extrapolates load Love/Shida numbers beyond maximum degree of dataset
Applies isomorphic parameters for different reference frames
Calling Sequence
from gravity_toolkit.utilities import get_data_path
from gravity_toolkit.read_love_numbers import read_love_numbers
love_numbers_file = get_data_path(['data','love_numbers'])
hl,kl,ll = read_love_numbers(love_numbers_file, FORMAT='tuple', REFERENCE='CF')
- gravity_toolkit.read_love_numbers(love_numbers_file, LMAX=None, HEADER=2, COLUMNS=['l', 'hl', 'kl', 'll'], REFERENCE='CE', FORMAT='tuple')[source]
Reads PREM load Love/Shida numbers file and applies isomorphic parameters [5, 17] [73]
- Parameters:
- love_numbers_file: str
Elastic load Love/Shida numbers file
- LMAX: int or NoneType, default None
Truncate or interpolate to maximum spherical harmonic degree
- HEADER: int, default 2
Number of header lines to be skipped
- COLUMNS: list
Column names of ascii file
'l': spherical harmonic degree'hl': vertical displacement'kl': gravitational potential'll': horizontal displacement
- REFERENCE: str, default ‘CE’
Reference frame of degree 1 Love/Shida numbers
'CF': Center of Surface Figure'CL': Center of Surface Lateral Figure'CH': Center of Surface Height Figure'CM': Center of Mass of Earth System'CE': Center of Mass of Solid Earth
- FORMAT: str, default ‘tuple’
Format of output variables
'dict': dictionary with variable keys as listed above'tuple': tuple with variable order (hl,kl,ll)'zip': aggregated variable sets'class':love_numbersclass
- Returns:
- hl: np.ndarray
Love number of Vertical Displacement
- kl: np.ndarray
Love number of Gravitational Potential
- ll: np.ndarray
Love (Shida) number of Horizontal Displacement
- gravity_toolkit.read_love_numbers.love_number_formatter(love, FORMAT='tuple')[source]
Converts a dictionary of Load Love/Shida Numbers to a particular output format
- Parameters:
- love: dict
Load Love/Shida numbers
- FORMAT: str, default ‘tuple’
Format of output variables
'dict': dictionary with variable keys'tuple': tuple with variable order (hl,kl,ll)'zip': aggregated variable sets'class':love_numbersclass
- Returns:
- hl: np.ndarray
Love number of Vertical Displacement
- kl: np.ndarray
Love number of Gravitational Potential
- ll: np.ndarray
Love (Shida) number of Horizontal Displacement
- gravity_toolkit.read_love_numbers.extract_love_numbers(love_numbers_file)[source]
Read load Love/Shida number file and extract contents
- Parameters:
- love_numbers_file: str, bytesIO or pathlib.Path
Elastic load Love/Shida numbers file
- gravity_toolkit.read_love_numbers.load_love_numbers(LMAX, LOVE_NUMBERS=0, REFERENCE='CF', FORMAT='tuple')[source]
Wrapper function for reading PREM load Love/Shida numbers for a range of spherical harmonic degrees and applying isomorphic parameters [5]
- Parameters:
- LMAX: int
maximum spherical harmonic degree
- LOVE_NUMBERS: int, default 0
Treatment of the Load Love/Shida numbers
- REFERENCE: str
Reference frame for calculating degree 1 Love/Shida numbers [5]
'CF': Center of Surface Figure (default)'CM': Center of Mass of Earth System'CE': Center of Mass of Solid Earth
- FORMAT: str, default ‘tuple’
Format of output variables
'dict': dictionary with variable keys as listed above'tuple': tuple with variable order (hl,kl,ll)'zip': aggregated variable sets'class':love_numbersclass
- Returns:
- hl: np.ndarray
Love number of Vertical Displacement
- kl: np.ndarray
Love number of Gravitational Potential
- ll: np.ndarray
Love (Shida) number of Horizontal Displacement
- class gravity_toolkit.love_numbers(**kwargs)[source]
Data class for Load Love/Shida numbers
- Attributes:
- lmax: int
maximum degree of the Load Love/Shida Numbers
- l: np.ndarray
Spherical harmonic degrees
- hl: np.ndarray or List
Love number of Vertical Displacement
- kl: np.ndarray or List
Love number of Gravitational Potential
- ll: np.ndarray or List
Love (Shida) number of Horizontal Displacement
- reference: str
Reference frame for degree 1 Love/Shida numbers
'CF': Center of Surface Figure'CM': Center of Mass of Earth System'CE': Center of Mass of Solid Earth
- model: str
Reference Earth Model
- citation: str
Citation for Reference Earth Model
- filename: str
input filename of Load Love/Shida Numbers
- from_dict(d)[source]
Convert a dict object to a
love_numbersobject- Parameters:
- d: dict
dictionary object to be converted
- to_dict()[source]
Convert a
love_numbersobject to a dict object- Returns:
- d: dict
output dictionary object
- to_tuple()[source]
Convert a
love_numbersobject to a tuple object- Returns:
- t: tuple
output tuple object
- transform(reference)[source]
Calculate and apply calculate isomorphic parameters to transform from the Center of Mass of the Solid Earth Reference Frame [5]
- Parameters:
- reference: str
Output reference frame for degree 1 Love/Shida numbers
'CF': Center of Surface Figure'CL': Center of Surface Lateral Figure'CH': Center of Surface Height Figure'CM': Center of Mass of Earth System'CE': Center of Mass of Solid Earth