Functions
GeomagnetismLibrary.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include "GeomagnetismHeader.h"
Include dependency graph for GeomagnetismLibrary.c:

Go to the source code of this file.

Functions

MAGtype_LegendreFunctionMAG_AllocateLegendreFunctionMemory (int NumTerms)
MAGtype_MagneticModelMAG_AllocateModelMemory (int NumTerms)
MAGtype_SphericalHarmonicVariablesMAG_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_AssociatedLegendreFunction (MAGtype_CoordSpherical CoordSpherical, int nMax, MAGtype_LegendreFunction *LegendreFunction)
int MAG_CalculateGeoMagneticElements (MAGtype_MagneticResults *MagneticResultsGeo, MAGtype_GeoMagneticElements *GeoMagneticElements)
int MAG_CalculateGridVariation (MAGtype_CoordGeodetic location, MAGtype_GeoMagneticElements *elements)
int MAG_CalculateSecularVariationElements (MAGtype_MagneticResults MagneticVariation, MAGtype_GeoMagneticElements *MagneticElements)
int MAG_CheckGeographicPole (MAGtype_CoordGeodetic *CoordGeodetic)
int MAG_ComputeSphericalHarmonicVariables (MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, int nMax, MAGtype_SphericalHarmonicVariables *SphVariables)
int MAG_ConvertGeoidToEllipsoidHeight (MAGtype_CoordGeodetic *CoordGeodetic, MAGtype_Geoid *Geoid)
int MAG_DateToYear (MAGtype_Date *CalendarDate, char *Error)
void MAG_DegreeToDMSstring (double DegreesOfArc, int UnitDepth, char *DMSstring)
void MAG_DMSstringToDegree (char *DMSstring, double *DegreesOfArc)
void MAG_Error (int control)
float MAG_FloatSwap (float f)
int MAG_FreeLegendreMemory (MAGtype_LegendreFunction *LegendreFunction)
int MAG_FreeMagneticModelMemory (MAGtype_MagneticModel *MagneticModel)
int MAG_FreeMemory (MAGtype_MagneticModel *MagneticModel, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_LegendreFunction *LegendreFunction)
int MAG_FreeSphVarMemory (MAGtype_SphericalHarmonicVariables *SphVar)
int MAG_GeodeticToSpherical (MAGtype_Ellipsoid Ellip, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_CoordSpherical *CoordSpherical)
int MAG_Geomag (MAGtype_Ellipsoid Ellip, MAGtype_CoordSpherical CoordSpherical, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticModel *TimedMagneticModel, MAGtype_GeoMagneticElements *GeoMagneticElements)
char MAG_GeomagIntroduction_EMM (MAGtype_MagneticModel *MagneticModel, char *VersionDate)
char MAG_GeomagIntroduction_WMM (MAGtype_MagneticModel *MagneticModel, char *VersionDate)
int MAG_GetGeoidHeight (double Latitude, double Longitude, double *DeltaHeight, MAGtype_Geoid *Geoid)
int MAG_GetTransverseMercator (MAGtype_CoordGeodetic CoordGeodetic, MAGtype_UTMParameters *UTMParameters)
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)
int MAG_GetUTMParameters (double Latitude, double Longitude, int *Zone, char *Hemisphere, double *CentralMeridian)
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 PrintOption, char *OutputFile)
int MAG_InitializeGeoid (MAGtype_Geoid *Geoid)
int MAG_isNaN (double d)
int MAG_PcupHigh (double *Pcup, double *dPcup, double x, int nMax)
int MAG_PcupLow (double *Pcup, double *dPcup, double x, int nMax)
void MAG_PrintEMMFormat (char *filename, char *filenameSV, MAGtype_MagneticModel *MagneticModel)
void MAG_PrintUserData (MAGtype_GeoMagneticElements GeomagElements, MAGtype_CoordGeodetic SpaceInput, MAGtype_Date TimeInput, MAGtype_MagneticModel *MagneticModel, MAGtype_Geoid *Geoid)
void MAG_PrintWMMFormat (char *filename, MAGtype_MagneticModel *MagneticModel)
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)[], int array_size)
int MAG_robustReadMagModels (char *filename, MAGtype_MagneticModel *(*magneticmodels)[], int array_size)
int MAG_robustReadMagneticModel_Large (char *filename, char *filenameSV, MAGtype_MagneticModel **MagneticModel, int array_size)
int MAG_RotateMagneticVector (MAGtype_CoordSpherical CoordSpherical, MAGtype_CoordGeodetic CoordGeodetic, MAGtype_MagneticResults MagneticResultsSph, MAGtype_MagneticResults *MagneticResultsGeo)
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_SetDefaults (MAGtype_Ellipsoid *Ellip, MAGtype_Geoid *Geoid)
void MAG_SphericalToCartesian (MAGtype_CoordSpherical CoordSpherical, double *x, double *y, double *z)
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_swab_type ()
int MAG_TimelyModifyMagneticModel (MAGtype_Date UserDate, MAGtype_MagneticModel *MagneticModel, MAGtype_MagneticModel *TimedMagneticModel)
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)
char * MAG_Trim (char *str)
int MAG_ValidateDMSstringlat (char *input, char *Error)
int MAG_ValidateDMSstringlong (char *input, char *Error)
int MAG_Warnings (int control, double value, MAGtype_MagneticModel *MagneticModel)
int MAG_YearToDate (MAGtype_Date *CalendarDate)

Function Documentation

Definition at line 1481 of file GeomagnetismLibrary.c.

Definition at line 1526 of file GeomagnetismLibrary.c.

Definition at line 1597 of file GeomagnetismLibrary.c.

void MAG_AssignHeaderValues ( MAGtype_MagneticModel model,
char  values[][MAXLINELENGTH] 
)

Definition at line 1607 of file GeomagnetismLibrary.c.

void MAG_AssignMagneticModelCoeffs ( MAGtype_MagneticModel Assignee,
MAGtype_MagneticModel Source,
int  nMax,
int  nMaxSecVar 
)

Definition at line 1628 of file GeomagnetismLibrary.c.

int MAG_AssociatedLegendreFunction ( MAGtype_CoordSpherical  CoordSpherical,
int  nMax,
MAGtype_LegendreFunction LegendreFunction 
)

Definition at line 3056 of file GeomagnetismLibrary.c.

int MAG_CalculateGeoMagneticElements ( MAGtype_MagneticResults MagneticResultsGeo,
MAGtype_GeoMagneticElements GeoMagneticElements 
)

Definition at line 2278 of file GeomagnetismLibrary.c.

Definition at line 2308 of file GeomagnetismLibrary.c.

Definition at line 2346 of file GeomagnetismLibrary.c.

Definition at line 3089 of file GeomagnetismLibrary.c.

Definition at line 3112 of file GeomagnetismLibrary.c.

Definition at line 3787 of file GeomagnetismLibrary.c.

int MAG_DateToYear ( MAGtype_Date CalendarDate,
char *  Error 
)

Definition at line 2376 of file GeomagnetismLibrary.c.

void MAG_DegreeToDMSstring ( double  DegreesOfArc,
int  UnitDepth,
char *  DMSstring 
)

Definition at line 2438 of file GeomagnetismLibrary.c.

void MAG_DMSstringToDegree ( char *  DMSstring,
double *  DegreesOfArc 
)

Definition at line 2481 of file GeomagnetismLibrary.c.

void MAG_Error ( int  control)

Definition at line 505 of file GeomagnetismLibrary.c.

float MAG_FloatSwap ( float  f)

Definition at line 4050 of file GeomagnetismLibrary.c.

int MAG_FreeLegendreMemory ( MAGtype_LegendreFunction LegendreFunction)

Definition at line 1808 of file GeomagnetismLibrary.c.

Definition at line 1758 of file GeomagnetismLibrary.c.

int MAG_FreeMemory ( MAGtype_MagneticModel MagneticModel,
MAGtype_MagneticModel TimedMagneticModel,
MAGtype_LegendreFunction LegendreFunction 
)

Definition at line 1660 of file GeomagnetismLibrary.c.

Definition at line 1839 of file GeomagnetismLibrary.c.

int MAG_GeodeticToSpherical ( MAGtype_Ellipsoid  Ellip,
MAGtype_CoordGeodetic  CoordGeodetic,
MAGtype_CoordSpherical CoordSpherical 
)

Definition at line 2499 of file GeomagnetismLibrary.c.

int MAG_Geomag ( MAGtype_Ellipsoid  Ellip,
MAGtype_CoordSpherical  CoordSpherical,
MAGtype_CoordGeodetic  CoordGeodetic,
MAGtype_MagneticModel TimedMagneticModel,
MAGtype_GeoMagneticElements GeoMagneticElements 
)

Definition at line 121 of file GeomagnetismLibrary.c.

char MAG_GeomagIntroduction_EMM ( MAGtype_MagneticModel MagneticModel,
char *  VersionDate 
)

Definition at line 586 of file GeomagnetismLibrary.c.

char MAG_GeomagIntroduction_WMM ( MAGtype_MagneticModel MagneticModel,
char *  VersionDate 
)

Definition at line 655 of file GeomagnetismLibrary.c.

int MAG_GetGeoidHeight ( double  Latitude,
double  Longitude,
double *  DeltaHeight,
MAGtype_Geoid Geoid 
)

Definition at line 3819 of file GeomagnetismLibrary.c.

int MAG_GetTransverseMercator ( MAGtype_CoordGeodetic  CoordGeodetic,
MAGtype_UTMParameters UTMParameters 
)

Definition at line 2555 of file GeomagnetismLibrary.c.

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 
)

Definition at line 736 of file GeomagnetismLibrary.c.

int MAG_GetUserInput ( MAGtype_MagneticModel MagneticModel,
MAGtype_Geoid Geoid,
MAGtype_CoordGeodetic CoordGeodetic,
MAGtype_Date MagneticDate 
)

Definition at line 874 of file GeomagnetismLibrary.c.

int MAG_GetUTMParameters ( double  Latitude,
double  Longitude,
int *  Zone,
char *  Hemisphere,
double *  CentralMeridian 
)

Definition at line 2647 of file GeomagnetismLibrary.c.

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  PrintOption,
char *  OutputFile 
)

Definition at line 170 of file GeomagnetismLibrary.c.

Definition at line 3908 of file GeomagnetismLibrary.c.

int MAG_isNaN ( double  d)

Definition at line 2726 of file GeomagnetismLibrary.c.

int MAG_PcupHigh ( double *  Pcup,
double *  dPcup,
double  x,
int  nMax 
)

Definition at line 3167 of file GeomagnetismLibrary.c.

int MAG_PcupLow ( double *  Pcup,
double *  dPcup,
double  x,
int  nMax 
)

Definition at line 3340 of file GeomagnetismLibrary.c.

void MAG_PrintEMMFormat ( char *  filename,
char *  filenameSV,
MAGtype_MagneticModel MagneticModel 
)

Definition at line 1900 of file GeomagnetismLibrary.c.

void MAG_PrintUserData ( MAGtype_GeoMagneticElements  GeomagElements,
MAGtype_CoordGeodetic  SpaceInput,
MAGtype_Date  TimeInput,
MAGtype_MagneticModel MagneticModel,
MAGtype_Geoid Geoid 
)

Definition at line 1128 of file GeomagnetismLibrary.c.

void MAG_PrintWMMFormat ( char *  filename,
MAGtype_MagneticModel MagneticModel 
)

Definition at line 1874 of file GeomagnetismLibrary.c.

int MAG_readMagneticModel ( char *  filename,
MAGtype_MagneticModel MagneticModel 
)

Definition at line 1940 of file GeomagnetismLibrary.c.

int MAG_readMagneticModel_Large ( char *  filename,
char *  filenameSV,
MAGtype_MagneticModel MagneticModel 
)

Definition at line 2008 of file GeomagnetismLibrary.c.

int MAG_readMagneticModel_SHDF ( char *  filename,
MAGtype_MagneticModel *(*)  magneticmodels[],
int  array_size 
)

Definition at line 2087 of file GeomagnetismLibrary.c.

int MAG_robustReadMagModels ( char *  filename,
MAGtype_MagneticModel *(*)  magneticmodels[],
int  array_size 
)

Definition at line 464 of file GeomagnetismLibrary.c.

int MAG_robustReadMagneticModel_Large ( char *  filename,
char *  filenameSV,
MAGtype_MagneticModel **  MagneticModel,
int  array_size 
)

Definition at line 418 of file GeomagnetismLibrary.c.

int MAG_RotateMagneticVector ( MAGtype_CoordSpherical  CoordSpherical,
MAGtype_CoordGeodetic  CoordGeodetic,
MAGtype_MagneticResults  MagneticResultsSph,
MAGtype_MagneticResults MagneticResultsGeo 
)

Definition at line 2731 of file GeomagnetismLibrary.c.

int MAG_SecVarSummation ( MAGtype_LegendreFunction LegendreFunction,
MAGtype_MagneticModel MagneticModel,
MAGtype_SphericalHarmonicVariables  SphVariables,
MAGtype_CoordSpherical  CoordSpherical,
MAGtype_MagneticResults MagneticResults 
)

Definition at line 3457 of file GeomagnetismLibrary.c.

int MAG_SecVarSummationSpecial ( MAGtype_MagneticModel MagneticModel,
MAGtype_SphericalHarmonicVariables  SphVariables,
MAGtype_CoordSpherical  CoordSpherical,
MAGtype_MagneticResults MagneticResults 
)

Definition at line 3521 of file GeomagnetismLibrary.c.

int MAG_SetDefaults ( MAGtype_Ellipsoid Ellip,
MAGtype_Geoid Geoid 
)

Definition at line 386 of file GeomagnetismLibrary.c.

void MAG_SphericalToCartesian ( MAGtype_CoordSpherical  CoordSpherical,
double *  x,
double *  y,
double *  z 
)

Definition at line 2772 of file GeomagnetismLibrary.c.

int MAG_Summation ( MAGtype_LegendreFunction LegendreFunction,
MAGtype_MagneticModel MagneticModel,
MAGtype_SphericalHarmonicVariables  SphVariables,
MAGtype_CoordSpherical  CoordSpherical,
MAGtype_MagneticResults MagneticResults 
)

Definition at line 3583 of file GeomagnetismLibrary.c.

int MAG_SummationSpecial ( MAGtype_MagneticModel MagneticModel,
MAGtype_SphericalHarmonicVariables  SphVariables,
MAGtype_CoordSpherical  CoordSpherical,
MAGtype_MagneticResults MagneticResults 
)

Definition at line 3668 of file GeomagnetismLibrary.c.

int MAG_swab_type ( )

Definition at line 4010 of file GeomagnetismLibrary.c.

int MAG_TimelyModifyMagneticModel ( MAGtype_Date  UserDate,
MAGtype_MagneticModel MagneticModel,
MAGtype_MagneticModel TimedMagneticModel 
)

Definition at line 3733 of file GeomagnetismLibrary.c.

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 
)

Definition at line 2786 of file GeomagnetismLibrary.c.

char* MAG_Trim ( char *  str)

Definition at line 2247 of file GeomagnetismLibrary.c.

int MAG_ValidateDMSstringlat ( char *  input,
char *  Error 
)

Definition at line 1252 of file GeomagnetismLibrary.c.

int MAG_ValidateDMSstringlong ( char *  input,
char *  Error 
)

Definition at line 1316 of file GeomagnetismLibrary.c.

int MAG_Warnings ( int  control,
double  value,
MAGtype_MagneticModel MagneticModel 
)

Definition at line 1382 of file GeomagnetismLibrary.c.

int MAG_YearToDate ( MAGtype_Date CalendarDate)

Definition at line 2974 of file GeomagnetismLibrary.c.



world_magnetic_model
Author(s): National Geophysical Data Center (NGDC, Boulder CO, USA), British Geological Survey (BGS, Edinburgh, Scotland)
autogenerated on Sat Jul 26 2014 07:02:19