Module: GeomagnetismHeader¶
Defines
- 
_POSIX_C_SOURCE¶
- 
GEOMAGHEADER_H¶
- 
READONLYMODE¶
- 
MAXLINELENGTH¶
- 
NOOFPARAMS¶
- 
NOOFCOEFFICIENTS¶
- 
_DEGREE_NOT_FOUND¶
- 
CALCULATE_NUMTERMS(N)¶
- 
INCL_ERROR_BASE¶
- 
DECL_ERROR_OFFSET_BASE¶
- 
F_ERROR_BASE¶
- 
DECL_ERROR_SLOPE_BASE¶
- 
WMM_ERROR_MULTIPLIER¶
- 
IGRF_ERROR_MULTIPLIER¶
- 
WMM_UNCERTAINTY_F¶
- 
WMM_UNCERTAINTY_H¶
- 
WMM_UNCERTAINTY_X¶
- 
WMM_UNCERTAINTY_Y¶
- 
WMM_UNCERTAINTY_Z¶
- 
WMM_UNCERTAINTY_I¶
- 
WMM_UNCERTAINTY_D_OFFSET¶
- 
WMM_UNCERTAINTY_D_COEF¶
- 
M_PI¶
- 
RAD2DEG(rad)¶
- 
DEG2RAD(deg)¶
- 
ATanH(x)¶
- 
TRUE¶
- 
FALSE¶
- 
MAG_PS_MIN_LAT_DEGREE¶
- 
MAG_PS_MAX_LAT_DEGREE¶
- 
MAG_UTM_MIN_LAT_DEGREE¶
- 
MAG_UTM_MAX_LAT_DEGREE¶
- 
MAG_GEO_POLE_TOLERANCE¶
- 
MAG_USE_GEOID¶
- 
LAT_BOUND_MIN¶
- 
LAT_BOUND_MAX¶
- 
LON_BOUND_MIN¶
- 
LON_BOUND_MAX¶
- 
ALT_BOUND_MIN¶
- 
NO_ALT_MAX¶
- 
USER_GAVE_UP¶
- 
WGS84ON¶
- 
MSLON¶
- 
MODEL_RELEASE_DATE¶
- 
VERSIONDATE_LARGE¶
Enums
- 
enum MAGenum_Comp¶
- Values: - 
enumerator DECLINATION¶
 - 
enumerator INCLINATION¶
 - 
enumerator HOR_INTENSITY¶
 - 
enumerator TOTAL_INTENSITY¶
 - 
enumerator X_COMPONENT¶
 - 
enumerator Y_COMPONENT¶
 - 
enumerator Z_COMPONENT¶
 - 
enumerator ALL¶
 
- 
enumerator DECLINATION¶
- 
enum PARAMS¶
- Values: - 
enumerator SHDF¶
 - 
enumerator MODELNAME¶
 - 
enumerator PUBLISHER¶
 - 
enumerator RELEASEDATE¶
 - 
enumerator DATACUTOFF¶
 - 
enumerator MODELSTARTYEAR¶
 - 
enumerator MODELENDYEAR¶
 - 
enumerator EPOCH¶
 - 
enumerator INTSTATICDEG¶
 - 
enumerator INTSECVARDEG¶
 - 
enumerator EXTSTATICDEG¶
 - 
enumerator EXTSECVARDEG¶
 - 
enumerator GEOMAGREFRAD¶
 - 
enumerator NORMALIZATION¶
 - 
enumerator SPATBASFUNC¶
 
- 
enumerator SHDF¶
Functions
- 
int MAG_Geomag(MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_GeoMagneticElements *GeoMagneticElements)¶
- 
void MAG_Gradient(MAGtype_Ellipsoid Ellip, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_Gradient *Gradient)¶
- 
int MAG_robustReadMagneticModel_Large(char *filename, char *filenameSV, MAGtype_MagneticModel **MagneticModel)¶
- 
int MAG_robustReadMagModels(char *filename, MAGtype_MagneticModel *(*magneticmodels)[1], int array_size)¶
- 
int MAG_SetDefaults(MAGtype_Ellipsoid *Ellip, MAGtype_Geoid *Geoid)¶
- 
void MAG_Error(int control)¶
- 
int MAG_GetUserGrid(MAGtype_CoordGeodetic *minimum, MAGtype_CoordGeodetic *maximum, double *step_size, double *a_step_size, double *step_time, MAGtype_Date *StartDate, MAGtype_Date *EndDate, int *ElementOption, int *PrintOption, char *OutputFile, MAGtype_Geoid *Geoid)¶
- 
int MAG_GetUserInput(MAGtype_MagneticModel *MagneticModel, MAGtype_Geoid *Geoid, MAGtype_CoordGeodetic *CoordGeodetic, MAGtype_Date *MagneticDate)¶
- 
void MAG_PrintGradient(MAGtype_Gradient Gradient)¶
- 
void MAG_PrintUserData(MAGtype_GeoMagneticElements GeomagElements, MAGtype_CoordGeodetic SpaceInput, MAGtype_Date TimeInput, MAGtype_MagneticModel *MagneticModel, MAGtype_Geoid *Geoid)¶
- 
int MAG_ValidateDMSstring(char *input, int min, int max, char *Error)¶
- 
int MAG_Warnings(int control, double value, MAGtype_MagneticModel *MagneticModel)¶
- 
MAGtype_LegendreFunction *MAG_AllocateLegendreFunctionMemory(int NumTerms)¶
- 
MAGtype_MagneticModel *MAG_AllocateModelMemory(int NumTerms)¶
- 
MAGtype_SphericalHarmonicVariables *MAG_AllocateSphVarMemory(int nMax)¶
- 
void MAG_AssignHeaderValues(MAGtype_MagneticModel *model, char values[][MAXLINELENGTH])¶
- 
void MAG_AssignMagneticModelCoeffs(MAGtype_MagneticModel *Assignee, MAGtype_MagneticModel *Source, int nMax, int nMaxSecVar)¶
- 
int MAG_FreeMemory(MAGtype_MagneticModel *MagneticModel, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_LegendreFunction *LegendreFunction)¶
- 
int MAG_FreeLegendreMemory(MAGtype_LegendreFunction *LegendreFunction)¶
- 
int MAG_FreeMagneticModelMemory(MAGtype_MagneticModel *MagneticModel)¶
- 
int MAG_FreeSphVarMemory(MAGtype_SphericalHarmonicVariables *SphVar)¶
- 
void MAG_PrintWMMFormat(char *filename, MAGtype_MagneticModel *MagneticModel)¶
- 
void MAG_PrintEMMFormat(char *filename, char *filenameSV, MAGtype_MagneticModel *MagneticModel)¶
- 
void MAG_PrintSHDFFormat(char *filename, MAGtype_MagneticModel *(*MagneticModel)[1], int epochs)¶
- 
int MAG_readMagneticModel(char *filename, MAGtype_MagneticModel *MagneticModel)¶
- 
int MAG_readMagneticModel_Large(char *filename, char *filenameSV, MAGtype_MagneticModel *MagneticModel)¶
- 
int MAG_readMagneticModel_SHDF(char *filename, MAGtype_MagneticModel *(*magneticmodels)[1], int array_size)¶
- 
char *MAG_Trim(char *str)¶
- 
void MAG_BaseErrors(double DeclCoef, double DeclBaseline, double InclOffset, double FOffset, double Multiplier, double H, double *DeclErr, double *InclErr, double *FErr)¶
- 
int MAG_CalculateGeoMagneticElements(MAGtype_MagneticResults *MagneticResultsGeo, MAGtype_GeoMagneticElements *GeoMagneticElements)¶
- 
void MAG_CalculateGradientElements(MAGtype_MagneticResults GradResults, MAGtype_GeoMagneticElements MagneticElements, MAGtype_GeoMagneticElements *GradElements)¶
- 
int MAG_CalculateSecularVariationElements(MAGtype_MagneticResults MagneticVariation, MAGtype_GeoMagneticElements *MagneticElements)¶
- 
int MAG_CalculateGridVariation(MAGtype_CoordGeodetic location, MAGtype_GeoMagneticElements *elements)¶
- 
void MAG_CartesianToGeodetic(MAGtype_Ellipsoid Ellip, double x, double y, double z, MAGtype_CoordGeodetic *CoordGeodetic)¶
- 
MAGtype_CoordGeodetic MAG_CoordGeodeticAssign(MAGtype_CoordGeodetic CoordGeodetic)¶
- 
int MAG_DateToYear(MAGtype_Date *Calendar_Date, char *Error)¶
- 
void MAG_DegreeToDMSstring(double DegreesOfArc, int UnitDepth, char *DMSstring)¶
- 
void MAG_DMSstringToDegree(char *DMSstring, double *DegreesOfArc)¶
- 
void MAG_ErrorCalc(MAGtype_GeoMagneticElements B, MAGtype_GeoMagneticElements *Errors)¶
- 
int MAG_GeodeticToSpherical(MAGtype_Ellipsoid Ellip, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_CoordSpherical *CoordSpherical)¶
- 
MAGtype_GeoMagneticElements MAG_GeoMagneticElementsAssign(MAGtype_GeoMagneticElements Elements)¶
- 
MAGtype_GeoMagneticElements MAG_GeoMagneticElementsScale(MAGtype_GeoMagneticElements Elements, double factor)¶
- 
MAGtype_GeoMagneticElements MAG_GeoMagneticElementsSubtract(MAGtype_GeoMagneticElements minuend, MAGtype_GeoMagneticElements subtrahend)¶
- 
int MAG_GetTransverseMercator(MAGtype_CoordGeodetic CoordGeodetic, MAGtype_UTMParameters *UTMParameters)¶
- 
int MAG_GetUTMParameters(double Latitude, double Longitude, int *Zone, char *Hemisphere, double *CentralMeridian)¶
- 
int MAG_isNaN(double d)¶
- 
int MAG_RotateMagneticVector(MAGtype_CoordSpherical, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticResults MagneticResultsSph, MAGtype_MagneticResults *MagneticResultsGeo)¶
- 
void MAG_SphericalToCartesian(MAGtype_CoordSpherical CoordSpherical, double *x, double *y, double *z)¶
- 
void MAG_SphericalToGeodetic(MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, MAGtype_CoordGeodetic *CoordGeodetic)¶
- 
void MAG_TMfwd4(double Eps, double Epssq, double K0R4, double K0R4oa, double Acoeff[], double Lam0, double K0, double falseE, double falseN, int XYonly, double Lambda, double Phi, double *X, double *Y, double *pscale, double *CoM)¶
- 
int MAG_YearToDate(MAGtype_Date *Date)¶
- 
int MAG_AssociatedLegendreFunction(MAGtype_CoordSpherical CoordSpherical, int nMax, MAGtype_LegendreFunction *LegendreFunction)¶
- 
int MAG_CheckGeographicPole(MAGtype_CoordGeodetic *CoordGeodetic)¶
- 
int MAG_ComputeSphericalHarmonicVariables(MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, int nMax, MAGtype_SphericalHarmonicVariables *SphVariables)¶
- 
void MAG_GradY(MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_GeoMagneticElements GeoMagneticElements, MAGtype_GeoMagneticElements *GradYElements)¶
- 
void MAG_GradYSummation(MAGtype_LegendreFunction *LegendreFunction, MAGtype_MagneticModel *MagneticModel, MAGtype_SphericalHarmonicVariables SphVariables, MAGtype_CoordSpherical CoordSpherical, MAGtype_MagneticResults *GradY)¶
- 
int MAG_PcupHigh(double *Pcup, double *dPcup, double x, int nMax)¶
- 
int MAG_PcupLow(double *Pcup, double *dPcup, double x, int nMax)¶
- 
int MAG_SecVarSummation(MAGtype_LegendreFunction *LegendreFunction, MAGtype_MagneticModel *MagneticModel, MAGtype_SphericalHarmonicVariables SphVariables, MAGtype_CoordSpherical CoordSpherical, MAGtype_MagneticResults *MagneticResults)¶
- 
int MAG_SecVarSummationSpecial(MAGtype_MagneticModel *MagneticModel, MAGtype_SphericalHarmonicVariables SphVariables, MAGtype_CoordSpherical CoordSpherical, MAGtype_MagneticResults *MagneticResults)¶
- 
int MAG_Summation(MAGtype_LegendreFunction *LegendreFunction, MAGtype_MagneticModel *MagneticModel, MAGtype_SphericalHarmonicVariables SphVariables, MAGtype_CoordSpherical CoordSpherical, MAGtype_MagneticResults *MagneticResults)¶
- 
int MAG_SummationSpecial(MAGtype_MagneticModel *MagneticModel, MAGtype_SphericalHarmonicVariables SphVariables, MAGtype_CoordSpherical CoordSpherical, MAGtype_MagneticResults *MagneticResults)¶
- 
int MAG_TimelyModifyMagneticModel(MAGtype_Date UserDate, MAGtype_MagneticModel *MagneticModel, MAGtype_MagneticModel *TimedMagneticModel)¶
- 
int MAG_ConvertGeoidToEllipsoidHeight(MAGtype_CoordGeodetic *CoordGeodetic, MAGtype_Geoid *Geoid)¶
- 
int MAG_GetGeoidHeight(double Latitude, double Longitude, double *DeltaHeight, MAGtype_Geoid *Geoid)¶
- 
void MAG_EquivalentLatLon(double lat, double lon, double *repairedLat, double *repairedLon)¶
- 
void MAG_WMMErrorCalc(double H, MAGtype_GeoMagneticElements *Uncertainty)¶
- 
void MAG_PrintUserDataWithUncertainty(MAGtype_GeoMagneticElements GeomagElements, MAGtype_GeoMagneticElements Errors, MAGtype_CoordGeodetic SpaceInput, MAGtype_Date TimeInput, MAGtype_MagneticModel *MagneticModel, MAGtype_Geoid *Geoid)¶
- 
void MAG_GetDeg(char *Query_String, double *latitude, double bounds[2])¶
- 
int MAG_GetAltitude(char *Query_String, MAGtype_Geoid *Geoid, MAGtype_CoordGeodetic *coords, int bounds[2], int AltitudeSetting)¶
- 
struct MAGtype_MagneticModel¶
- #include <GeomagnetismHeader.h>structure definition Public Members - 
double EditionDate¶
- variable 
 - 
double epoch¶
- Base time of Geomagnetic model epoch (yrs) 
 - 
char ModelName[32]¶
- variable 
 - 
double *Main_Field_Coeff_G¶
- C - Gauss coefficients of main geomagnetic model (nT) Index is (n * (n + 1) / 2 + m) 
 - 
double *Main_Field_Coeff_H¶
- C - Gauss coefficients of main geomagnetic model (nT) 
 - 
double *Secular_Var_Coeff_G¶
- CD - Gauss coefficients of secular geomagnetic model (nT/yr) 
 - 
double *Secular_Var_Coeff_H¶
- CD - Gauss coefficients of secular geomagnetic model (nT/yr) 
 - 
int nMax¶
- Maximum degree of spherical harmonic model 
 - 
int nMaxSecVar¶
- Maximum degree of spherical harmonic secular model 
 - 
int SecularVariationUsed¶
- Whether or not the magnetic secular variation vector will be needed by program 
 - 
double CoefficientFileEndDate¶
- variable 
 
- 
double EditionDate¶
- 
struct MAGtype_Ellipsoid¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_CoordGeodetic¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_CoordSpherical¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_Date¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_LegendreFunction¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_MagneticResults¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_SphericalHarmonicVariables¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_GeoMagneticElements¶
- #include <GeomagnetismHeader.h>structure definition Public Members - 
double Decl¶
- Angle between the magnetic field vector and true north, positive east 
 
 - 
double Incl¶
- Angle between the magnetic field vector and the horizontal plane, positive down 
 
 - 
double F¶
- Magnetic Field Strength 
 
 - 
double H¶
- Horizontal Magnetic Field Strength 
 
 - 
double X¶
- Northern component of the magnetic field vector 
 
 - 
double Y¶
- Eastern component of the magnetic field vector 
 
 - 
double Z¶
- Downward component of the magnetic field vector 
 
 - 
double GV¶
- The Grid Variation 
 
 - 
double Decldot¶
- Yearly Rate of change in declination 
 
 - 
double Incldot¶
- Yearly Rate of change in inclination 
 
 - 
double Fdot¶
- Yearly rate of change in Magnetic field strength 
 
 - 
double Hdot¶
- Yearly rate of change in horizontal field strength 
 
 - 
double Xdot¶
- Yearly rate of change in the northern component 
 
 - 
double Ydot¶
- Yearly rate of change in the eastern component 
 
 - 
double Zdot¶
- Yearly rate of change in the downward component 
 
 - 
double GVdot¶
- Yearly rate of change in grid variation 
 
 
- 
double Decl¶
- 
struct MAGtype_Geoid¶
- #include <GeomagnetismHeader.h>structure definition Public Members - 
int NumbGeoidCols¶
- 360 degrees of longitude at 15 minute spacing 
 - 
int NumbGeoidRows¶
- 180 degrees of latitude at 15 minute spacing 
 - 
int NumbHeaderItems¶
- min, max lat, min, max long, lat, long spacing 
 - 
int ScaleFactor¶
- 4 grid cells per degree at 15 minute spacing 
 - 
float *GeoidHeightBuffer¶
- variable 
 - 
int NumbGeoidElevs¶
- variable 
 - 
int Geoid_Initialized¶
- indicates successful initialization 
 - 
int UseGeoid¶
- Is the Geoid being used? 
 
- 
int NumbGeoidCols¶
- 
struct MAGtype_Gradient¶
- #include <GeomagnetismHeader.h>structure definition Public Members - 
int UseGradient¶
- variable 
 - 
MAGtype_GeoMagneticElements GradPhi¶
- phi 
 - 
MAGtype_GeoMagneticElements GradLambda¶
- lambda 
 - 
MAGtype_GeoMagneticElements GradZ¶
- variable 
 
- 
int UseGradient¶
- 
struct MAGtype_CoordGeodeticStr¶
- #include <GeomagnetismHeader.h>structure definition 
- 
struct MAGtype_UTMParameters¶
- #include <GeomagnetismHeader.h>structure definition