geoist.magmod.magnetic_model package

Submodules

geoist.magmod.magnetic_model.coefficients module

class geoist.magmod.magnetic_model.coefficients.CombinedSHCoefficients(*items)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SHCoefficients

Model composed of multiple coefficient sets.

property degree

Get [maximum] model degree.

property min_degree

Get minimum model degree. Below this degree all model coefficients are zero.

class geoist.magmod.magnetic_model.coefficients.SHCoefficients(is_internal=True, **kwargs)[源代码]

基类:object

Abstract base class for the spherical harmonic coefficients.

property degree

Get [maximum] model degree.

is_valid(time)[源代码]

Check if the time is within the coefficients validity range.

property min_degree

Get minimum model degree. Below this degree all model coefficients are zero.

class geoist.magmod.magnetic_model.coefficients.SparseSHCoefficients(indices, coefficients, **kwargs)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SHCoefficients

Base class for sparse spherical harmonic coefficients.

property degree

Get [maximum] model degree.

property min_degree

Get minimum model degree. Below this degree all model coefficients are zero.

class geoist.magmod.magnetic_model.coefficients.SparseSHCoefficientsConstant(indices, coefficients, **kwargs)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SparseSHCoefficients

Time invariant sparse spherical harmonic coefficients.

class geoist.magmod.magnetic_model.coefficients.SparseSHCoefficientsTimeDependent(indices, coefficients, times, **kwargs)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SparseSHCoefficients

Time dependent sparse spherical harmonic coefficients evaluated by piecewise linear interpolation of a time series of coefficients snapshots.

class geoist.magmod.magnetic_model.coefficients.SparseSHCoefficientsTimeDependentDecimalYear(indices, coefficients, times, to_mjd2000=<built-in function decimal_year_to_mjd2000>, to_decimal_year=<built-in function mjd2000_to_decimal_year>, **kwargs)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SparseSHCoefficientsTimeDependent

Time dependent sparse spherical harmonic coefficients evaluated by piecewise linear interpolation of a time series of coefficients snapshots with time in decimal year interpolated in the decimal years time domain.

geoist.magmod.magnetic_model.coefficients.coeff_size(degree)[源代码]

Size of the full coefficient array.

geoist.magmod.magnetic_model.coefficients_mio module

class geoist.magmod.magnetic_model.coefficients_mio.SparseSHCoefficientsMIO(indices, coefficients, ps_extent, mjd2000_to_year_fraction=<built-in function mjd2000_to_year_fraction>, **kwargs)[源代码]

基类:geoist.magmod.magnetic_model.coefficients.SparseSHCoefficients

Time dependent 2D Fourier series Swarm MIO coefficients. :param indices - array if the nm indices: :param coefficients - gh or qs coefficients: :param ps_extent -: :type ps_extent -: pmin, pmax, smin, smax :param is_internal - set False for an external model:

geoist.magmod.magnetic_model.field_lines module

geoist.magmod.magnetic_model.field_lines.trace_field_line(model, time, point, input_coordinate_system=1, output_coordinate_system=1, trace_options=None, model_options=None)[源代码]

Trace field line passing trough the given point. Output:

coords - array of field line Cartesian coordinates. field - array of field vectors in the requested in the Cartesian

coordinate frame.

参数
  • - MJD2000 time used by the field model. (time) --

  • - stating point (point) --

  • - options used by the field line tracing. (trace_options) --

  • - dictionary of model options passed to the model.eval() (model_options) -- method.

geoist.magmod.magnetic_model.loader_emm module

geoist.magmod.magnetic_model.loader_emm.load_coeff_emm(path_static, path_secvar)[源代码]

Load coefficients from a EMM coefficient files.

geoist.magmod.magnetic_model.loader_emm.load_model_emm(path_static, path_secvar)[源代码]

Load model from a EMM coefficient files.

geoist.magmod.magnetic_model.loader_igrf module

geoist.magmod.magnetic_model.loader_igrf.load_coeff_igrf(path)[源代码]

Load coefficients from an IGRF file.

geoist.magmod.magnetic_model.loader_igrf.load_model_igrf(path)[源代码]

Load model from an IGRF coefficient file.

Note: IGRF file format was discontinued after IGRF11. Starting by IGRF12 the IRFF models uses SHC format which is loaded by the SHC file loader.

geoist.magmod.magnetic_model.loader_mio module

geoist.magmod.magnetic_model.loader_mio.convert_external_mio_coeff(degree, indices, coefficients, height)[源代码]

Convert external coefficients to internal ones.

geoist.magmod.magnetic_model.loader_mio.load_coeff_swarm_mio_external(path, above_ionosphere=True)[源代码]

Load external model coefficients from a Swarm MIO_SHA_2* product file. Use the above_ionosphere to pick the right model variant.

geoist.magmod.magnetic_model.loader_mio.load_coeff_swarm_mio_internal(path)[源代码]

Load internal model coefficients and other parameters from a Swarm MIO_SHA_2* product file.

geoist.magmod.magnetic_model.loader_mio.load_model_swarm_mio_external(path, above_ionosphere=None)[源代码]

Load external (primary field) model from a Swarm MIO_SHA_2* product.

geoist.magmod.magnetic_model.loader_mio.load_model_swarm_mio_internal(path)[源代码]

Load internal (secondary field) model from a Swarm MIO_SHA_2* product.

geoist.magmod.magnetic_model.loader_shc module

geoist.magmod.magnetic_model.loader_shc.load_coeff_shc(path, interpolate_in_decimal_years=False, **kwargs)[源代码]

Load coefficients from an SHC file.

The interpolate_in_decimal_years flag forces interpolation of time dependent models to be performed in the decimal years rather then in the default.

geoist.magmod.magnetic_model.loader_shc.load_coeff_shc_combined(*paths, **kwargs)[源代码]

Load coefficients combined from multiple SHC files.

geoist.magmod.magnetic_model.loader_shc.load_model_shc(path, **kwargs)[源代码]

Load model from an SHC file.

geoist.magmod.magnetic_model.loader_shc.load_model_shc_combined(*paths, **kwargs)[源代码]

Load model with coefficients combined from multiple SHC files.

geoist.magmod.magnetic_model.loader_wmm module

geoist.magmod.magnetic_model.loader_wmm.load_coeff_wmm(path)[源代码]

Load coefficients from a WMM COF file.

geoist.magmod.magnetic_model.loader_wmm.load_model_wmm(path)[源代码]

Load model from a WMM COF file.

geoist.magmod.magnetic_model.model module

class geoist.magmod.magnetic_model.model.DipoleSphericalHarmomicGeomagneticModel(coefficients, north_pole)[源代码]

基类:geoist.magmod.magnetic_model.model.SphericalHarmomicGeomagneticModel

Earth magnetic field model calculated by the Spherical Harmonic Expansion in the dipole coordinates. The dipole coordinates are defined north latitude and longitude of the dipole axis.

class geoist.magmod.magnetic_model.model.GeomagneticModel[源代码]

基类:object

Abstract base class of the Earth magnetic field model.

eval(time, location, input_coordinate_system=1, output_coordinate_system=1, **options)[源代码]

Evaluate magnetic field for the given MJD2000 times and coordinates.

parameters = ('time', 'location')
property validity

Get model's validity range as a tuple of two MJD2000 times. In case of an unconstrained validity rage (-inf, +inf) tuple is returned.

class geoist.magmod.magnetic_model.model.SphericalHarmomicGeomagneticModel(coefficients)[源代码]

基类:geoist.magmod.magnetic_model.model.GeomagneticModel

Earth magnetic field model calculated by the Spherical Harmonic Expansion.

property degree

Get maximum degree of the model.

eval(time, location, input_coordinate_system=1, output_coordinate_system=1, **options)[源代码]

Evaluate magnetic field for the given MJD2000 times and coordinates.

property min_degree

Get minimum degree of the model.

property validity

Get model's validity range as a tuple of two MJD2000 times. In case of an unconstrained validity rage (-inf, +inf) tuple is returned.

geoist.magmod.magnetic_model.model_composed module

geoist.magmod.magnetic_model.model_composed.Component

geoist.magmod.magnetic_model.model_composed._Component 的别名

class geoist.magmod.magnetic_model.model_composed.ComposedGeomagneticModel(*models)[源代码]

基类:geoist.magmod.magnetic_model.model.GeomagneticModel

Composed Earth magnetic field model aggregating multiple models into one.

eval(time, location, input_coordinate_system=1, output_coordinate_system=1, **options)[源代码]

Evaluate magnetic field for the given MJD2000 times and coordinates.

property parameters

required parameters.

push(model, scale=1.0, **parameters)[源代码]

Add model.

property validity

Get model's validity range as a tuple of two MJD2000 times. In case of an unconstrained validity rage (-inf, +inf) tuple is returned.

geoist.magmod.magnetic_model.model_mio module

class geoist.magmod.magnetic_model.model_mio.DipoleMIOGeomagneticModel(coefficients, north_pole, wolf_ratio=0.01485, height=110.0, earth_radius=6371.2)[源代码]

基类:geoist.magmod.magnetic_model.model.DipoleSphericalHarmomicGeomagneticModel

Swarm MIO model calculated by the Spherical Harmonic Expansion in the dipole coordinates. The dipole coordinates are defined by the north pole latitude and longitude. The model requires time dependent F10.7 index values.

Options:

coefficients - spherical harmonic coefficients north_pole - a tuple of dipole north pole lat/lon coordinates

or callable returning a tuple of dipole north pole lat/lon coordinates for a given MJD2000 time.

wolf_ratio - Wolf ratio (F10.7 scale) height - radius of the ionosphere (a + h) earth_radius - mean Earth radius used by the MIO model.

eval(time, location, input_coordinate_system=1, output_coordinate_system=1, **options)[源代码]

Evaluate magnetic field for the given MJD2000 times and coordinates.

parameters = ('time', 'location', 'f107', 'subsolar_point')
class geoist.magmod.magnetic_model.model_mio.DipoleMIOPrimaryGeomagneticModel(model_below_ionosphere, model_above_ionosphere, height=110.0, earth_radius=6371.2)[源代码]

基类:geoist.magmod.magnetic_model.model.GeomagneticModel

Composed model switching between MIO primary fields evaluation above and below the Ionosphere.

property degree

Get maximum degree of the model.

eval(time, location, input_coordinate_system=1, output_coordinate_system=1, **options)[源代码]

Evaluate magnetic field for the given MJD2000 times and coordinates.

property min_degree

Get minimum degree of the model.

parameters = ('time', 'location', 'f107', 'subsolar_point')
property validity

Get model's validity range as a tuple of two MJD2000 times. In case of an unconstrained validity rage (-inf, +inf) tuple is returned.

geoist.magmod.magnetic_model.parser_emm module

geoist.magmod.magnetic_model.parser_emm.combine_emm_coefficients(data_static, data_secvar)[源代码]

Combine coefficient read from the separate EMM files.

geoist.magmod.magnetic_model.parser_emm.combine_emm_variable(data_static, data_secvar)[源代码]

Combine EMM variable coefficient.

geoist.magmod.magnetic_model.parser_emm.extract_emm_constant(data_static, data_secvar)[源代码]

Extract EMM constant coefficient.

geoist.magmod.magnetic_model.parser_emm.parse_emm_coefficients(lines, data)[源代码]

Parse EMM coefficients.

geoist.magmod.magnetic_model.parser_emm.parse_emm_file(file_in)[源代码]

Parse EMM file format and return a dictionary containing the parsed model data.

geoist.magmod.magnetic_model.parser_emm.parse_emm_header(lines)[源代码]

Parse EMM file header.

geoist.magmod.magnetic_model.parser_igrf module

geoist.magmod.magnetic_model.parser_igrf.parse_igrf_coefficients(lines)[源代码]

Parse IGRF coefficients.

geoist.magmod.magnetic_model.parser_igrf.parse_igrf_file(file_in)[源代码]

Parse IGRF file format and return a dictionary containing the parsed model data.

geoist.magmod.magnetic_model.parser_igrf.parse_igrf_header(line)[源代码]

Parse IGRF header with the column labels.

geoist.magmod.magnetic_model.parser_igrf.parse_igrf_times(line)[源代码]

Parse SHC times.

geoist.magmod.magnetic_model.parser_igrf.strip_igrf_comments(file_in)[源代码]

Strip initial comments and empty lines from a text file stream.

geoist.magmod.magnetic_model.parser_mio module

geoist.magmod.magnetic_model.parser_mio.parse_swarm_mio_coefficients(lines, data)[源代码]

Parse the Swarm MIO_SHA_2* coefficients.

geoist.magmod.magnetic_model.parser_mio.parse_swarm_mio_file(file_in)[源代码]

Parse Swarm MIO_SHA_2* product file format and return a dictionary containing the parsed model data.

geoist.magmod.magnetic_model.parser_mio.parse_swarm_mio_header(line)[源代码]

Parse the Swarm MIO_SHA_2* file header.

geoist.magmod.magnetic_model.parser_shc module

geoist.magmod.magnetic_model.parser_shc.parse_shc_file(file_in)[源代码]

Parse SHC file and return a dictionary containing the parsed model data.

geoist.magmod.magnetic_model.parser_shc.parse_shc_header(file_in)[源代码]

Parse SHC file header and return a dictionary containing the parsed model info.

geoist.magmod.magnetic_model.parser_wmm module

geoist.magmod.magnetic_model.parser_wmm.parse_wmm_coefficients(lines, data)[源代码]

Parse the WMM COF coefficients.

geoist.magmod.magnetic_model.parser_wmm.parse_wmm_file(file_in)[源代码]

Parse World Magnetic Model COF file format and return a dictionary containing the parsed model data.

geoist.magmod.magnetic_model.parser_wmm.parse_wmm_header(line)[源代码]

Parse the WMM COF file header.

geoist.magmod.magnetic_model.util module

geoist.magmod.magnetic_model.util.parse_file(parser, file_, *args, **kwargs)[源代码]

Module contents