00001 /* 00002 * GeoMag.h 00003 * Copyright (C) James Goppert 2009 <jgoppert@users.sourceforge.net> 00004 * 00005 * GeoMag.h is free software: you can redistribute it and/or modify it 00006 * under the terms of the GNU General Public License as published by the 00007 * Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * GeoMag.h is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 /* PROGRAM MAGPOINT (GEOMAG DRIVER) */ 00020 /************************************************************************ 00021 Contact Information 00022 00023 Software and Model Support 00024 National Geophysical Data Center 00025 NOAA EGC/2 00026 325 Broadway 00027 Boulder, CO 80303 USA 00028 Attn: Susan McLean or Stefan Maus 00029 Phone: (303) 497-6478 or -6522 00030 Email: Susan.McLean@noaa.gov or Stefan.Maus@noaa.gov 00031 Web: http://www.ngdc.noaa.gov/seg/WMM/ 00032 00033 Sponsoring Government Agency 00034 National Geospatial-Intelligence Agency 00035 PRG / CSAT, M.S. L-41 00036 3838 Vogel Road 00037 Arnold, MO 63010 00038 Attn: Craig Rollins 00039 Phone: (314) 263-4186 00040 Email: Craig.M.Rollins@Nga.Mil 00041 00042 Original Program By: 00043 Dr. John Quinn 00044 FLEET PRODUCTS DIVISION, CODE N342 00045 NAVAL OCEANOGRAPHIC OFFICE (NAVOCEANO) 00046 STENNIS SPACE CENTER (SSC), MS 39522-5001 00047 00048 3/25/05 Stefan Maus corrected 2 bugs: 00049 - use %c instead of %s for character read 00050 - help text: positive inclination is downward 00051 8/9/09 James Goppert 00052 - restructured file into a C++ class 00053 */ 00054 00055 #ifndef GeoMag_H 00056 #define GeoMag_H 00057 00058 #include <stdio.h> 00059 #include <stdlib.h> 00060 #include <string.h> 00061 #include <math.h> 00062 #include <string> 00063 #define NaN log(-1.0) 00064 00065 namespace uvsim 00066 { 00067 00068 class GeoMag 00069 { 00070 private: 00071 // Variables 00072 int maxord,i,icomp,n,m,j,D1,D2,D3,D4; 00073 float c[13][13],cd[13][13],tc[13][13],dp[13][13],snorm[169], 00074 sp[13],cp[13],fn[13],fm[13],pp[13],k[13][13],pi,dtr,a,b,re, 00075 a2,b2,c2,a4,b4,c4,epoch,gnm,hnm,dgnm,dhnm,flnmj,otime,oalt, 00076 olat,olon,dt,rlon,rlat,srlon,srlat,crlon,crlat,srlat2, 00077 crlat2,q,q1,q2,ct,st,r2,r,d,ca,sa,aor,ar,br,bt,bp,bpp, 00078 par,temp1,temp2,parp,bx,by,bz,bh; 00079 char model[20], c_str[81], c_new[5]; 00080 float *p; 00081 FILE * wmmdat; 00082 public: 00083 GeoMag(std::string file, int maxDeg); 00084 virtual ~GeoMag(); 00085 void update(float alt, float glat, float glon, float time); 00086 float dec, dip, ti, gv; 00087 }; 00088 00089 } 00090 00091 #endif 00092 00093 // vim:ts=4:sw=4