Go to the documentation of this file.00001 #include <stdio.h>
00002 #include <string.h>
00003 #include <math.h>
00004 #include <stdlib.h>
00005
00006
00007 #include "GeomagnetismHeader.h"
00008 #include "EGM9615.h"
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 int main()
00032 {
00033 MAGtype_MagneticModel * MagneticModels[1];
00034 MAGtype_Ellipsoid Ellip;
00035 MAGtype_CoordGeodetic minimum, maximum;
00036 MAGtype_Geoid Geoid;
00037 MAGtype_Date startdate, enddate;
00038 int ElementOption, PrintOption, i, epochs = 1;
00039 double cord_step_size, altitude_step_size, time_step_size;
00040 char filename[] = "WMM.COF";
00041 char OutputFilename[32];
00042 char VersionDate_Large[] = "$Date: 2012-04-25 16:23:56 -0600 (Wed, 25 Apr 2012) $";
00043 char VersionDate[12];
00044
00045 MAG_robustReadMagModels(filename, &MagneticModels, 1);
00046
00047 strncpy(VersionDate, VersionDate_Large + 39, 11);
00048 VersionDate[11] = '\0';
00049
00050 MAG_SetDefaults(&Ellip, &Geoid);
00051
00052
00053 Geoid.GeoidHeightBuffer = GeoidHeightBuffer;
00054 Geoid.Geoid_Initialized = 1;
00055
00056
00057 printf("\n\n Welcome to the World Magnetic Model (WMM) C-Program\nof the US National Geophysical Data Center\n\t\t--- Grid Calculation Program ----\n\t --- Model Release Date: 15 Dec 2009 ---\n\t --- Software Release Date: %s ---\n", VersionDate);
00058 printf("This program may be used to generate a grid/volume of magnetic field values\n");
00059 printf("over latitude, longitude, altitude and time axes. To skip an axis,\n");
00060 printf("keep the start and end values the same and enter zero for the step size.\n");
00061
00062 printf("\n\n Enter grid parameters \n\n");
00063
00064
00065
00066
00067 MAG_GetUserGrid(&minimum, &maximum, &cord_step_size, &altitude_step_size, &time_step_size, &startdate, &enddate, &ElementOption, &PrintOption, OutputFilename, &Geoid);
00068 MAG_Grid(minimum, maximum, cord_step_size, altitude_step_size, time_step_size, MagneticModels[0], &Geoid, Ellip, startdate, enddate, ElementOption, PrintOption, OutputFilename);
00069
00070 for(i = 0; i < epochs; i++) MAG_FreeMagneticModelMemory(MagneticModels[i]);
00071
00072
00073
00074
00075 printf("\nPress any key to exit...\n");
00076 getchar();
00077
00078 return 0;
00079 }
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