/*-----------------------------------------------------------------------------
;
; NAME:
; AACGM_v2_Convert
;
; PURPOSE:
; Main function called by many SD plotting routines that are written
; in C.
;
; CALLING SEQUENCE:
; err = AACGM_v2_Convert(in_lat, in_lon, height,
; out_lat, out_lon, r, code);
;
; Input Arguments:
; int_lat - double precision input latitude in degrees
; int_lon - double precision input longitude in degrees
; height - altitude in km
; code - bitwise code for passing options into converter
; G2A - geographic (geodetic) to AACGM-v2
; A2G - AACGM-v2 to geographic (geodetic)
; TRACE - use field-line tracing, not coefficients
; ALLOWTRACE - use trace only above 2000 km
; BADIDEA - use coefficients above 2000 km
; GEOCENTRIC - assume inputs are geocentric w/ RE=6371.2
;
; Output Arguments:
; out_lat - output latitude in degrees
; out_lon - output longitude in degrees
; r - geocentric radial distance in Re
;
; Return Value:
; error code
;
;
; NOTES:
;
; All AACGM-v2 conversions are done in geocentric coordinates using a
; value of 6371.2 km for the Earth radius.
;
; For G2A conversion inputs are geographic latitude, longitude and
; height (glat,glon,height), specified as either geocentric or
; geodetic (default). For geodetic inputs a conversion to geocentric
; coordinates is performed, which changes the values of
; glat,glon,height. The output is AACGM-v2 latitude, longitude and
; the geocentric radius (mlat,mlon,r) using the geocentric height
; in units of RE.
;
; For A2G conversion inputs are AACGM-v2 latitude, longitude and the
; geocentric height (mlat,mlon,height). The latter can be obtained
; from the r output of the G2A conversion. The output is geographic
; latitude, longitude and height (glat,glon,height). If the
; gedodetic option is desired (default) a conversion of the outputs
; is performed, which changes the values of glat,glon,height.
;
;+-----------------------------------------------------------------------------
*/
Discussion
Topic: Possible incorrect usage of AACGMv2 library (not using correct flags for calculations).
Description
AACGMv2 is used in
invmag.c, called by themake_gridbinary.AACGM_v2_Convertcan do conversions to/from AACGM coordinates, using either geodetic (default) or geocentric as the coordinate being converted from/to. Ininvmag.c, the usage ofAACGM_v2_Convertuses the geodetic option (code & 16 == 1indicating geocentric, called in this case withcode=0), however it is clear from the code that geocentric coordinates are passed in.Category
Code
rst/codebase/superdarn/src.lib/tk/rpos.1.7/src/invmag.c
Lines 394 to 420 in a224011
Documentation
AACGM_v2_Convert docstring: