GXIGRF class

class GXIGRF(handle=0)

GXIGRF class.

International Geomagnetic Reference Field Methods to work with GXIGRF objects. The GXIGRF object contains data for the GXIGRF model of the geomagnetic reference field.

calc(el, lon, lat, str_val, inc, dec)

Calculate GXIGRF data for a given GXIGRF model.

Parameters:
  • el (float) – Elevation (metres)
  • lon (float) – Longitude (-180 to 180)
  • lat (float) – Latitude (-90 to 90) Returns
  • str_val (float_ref) – Field strength
  • inc (float_ref) – Field inclination
  • dec (float_ref) – Field declination

New in version 5.0.

License: Geosoft End-User License

Note: Calculate GXIGRF data (total field, inclination, and declination) for a given GXIGRF model. The model used will be the same as that obtained with create.

calc_vv(gv_vel, gv_vlon, gv_vlat, gv_vfs, gv_vinc, gv_vdec)

Calculate GXIGRF data GXVV‘s for a given GXIGRF model.

Parameters:
  • gv_vel (GXVV) – Input elevation data (metres)
  • gv_vlon (GXVV) – Input longitude data (-180 to 180)
  • gv_vlat (GXVV) – Input latitude data (-90 to 90)
  • gv_vfs (GXVV) – Output total field
  • gv_vinc (GXVV) – Output inclination
  • gv_vdec (GXVV) – Output declination

New in version 5.0.

License: Geosoft End-User License

Note: Calculate GXIGRF data (total field, inclination, and declination) for a given GXIGRF model. The model used will be the same as that obtained with create. All of the GXVV‘s should be the same length. The function will abort if they are not.

No assumption is made on what data types are contained by any of the GXVV‘s. However, all total field, inclination, and declination values are internally calculated as real data. These values will be converted to the types contained in the output GXVV‘s.

classmethod create(date, year, filename)

Create an GXIGRF.

Parameters:
  • date (float) – Date required
  • year (int) – Year of the GXIGRF model to use
  • filename (str) – Name of the GXIGRF reference data file
Returns:

GXIGRF Object

Return type:

GXIGRF

New in version 5.0.

License: Geosoft End-User License

Note: If the year of the GXIGRF model is dummy, then the GXIGRF year nearest to the line’s date will be used. Otherwise, the specified year is used.

classmethod date_range(file_name, min, max)

Determine the range of years covered by an GXIGRF or DGRF file

Parameters:
  • file_name (str) – Model data file name
  • min (float_ref) – Minimum year (rMAX if none found)
  • max (float_ref) – Maximum year (rMIN if none found)

New in version 6.1.

License: Geosoft End-User License

Note: This is useful when using a DGRF file, because the system is set up only to calculate for years within the date range, and will return an error otherwise.

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
classmethod null()

A null (undefined) instance of GXIGRF

Returns:A null GXIGRF
Return type:GXIGRF