initial upload
This commit is contained in:
1845
geomag70_linux/IGRF13.COF
Normal file
1845
geomag70_linux/IGRF13.COF
Normal file
File diff suppressed because it is too large
Load Diff
95
geomag70_linux/README.txt
Normal file
95
geomag70_linux/README.txt
Normal file
@@ -0,0 +1,95 @@
|
||||
This zip file contains the C source code for the NGDC software "Geomag"
|
||||
version 7.0 that computes the estimated main magnetic field values for
|
||||
given locations and dates (or ranges of dates). Geomag requires a
|
||||
magnetic field model file for input. One model is included in this
|
||||
zip: IGRF13.COF. Note that the text file formats differ
|
||||
slightly in format between Unix and Windows platforms. Two different
|
||||
archives are therefore provided for Unix and Windows. The zip and tar
|
||||
files also include compiled versions (executables) of Geomag for
|
||||
Windows and Linux. This readme file contains instructions for both
|
||||
the Windows and Linux versions.
|
||||
|
||||
Important notice on change of file format
|
||||
-----------------------------------------
|
||||
The file format of IGRF11.COF and forward had to be changed from the previous
|
||||
versions (IGRF10.cof and IGRF10.unx) because the previous format did not
|
||||
allow for the new 0.01 nT precision of the DGRF2005 coefficients. In this
|
||||
file format revision, we also swapped the previously confusing m,n ordering
|
||||
to the standard n,m where n is the degree and m is the order. The format
|
||||
was further adjusted to have blanks between all fields, so that values no
|
||||
longer run into each other. This makes the files easier to read using
|
||||
unformatted read statments.
|
||||
|
||||
Background
|
||||
----------
|
||||
IGRF13 is the thirteenth generation standard main field model adopted
|
||||
by the International Association of Geomagnetism and Aeronomy (IAGA).
|
||||
This is a degree and order 10 model from 1900 to 1995 and a degree and
|
||||
order 13 model from 2000 to 2025, providing estimates of the main field
|
||||
for dates between January 1, 1900 and January 1, 2025. For more information
|
||||
on the IGRF and IAGA, visit the IAGA Working Group V-MOD Web site at:
|
||||
http://www.ngdc.noaa.gov/IAGA/vmod/
|
||||
|
||||
The computed magnetic elements are:
|
||||
-----------------------------------
|
||||
D: Declination
|
||||
I: Inclination
|
||||
H: Horizontal field strength
|
||||
X: North component
|
||||
Y: East component
|
||||
Z: Down component
|
||||
F: Total field strength
|
||||
dD,dI,dH,dX,dY,dZ,dF: Change per year of the above quantities.
|
||||
|
||||
|
||||
To compile this code:
|
||||
------------------------------------
|
||||
Gnu C compiler on Unix:
|
||||
gcc geomag70.c -o geomag70.exe
|
||||
|
||||
Intel C on Unix:
|
||||
icc geomag70.c -o geomag70.exe
|
||||
|
||||
The Windows .exe file was generated using
|
||||
Code Gear C++ 2009 Builder
|
||||
|
||||
|
||||
Command line option:
|
||||
--------------------
|
||||
Note that the geomag program can receive parameters on
|
||||
the command line. For example:
|
||||
geomag70.exe IGRF13.COF 2010.32 D M133.4 10.5 10.5
|
||||
|
||||
The command line syntax is listed by providing the h option as
|
||||
geomag70.exe h
|
||||
|
||||
|
||||
Spread-sheet option:
|
||||
--------------------
|
||||
Revision 6.1 introduced the option to read a file of
|
||||
dates and locations and create a new file with a set of extra
|
||||
columns giving the magnetic components. These can then be
|
||||
read as columns into a spread sheet program. The dates and
|
||||
coordinates have to be given in the same format as for the
|
||||
command line option. See also the sample files discussed below.
|
||||
|
||||
For example:
|
||||
geomag70.exe IGRF13.COF f in-coords.txt output.txt
|
||||
will append the magnetic components and their secular
|
||||
variation to the dates and locations given in 'in-coords.txt'
|
||||
and write the result to a file 'output.txt'.
|
||||
|
||||
This distribution contains example files which were produced
|
||||
on a Linux system using the commands:
|
||||
geomag70.exe IGRF13.COF f sample_coords.txt sample_out_IGRF13.txt
|
||||
|
||||
To run the program with command line arguments under Windows:
|
||||
-------------------------------------------------------------
|
||||
1) Click on <Start> <Programs> <Accessories> <Command Prompt>
|
||||
2) Change directory ('cd') to the folder containg geomag70.exe
|
||||
3) Run the program, e.g. 'geomag70.exe IGRF13.COF f in.txt out.txt'
|
||||
|
||||
Contact:
|
||||
--------
|
||||
For further infos, or bug reports, please contact:
|
||||
geomag.models@noaa.gov
|
BIN
geomag70_linux/geomag70
Executable file
BIN
geomag70_linux/geomag70
Executable file
Binary file not shown.
2485
geomag70_linux/geomag70.c
Normal file
2485
geomag70_linux/geomag70.c
Normal file
File diff suppressed because it is too large
Load Diff
22
geomag70_linux/sample_coords.txt
Normal file
22
geomag70_linux/sample_coords.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
2019.5 D K100 70.3 30.8
|
||||
2018,10,7 D K100 70.3 30.8
|
||||
2017.5 C K6470 70.3 30.8
|
||||
2016.5 D M1042 70.3 30.8
|
||||
2015.5 D F30000 70.3 30.8
|
||||
2018.7 D F30000 -70.3 -30.8
|
||||
2018.7 D F30000 -70,18,0 -30,48,0
|
||||
2018.7 D F30000 43,22,1 -30,8,
|
||||
2018,4,7 D F30000 43,22,1 -54,36,9
|
||||
2018,2,2 D K1.3 48.123 16.123
|
||||
2019,11,19 D K1.3 48.123 16.123
|
||||
2019.8849 D K1.3 48.123 16.123
|
||||
2018,4,7 D F0 43,22,1 -54,36,9
|
||||
2015,1,1 D F30000 43,22,1 -54,36,9
|
||||
2015,1,1 D F0 0.0 0.0
|
||||
2020,1,1 D F0 0.0 0.0
|
||||
2021.5 D K12 33.0 -145.0
|
||||
2022.0 D K57 -43.0 50.0
|
||||
2023.5 D K59 32.0 163.0
|
||||
2024.5 D K26 -65.0 55.0
|
||||
|
||||
|
21
geomag70_linux/sample_out_IGRF13.txt
Normal file
21
geomag70_linux/sample_out_IGRF13.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Date Coord-System Altitude Latitude Longitude D_deg D_min I_deg I_min H_nT X_nT Y_nT Z_nT F_nT dD_min dI_min dH_nT dX_nT dY_nT dZ_nT dF_nT
|
||||
2019.5 D K100 70.3 30.8 15d 21m 79d 4m 9898.8 9546.0 2619.2 51280.9 52227.6 15.5 1.7 -16.4 -27.8 38.7 50.1 46.1
|
||||
2018,10,7 D K100 70.3 30.8 15d 9m 79d 3m 9911.0 9566.4 2590.8 51244.2 52193.8 15.5 1.7 -16.6 -27.8 38.7 50.1 46.0
|
||||
2017.5 C K6470 70.3 30.8 14d 57m 79d 11m 9737.3 9407.8 2511.7 50996.2 51917.5 15.7 1.7 -16.9 -27.9 38.5 49.6 45.5
|
||||
2016.5 D M1042 70.3 30.8 15d 27m 79d 0m 10360.4 9985.8 2760.6 53306.0 54303.5 15.5 1.7 -17.1 -29.0 40.3 53.4 49.2
|
||||
2015.5 D F30000 70.3 30.8 15d 7m 78d 58m 10343.2 9985.1 2698.4 53070.7 54069.2 15.4 1.7 -17.3 -28.9 40.1 53.2 48.9
|
||||
2018.7 D F30000 -70.3 -30.8 0d -48m -60d 20m 18895.0 18893.1 -265.0 -33161.5 38166.8 -1.9 0.8 -26.6 -26.7 -9.9 65.2 -69.8
|
||||
2018.7 D F30000 -70,18,0 -30,48,0 0d -48m -60d 20m 18895.0 18893.1 -265.0 -33161.5 38166.8 -1.9 0.8 -26.6 -26.7 -9.9 65.2 -69.8
|
||||
2018.7 D F30000 43,22,1 -30,8, -10d 20m 59d 11m 23557.7 23175.4 -4226.9 39491.8 45984.4 11.1 -3.8 39.3 52.2 68.0 -34.1 -9.1
|
||||
2018,4,7 D F30000 43,22,1 -54,36,9 -17d 3m 63d 46m 21707.6 20753.6 -6364.8 44063.0 49119.9 9.9 -5.8 48.5 64.6 45.6 -90.2 -59.4
|
||||
2018,2,2 D K1.3 48.123 16.123 4d 16m 64d 31m 20952.1 20894.0 1559.0 43943.7 48683.0 8.8 1.2 5.7 1.6 53.7 52.5 49.9
|
||||
2019,11,19 D K1.3 48.123 16.123 4d 32m 64d 33m 20962.4 20896.9 1655.4 44037.9 48772.5 8.8 1.2 5.9 1.6 53.7 52.5 50.0
|
||||
2019.8849 D K1.3 48.123 16.123 4d 32m 64d 33m 20962.4 20896.9 1655.4 44037.9 48772.5 8.8 1.2 5.9 1.6 53.7 52.5 50.0
|
||||
2018,4,7 D F0 43,22,1 -54,36,9 -17d 4m 63d 46m 21808.2 20847.1 -6402.9 44255.4 49337.0 9.9 -5.8 48.7 64.9 45.9 -90.6 -59.7
|
||||
2015,1,1 D F30000 43,22,1 -54,36,9 -17d 36m 64d 5m 21550.8 20542.9 -6513.5 44357.4 49315.4 10.0 -5.8 47.9 64.6 45.6 -90.2 -60.2
|
||||
2015,1,1 D F0 0.0 0.0 -5d 26m -29d 43m 27672.5 27548.0 -2622.4 -15793.3 31862.2 9.4 -4.6 -8.7 -1.6 76.1 -43.8 14.2
|
||||
2020,1,1 D F0 0.0 0.0 -4d 39m -30d 6m 27631.1 27540.0 -2241.9 -16012.5 31935.5 10.1 -3.0 -14.4 -7.9 81.8 -23.7 -0.5
|
||||
2021.5 D K12 33.0 -145.0 12d 21m 52d 29m 24891.2 24315.0 5324.8 32425.7 40877.8 -2.9 1.5 -54.4 -48.7 -32.2 -41.8 -66.3
|
||||
2022.0 D K57 -43.0 50.0 -47d 24m -62d 57m 16770.7 11352.8 -12343.8 -32855.1 36887.8 -8.4 -1.3 23.0 -14.8 -44.7 -76.6 78.7
|
||||
2023.5 D K59 32.0 163.0 0d 20m 43d 4m 28172.8 28172.4 163.8 26326.0 38558.7 -2.1 -1.7 27.7 27.8 -17.2 0.6 20.7
|
||||
2024.5 D K26 -65.0 55.0 -62d 32m -65d 41m 18707.9 8630.1 -16598.5 -41409.3 45439.1 -10.1 -0.1 8.0 -45.0 -32.3 -21.1 22.5
|
81920
geomag70_linux/stt1d_tri_cen.txt
Normal file
81920
geomag70_linux/stt1d_tri_cen.txt
Normal file
File diff suppressed because it is too large
Load Diff
81920
geomag70_linux/stt1d_tri_cen_IGRF_in.txt
Normal file
81920
geomag70_linux/stt1d_tri_cen_IGRF_in.txt
Normal file
File diff suppressed because it is too large
Load Diff
81921
geomag70_linux/stt1d_tri_cen_IGRF_out.txt
Normal file
81921
geomag70_linux/stt1d_tri_cen_IGRF_out.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
geomag70_linux/tmp
Executable file
BIN
geomag70_linux/tmp
Executable file
Binary file not shown.
27
geomag70_linux/tmp.cpp
Normal file
27
geomag70_linux/tmp.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "string"
|
||||
#include "iostream"
|
||||
#include "fstream"
|
||||
#include "iomanip"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
ifstream fin("stt1d_tri_cen.txt");
|
||||
ofstream fout("stt1d_tri_cen_IGRF_in.txt");
|
||||
|
||||
double lon, lat;
|
||||
for (size_t i = 0; i < 81920; i++)
|
||||
{
|
||||
fin >> lon >> lat;
|
||||
if (lon < -180) lon = 180;
|
||||
if (lon > 180) lon = 180;
|
||||
if (lat < -90) lat = -90;
|
||||
if (lat > 90) lat = 90;
|
||||
fout << "2019,8,22 D K250 " << setprecision(12) << lat << " " << lon << "\n";
|
||||
}
|
||||
|
||||
fin.close();
|
||||
fout.close();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user