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
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
enum COEFFICIENTS

Values:

enumerator IE
enumerator N
enumerator M
enumerator GNM
enumerator HNM
enumerator DGNM
enumerator DHNM
enum YYYYMMDD

Values:

enumerator YEAR
enumerator MONTH
enumerator DAY

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_Grid(MAGtype_CoordGeodetic minimum, MAGtype_CoordGeodetic maximum, double cord_step_size, double altitude_step_size, double time_step, MAGtype_MagneticModel *MagneticModel, MAGtype_Geoid *Geoid, MAGtype_Ellipsoid Ellip, MAGtype_Date StartDate, MAGtype_Date EndDate, int ElementOption, int UncertaintyOption, int PrintOption, char *OutputFile)
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)
char MAG_GeomagIntroduction_WMM(MAGtype_MagneticModel *MagneticModel, char *VersionDate, char *ModelDate)
char MAG_GeomagIntroduction_EMM(MAGtype_MagneticModel *MagneticModel, char *VersionDate)
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

Public Members

double EditionDate
double epoch
char ModelName[32]
double *Main_Field_Coeff_G
double *Main_Field_Coeff_H
double *Secular_Var_Coeff_G
double *Secular_Var_Coeff_H
int nMax
int nMaxSecVar
int SecularVariationUsed
double CoefficientFileEndDate
struct MAGtype_Ellipsoid

Public Members

double a
double b
double fla
double epssq
double eps
double re
struct MAGtype_CoordGeodetic

Public Members

double lambda
double phi
double HeightAboveEllipsoid
double HeightAboveGeoid
int UseGeoid
struct MAGtype_CoordSpherical

Public Members

double lambda
double phig
double r
struct MAGtype_Date

Public Members

int Year
int Month
int Day
double DecimalYear
struct MAGtype_LegendreFunction

Public Members

double *Pcup
double *dPcup
struct MAGtype_MagneticResults

Public Members

double Bx
double By
double Bz
struct MAGtype_SphericalHarmonicVariables

Public Members

double *RelativeRadiusPower
double *cos_mlambda
double *sin_mlambda
struct MAGtype_GeoMagneticElements

Public Members

double Decl
double Incl
double F
double H
double X
double Y
double Z
double GV
double Decldot
double Incldot
double Fdot
double Hdot
double Xdot
double Ydot
double Zdot
double GVdot
struct MAGtype_Geoid

Public Members

int NumbGeoidCols
int NumbGeoidRows
int NumbHeaderItems
int ScaleFactor
float *GeoidHeightBuffer
int NumbGeoidElevs
int Geoid_Initialized
int UseGeoid
struct MAGtype_Gradient

Public Members

int UseGradient
MAGtype_GeoMagneticElements GradPhi
MAGtype_GeoMagneticElements GradLambda
MAGtype_GeoMagneticElements GradZ
struct MAGtype_CoordGeodeticStr

Public Members

char Longitude[40]
char Latitude[40]
struct MAGtype_UTMParameters

Public Members

double Easting
double Northing
int Zone
char HemiSphere
double CentralMeridian
double ConvergenceOfMeridians
double PointScale