Geo Stars Library
0.9.3
Geodetic and Astrometry library
|
This file contains the source for deriving geomagnetic variables from geodetic coordinates. More...
Go to the source code of this file.
Macros | |
#define | wmmData wmmDta2010 |
#define | EPOCH 2010.0 |
#define | snorm p |
#define | MAXDEG 12 |
Functions | |
static void | geoMagInit (void) |
int | geoMag (double alt, double glat, double glon, double time, double *dec, double *dip, double *ti, double *gv, double *adec, double *adip, double *ati, double *x, double *y, double *z, double *h, double *ax, double *ay, double *az, double *ah) |
This routine computes all of the relevant geomagnetic data. More... | |
int | geomg1 (double alt, double glat, double glon, double time, double *dec, double *dip, double *ti, double *gv) |
int | geoMagGetDec (double lat, double lon, double hgt, int month, int day, int year, double *dec) |
This routine computes magnetic declination. More... | |
double | geoMagGetDecRet (double lat, double lon, double hgt, int month, int day, int year) |
This routine computes and returns magnetic declination for a specific date. More... | |
double | geoMagGetDecNow (double lat, double lon, double hgt) |
This routine computes magnetic declination for now time. More... | |
int | geoMagFillDec (GEO_LOCATION *l, double *dec) |
Variables | |
static WMM_DATA | wmmDta2000 [] |
This structure array contains the all of the coefficients for WMM-2000 used in this library. More... | |
static WMM_DATA | wmmDta2005 [] |
This structure array contains the all of the coefficients for WMM-2005 used in this library. More... | |
static WMM_DATA | wmmDta2010 [] |
static int | started = 0 |
static double | c [13][13] |
C - GAUSS COEFFICIENTS OF MAIN GEOMAGNETIC MODEL (NT) More... | |
static double | cd [13][13] |
CD - GAUSS COEFFICIENTS OF SECULAR GEOMAGNETIC MODEL (NT/YR) More... | |
static double | tc [13][13] |
TC - TIME ADJUSTED GEOMAGNETIC GAUSS COEFFICIENTS (NT) More... | |
static double | dp [13][13] |
DP(N,M)- THETA DERIVATIVE OF P(N,M) (UNNORMALIZED) More... | |
static double | p [13][13] |
SNORM - SCHMIDT NORMALIZATION FACTORS. More... | |
static double | sp [13] |
SP(M) - SINE OF (M*SPHERICAL COORD. LONGITUDE) More... | |
static double | cp [13] |
CP(M) - COSINE OF (M*SPHERICAL COORD. LONGITUDE) More... | |
static double | fn [13] |
static double | fm [13] |
static double | pp [13] |
PP(N) - ASSOCIATED LEGENDRE POLYNOMIALS FOR M=1 (UNNORMALIZED) More... | |
static double | k [13][13] |
static double | epoch |
static int | maxord |
MAXORD - MAXIMUM ORDER OF SPHERICAL HARMONIC MODEL. More... | |
This file contains the source for deriving geomagnetic variables from geodetic coordinates.
Definition in file geoMag.c.
#define EPOCH 2010.0 |
Definition at line 15 of file geoMag.c.
Referenced by geoMagInit().
#define MAXDEG 12 |
Definition at line 395 of file geoMag.c.
Referenced by geoMagInit().
#define snorm p |
Flag for limiting multiple initializations
Definition at line 394 of file geoMag.c.
Referenced by geoMagInit().
#define wmmData wmmDta2010 |
Definition at line 14 of file geoMag.c.
Referenced by geoMagInit().
int geoMag | ( | double | alt, |
double | glat, | ||
double | glon, | ||
double | time, | ||
double * | dec, | ||
double * | dip, | ||
double * | ti, | ||
double * | gv, | ||
double * | adec, | ||
double * | adip, | ||
double * | ati, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | h, | ||
double * | ax, | ||
double * | ay, | ||
double * | az, | ||
double * | ah | ||
) |
This routine computes all of the relevant geomagnetic data.
double | alt : in: altitude in meters |
double | glat : in: latitude in decimal degrees |
double | glon : in: longitude in decimal degrees |
double | time : in: time in decimal years |
double | *dec :out: declination in degrees |
double | *dip :out: dip in degrees |
double | *ti :out: total intensity in nT |
double | *gv :out: geomagnetic grid variation |
double | *adec :out: Annual declination in degrees |
double | *adip :out: Annual dip in degrees |
double | *ati :out: Annual total intensity in nT |
double | *x :out: X Component of the magnetic field |
double | *y :out: Y Component of the magnetic field |
double | *z :out: Z Component of the magnetic field |
double | *h :out: h Component of the magnetic field |
double | *ax :out: Annual X Component of the magnetic field |
double | *ay :out: Annual Y Component of the magnetic field |
double | *az :out: Annual Z Component of the magnetic field |
double | *ah :out: Annual H Component of the magnetic field |
GEO_OK | on success |
GEO_ERROR | on error |
{
Definition at line 523 of file geoMag.c.
References DEG_TO_MIN, DEG_TO_RAD, GEO_OK, geoMagInit(), and geomg1().
int geoMagFillDec | ( | GEO_LOCATION * | l, |
double * | dec | ||
) |
Definition at line 903 of file geoMag.c.
References GEO_LOCATION::Declination, GEO_OK, geoMagGetDec(), GEO_LOCATION::hgt, GEO_LOCATION::lat, and GEO_LOCATION::lon.
Referenced by geoInitLocation().
int geoMagGetDec | ( | double | lat, |
double | lon, | ||
double | hgt, | ||
int | month, | ||
int | day, | ||
int | year, | ||
double * | dec | ||
) |
This routine computes magnetic declination.
double | lat : in: latitude in decimal degrees |
double | lon : in: longitude in decimal degrees |
double | hgt : in: altitude in meters |
int | month : in: Month of the year |
int | day : in: Day of the month |
int | year : in: Year |
double | dec :out: declination in degrees |
Definition at line 825 of file geoMag.c.
References GEO_OK, geoMagInit(), geomg1(), and jday().
Referenced by geoMagFillDec(), and geoMagGetDecNow().
double geoMagGetDecNow | ( | double | lat, |
double | lon, | ||
double | hgt | ||
) |
This routine computes magnetic declination for now time.
double | lat : in: latitude in decimal degrees |
double | lon : in: longitude in decimal degrees |
double | hgt : in: altitude in meters |
double | dec :out: declination in degrees |
Definition at line 882 of file geoMag.c.
References geoMagGetDec().
double geoMagGetDecRet | ( | double | lat, |
double | lon, | ||
double | hgt, | ||
int | month, | ||
int | day, | ||
int | year | ||
) |
This routine computes and returns magnetic declination for a specific date.
double | lat : in: latitude in decimal degrees |
double | lon : in: longitude in decimal degrees |
double | hgt : in: altitude in meters |
int | month : in: Month of the year |
int | day : in: Day of the month |
int | year : in: Year |
double | dec :out: declination in degrees |
Definition at line 855 of file geoMag.c.
References geoMagInit(), geomg1(), and jday().
|
static |
int geomg1 | ( | double | alt, |
double | glat, | ||
double | glon, | ||
double | time, | ||
double * | dec, | ||
double * | dip, | ||
double * | ti, | ||
double * | gv | ||
) |
This is documentation that came with the WMM. It is included here for completeness.
// MAXDEG - MAXIMUM DEGREE OF SPHERICAL HARMONIC MODEL (INPUT) // TIME - COMPUTATION TIME (YRS) (INPUT) // (EG. 1 JULY 1995 = 1995.500) // ALT - GEODETIC ALTITUDE (M) (INPUT) // GLAT - GEODETIC LATITUDE (DEG.) (INPUT) // GLON - GEODETIC LONGITUDE (DEG.) (INPUT) // EPOCH - BASE TIME OF GEOMAGNETIC MODEL (YRS) // P(N,M) - ASSOCIATED LEGENDRE POLYNOMIALS (UNNORMALIZED) // DEC - GEOMAGNETIC DECLINATION (DEG.) (OUTPUT) // EAST=POSITIVE ANGLES // WEST=NEGATIVE ANGLES // DIP - GEOMAGNETIC INCLINATION (DEG.) (OUTPUT) // DOWN=POSITIVE ANGLES // UP=NEGATIVE ANGLES // TI - GEOMAGNETIC TOTAL INTENSITY (NT) (OUTPUT) // GV - GEOMAGNETIC GRID VARIATION (DEG.) (OUTPUT) // REFERENCED TO GRID NORTH // GRID NORTH REFERENCED TO 0 MERIDIAN // OF A POLAR STEREOGRAPHIC PROJECTION // (ARCTIC/ANTARCTIC ONLY) // A - SEMIMAJOR AXIS OF WGS-84 ELLIPSOID (KM) // B - SEMIMINOR AXIS OF WGS-84 ELLIPSOID (KM) // RE - MEAN RADIUS OF IAU-66 ELLIPSOID (KM) // a2, // a * a // b2, // b * b // c2, // a2 - b2 // a4, // a2 * a2 // b4, // b2 * b2 // c4, // a4 - b4 // ct, //C CT - COSINE OF (SPHERICAL COORD. LATITUDE) // st, //C ST - SINE OF (SPHERICAL COORD. LATITUDE) // r2, // r, //C R - SPHERICAL COORDINATE RADIAL POSITION (KM) // ca, //C CA - COSINE OF SPHERICAL TO GEODETIC VECTOR ROTATION ANGLE // sa, //C SA - SINE OF SPHERICAL TO GEODETIC VECTOR ROTATION ANGLE // br, //C BR - RADIAL COMPONENT OF GEOMAGNETIC FIELD (NT) // bt, //C BT - THETA COMPONENT OF GEOMAGNETIC FIELD (NT) // bp, //C BP - PHI COMPONENT OF GEOMAGNETIC FIELD (NT) // bx, //C BX - NORTH GEOMAGNETIC COMPONENT (NT) // by, //C BY - EAST GEOMAGNETIC COMPONENT (NT) // bz, //C BZ - VERTICALLY DOWN GEOMAGNETIC COMPONENT (NT) // bh; //C BH - HORIZONTAL GEOMAGNETIC COMPONENT (NT)
Definition at line 595 of file geoMag.c.
References GEO_ELLIPSOID::a, c, cd, CIRCLE, cp, DEG_TO_RAD, dp, ellips, epoch, fm, fn, GEO_B, GEO_DATUM_WE, GEO_OK, HALF_CIRCLE, k, maxord, n(), p, pp, RAD_TO_DEG, sp, and tc.
Referenced by geoMag(), geoMagGetDec(), and geoMagGetDecRet().
|
static |
C - GAUSS COEFFICIENTS OF MAIN GEOMAGNETIC MODEL (NT)
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), geomg1(), and geoSunAA().
|
static |
CD - GAUSS COEFFICIENTS OF SECULAR GEOMAGNETIC MODEL (NT/YR)
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
CP(M) - COSINE OF (M*SPHERICAL COORD. LONGITUDE)
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
DP(N,M)- THETA DERIVATIVE OF P(N,M) (UNNORMALIZED)
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
Definition at line 404 of file geoMag.c.
Referenced by geoEfg2Llh_vermeille(), geoEfg2Llh_vermeille_fast(), geoMagInit(), and geomg1().
|
static |
MAXORD - MAXIMUM ORDER OF SPHERICAL HARMONIC MODEL.
Definition at line 420 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
SNORM - SCHMIDT NORMALIZATION FACTORS.
Definition at line 404 of file geoMag.c.
Referenced by geoEfg2Llh(), geoEfg2Llh_aa(), geoEfg2Llh_aa_fast(), geoEfg2Llh_borkowski(), geoEfg2Llh_borkowski_fast(), geoEfg2Llh_bowring(), geoEfg2Llh_bowring_fast(), geoEfg2Llh_fast(), geoEfg2Llh_heikkinen(), geoEfg2Llh_hm(), geoEfg2Llh_hm_fast(), geoEfg2Llh_torge(), geoEfg2Llh_torge_fast(), geoEfg2Llh_vermeille(), geoEfg2Llh_vermeille_fast(), geoMagInit(), and geomg1().
|
static |
PP(N) - ASSOCIATED LEGENDRE POLYNOMIALS FOR M=1 (UNNORMALIZED)
Definition at line 404 of file geoMag.c.
Referenced by geoMagInit(), and geomg1().
|
static |
SP(M) - SINE OF (M*SPHERICAL COORD. LONGITUDE)
Definition at line 404 of file geoMag.c.
Referenced by geoEfg2Llh_heikkinen(), geoMagInit(), and geomg1().
|
static |
Definition at line 392 of file geoMag.c.
Referenced by geoMagInit().
|
static |
|
static |
This structure array contains the all of the coefficients for WMM-2000 used in this library.
This is documentation that came with the WMM. It is included here for completeness.
C MODEL: THE WMM SERIES GEOMAGNETIC MODELS ARE COMPOSED C OF TWO PARTS: THE MAIN FIELD MODEL, WHICH IS C VALID AT THE BASE EPOCH OF THE CURRENT MODEL AND C A SECULAR VARIATION MODEL, WHICH ACCOUNTS FOR SLOW C TEMPORAL VARIATIONS IN THE MAIN GEOMAGNETIC FIELD C FROM THE BASE EPOCH TO A MAXIMUM OF 5 YEARS BEYOND C THE BASE EPOCH. FOR EXAMPLE, THE BASE EPOCH OF C THE WMM-2005 MODEL IS 2005.0. THIS MODEL IS THEREFORE C CONSIDERED VALID BETWEEN 2005.0 AND 2010.0. THE C COMPUTED MAGNETIC PARAMETERS ARE REFERENCED TO THE C WGS-84 ELLIPSOID. C C*********************************************************************** C C ACCURACY: IN OCEAN AREAS AT THE EARTH'S SURFACE OVER THE C ENTIRE 5 YEAR LIFE OF THE DEGREE AND ORDER 12 C SPHERICAL HARMONIC MODEL WMM-2005, THE ESTIMATED C MAXIMUM RMS ERRORS FOR THE VARIOUS MAGNETIC COMPONENTS C ARE: C C DEC - 0.5 Degrees C DIP - 0.5 Degrees C TI - 280.0 nanoTeslas (nT) C GV - 0.5 Degrees C C OTHER MAGNETIC COMPONENTS THAT CAN BE DERIVED FROM C THESE FOUR BY SIMPLE TRIGONOMETRIC RELATIONS WILL C HAVE THE FOLLOWING APPROXIMATE ERRORS OVER OCEAN AREAS: C C X - 140 nT (North) C Y - 140 nT (East) C Z - 200 nT (Vertical) Positive is down C H - 200 nT (Horizontal) C C OVER LAND THE MAXIMUM RMS ERRORS ARE EXPECTED TO BE C HIGHER, ALTHOUGH THE RMS ERRORS FOR DEC, DIP, AND GV C ARE STILL ESTIMATED TO BE LESS THAN 1.0 DEGREE, FOR C THE ENTIRE 5-YEAR LIFE OF THE MODEL AT THE EARTH's C SURFACE. THE OTHER COMPONENT ERRORS OVER LAND ARE C MORE DIFFICULT TO ESTIMATE AND SO ARE NOT GIVEN. C C THE ACCURACY AT ANY GIVEN TIME FOR ALL OF THESE C GEOMAGNETIC PARAMETERS DEPENDS ON THE GEOMAGNETIC C LATITUDE. THE ERRORS ARE LEAST FROM THE EQUATOR TO C MID-LATITUDES AND GREATEST NEAR THE MAGNETIC POLES. C C IT IS VERY IMPORTANT TO NOTE THAT A DEGREE AND C ORDER 12 MODEL, SUCH AS WMM-2005, DESCRIBES ONLY C THE LONG WAVELENGTH SPATIAL MAGNETIC FLUCTUATIONS C DUE TO EARTH'S CORE. NOT INCLUDED IN THE WMM SERIES C MODELS ARE INTERMEDIATE AND SHORT WAVELENGTH C SPATIAL FLUCTUATIONS OF THE GEOMAGNETIC FIELD C WHICH ORIGINATE IN THE EARTH'S MANTLE AND CRUST. C CONSEQUENTLY, ISOLATED ANGULAR ERRORS AT VARIOUS C POSITIONS ON THE SURFACE (PRIMARILY OVER LAND, IN C CONTINENTAL MARGINS AND OVER OCEANIC SEAMOUNTS, C RIDGES AND TRENCHES) OF SEVERAL DEGREES MAY BE C EXPECTED. ALSO NOT INCLUDED IN THE MODEL ARE C NONSECULAR TEMPORAL FLUCTUATIONS OF THE GEOMAGNETIC C FIELD OF MAGNETOSPHERIC AND IONOSPHERIC ORIGIN. C DURING MAGNETIC STORMS, TEMPORAL FLUCTUATIONS CAN C CAUSE SUBSTANTIAL DEVIATIONS OF THE GEOMAGNETIC C FIELD FROM MODEL VALUES. IN ARCTIC AND ANTARCTIC C REGIONS, AS WELL AS IN EQUATORIAL REGIONS, DEVIATIONS C FROM MODEL VALUES ARE BOTH FREQUENT AND PERSISTENT. C C IF THE REQUIRED DECLINATION ACCURACY IS MORE C STRINGENT THAN THE WMM SERIES OF MODELS PROVIDE, THEN C THE USER IS ADVISED TO REQUEST SPECIAL (REGIONAL OR C LOCAL) SURVEYS BE PERFORMED AND MODELS PREPARED. C REQUESTS OF THIS NATURE SHOULD BE MADE TO NIMA C AT THE ADDRESS ABOVE.
|
static |