aacgm2._aacgmv2¶
This submodule contains the interface to the AACGM-v2 C library. For the user-friendly wrapper, see aacgm2.convert()
.
This module contains the interface to the AACGM-v2 C library.
-
aacgm2._aacgmv2.
aacgmConvert
(in_lat, in_lon, height, code) → out_lat, out_lon, r¶ Converts between geographic and magnetic coordinates.
Parameters: - in_lat (float [-90, 90]) – Input latitude
- in_lon (float [-180, 180]) – Input longitude
- height (float) – Input altitude
- code (int) – Bitwise code for passing options into converter. The codes and their names (defined in this module) are given in the table below.
Returns: - out_lat (float) – Converted latitude
- out_lon (float) – Converted longitude
- r (float) – Not used, always 1.0
Notes
The bitwise codes are:
Code Name Description 0 G2A Convert geographic to AACGM-v2. 1 A2G Convert AACGM-v2 to geographic. 2 TRACE Use field-line tracing instead of coefficients. More precise, but significantly slower. 4 ALLOWTRACE Automatically use field-line tracing above 2000 km. If not set, cause exception to be thrown for these altitudes unless TRACE or BADIDEA is set. 8 BADIDEA Allow use of coefficients above 2000 km (bad idea!) 16 GEOCENTRIC Assume inputs are geocentric with Earth radius 6371.2 km. For example, to convert from AACGM-v2 to geographpic using field-line tracing, use either of the following:
>>> aacgmConvert(in_lat, in_lon, height, A2G | TRACE) >>> aacgmConvert(in_lat, in_lon, height, 1 | 2) >>> aacgmConvert(in_lat, in_lon, height, 3)
-
aacgm2._aacgmv2.
setDateTime
(year, month, day, hour, minute, second)¶ Sets the date and time for the IGRF magnetic field.
Parameters: - year (int [1900, 2020)) –
- month (int [1, 12]) –
- day (int [1, 31]) –
- hour (int [0, 24]) –
- minute (int [0, 60]) –
- second (int [0, 60]) –