-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
435 lines (435 loc) · 17.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<title>CXFORM Coordintate Transformation Package</title>
<meta name="description"
content="A set of space physics coordinate transformation routines for IDL and C">
<meta name="keywords"
content="coordinate, transformations, IDL, C, space, physics, GSE, GSM, GEI, GCI, ECI, J2000, GEO, MAG, SM, RTN, ECL, HEE, HAE, GSEQ">
</head>
<body>
<div align="center"><big><font size="+3"><small><small><font
face="Courier New, Courier, monospace"><b> CXFORM: </b>Coordinate
transformation package for IDL and C</font></small></small></font><tt><b><br>
<br>
</b></tt></big><br>
<img src="neon_sys2.jpg" alt="" height="177" width="575"> <br>
<br>
<div align="left"><tt><br>
</tt><font face="Courier New, Courier, monospace">Originally written by
<a href="mailto:esm%20%3Cat%7D%20pobox%20%28dot%29%20com">Ed Santiago</a>
(LANL)<br>
Extended by Ryan Boller
</font><br>
<br>
<big><tt><br>
Jump to: <a href="#Overview">Overview</a> <a
href="#Download">Download</a> <a href="#Usage">Usage</a>
<a href="#Sys_Impl">Coord. Systems Impl.</a> <a
href="#Misc">Misc.</a>
<br>
<br>
<a href="#Misc"><br>
</a>
<br>
<br>
</tt></big></div>
<div align="left"><big><tt><a name="Overview"></a>
============================<br>
OVERVIEW<br>
============================<br>
<br>
The CXFORM package contains a set of routines to convert spacecraft
coordinates<br>
from one system to another, i.e., GSE-->GSM. It is written in
C and can be<br>
used as either a C library (.so or .dll) or as an IDL function on most
platforms<br>
(via its DLM -- Dynamically Loadable Module -- interface).<br>
<br>
It has been tested under SunOS v5.7, Microsoft Windows 2000/XP, Mac OS
X 10.3<br>
& 10.4, and Linux kernel release 2.4.20. It has previously
been tested under
<br>
Solaris 2.6 and DEC OSF/1 V4.0.<br>
<br>
It is largely based on Mike Hapgood's excellent introduction to
coordinate <br>
transformations, along with Markus Fraenz' "Heliospheric Coordinate
Systems" <br>
and Christopher Russell's "Geophysical Coordinate Transformations":<br>
<br>
<a
href="http://sspg1.bnsc.rl.ac.uk/Share/Coordinates/ct_home.htm">
http://sspg1.bnsc.rl.ac.uk/Share/Coordinates/ct_home.htm</a> <br>
<a
href="http://www.space-plasma.qmul.ac.uk/heliocoords/">
http://www.space-plasma.qmul.ac.uk/heliocoords/</a> <br>
<a
href="http://www-ssc.igpp.ucla.edu/personnel/russell/papers/gct1.html/">
http://www-ssc.igpp.ucla.edu/personnel/russell/papers/gct1.html/</a> <br>
<br>
<br>
Note that since this follows much of Hapgood's formulae that are
optimized for<br>
simplicity and efficiency, he specifies a level of precision of 0.001
degrees<br>
up to the year 2100 for each rotation angle, which has been deemed
sufficient<br>
for space physics applications. The disclaimer applies that these
should not<br>
be used for mission-critical flight applications due to their margin of
error.<br>
<br>
Formal testing has been completed as of 2004/12/01. The results
can be <br> found in the test_results directory. In <br>
general, they are within 1% of the results of<br>
<a href="http://sscweb.gsfc.nasa.gov">SSCWeb's</a> calculations (based
on GEOPACK), and in many cases are within<br>
0.01%.<br>
<br>
If you find CXFORM to be useful (or have other comments), please let us know.
<br>
For one example of CXFORM in a production environment, visit the <a
href="http://earthnow.usgs.gov/">USGS </a><br>
<a href="http://earthnow.usgs.gov/">EarthNow! Landsat Image Viewer</a>.
By converting satellite positions and <br>
velocities from GEI to GEO, the exact ground track can be computed,
enabling <br>
city names and the track itself to be properly located.<br>
<br>
<br>
<a name="Download"></a> ============================<br>
DOWNLOAD / INSTALLATION<br>
============================<br>
<br>
Source code:<br>
compile using instructions in install.txt. You will need the
C<br>
compiler
included in Xcode for MacOS X.<br>
<br>
<br>
<a name="Usage"></a> ============================<br>
USAGE FROM IDL<br>
============================<br>
<br>
The function prototype is<br>
<br>
new_pos = CXFORM( pos, source_frame, dest_frame,
time )<br>
<br>
where:<br>
pos
is a vector of length 3, containing the position<br>
in source_frame coordinates. It
can also be a 2-D<br>
array of size [3, M], where M is
the number of points<br>
to convert<br>
<br>
source_frame is an ASCII string
naming the source<br>
coordinate system, e.g., 'GSE',
'J2000'. See <br>
"Coordinate Systems Implemented"
below.<br>
<br>
dest_frame is also an ASCII
string, naming the destination<br>
coordinate system.<br>
<br>
time
is "ephemeris seconds past J2000 (1 Jan 2000 12:00)".<br>
The "date2es" function converts a
standard Gregorian<br>
time (mm,dd,yyyy) to Ephemeris
Seconds past/before<br>
J2000. See the included
"date2es.pro" file for more <br>
details.<br>
<br>
new_pos is the
position, in dest_frame coordinates.<br>
<br>
<br>
<br>
Single-coordinate example:<br>
<br>
IDL> es = date2es(9,30,1999,7,5,0) ; Sep.
30, 1999 07:05:00 UTC<br>
IDL> pos = cxform([1,0,0], 'GSE', 'GEO', es)<br>
IDL> help,pos<br>
POS
DOUBLE = Array[3]<br>
IDL> print,pos<br>
0.32034915 0.94616669
-0.046314350<br>
IDL> <br>
<br>
<br>
Multiple-coordinate example:<br>
<br>
IDL> imp8GEI = fltarr(3, 5)<br>
IDL> imp8Time = lonarr(5)<br>
IDL><br>
IDL> help, imp8GEI<br>
IMP8GEI
FLOAT = Array[3, 5]<br>
IDL> help, imp8Time<br>
IMP8TIME LONG
= Array[5]<br>
IDL><br>
IDL><br>
IDL> imp8GEI[*,0] = [-32.562, 20.085, -10.471]<br>
IDL> imp8GEI[*,1] = [-34.415, 4.229, -6.173]<br>
...<br>
IDL> print, imp8GEI<br>
-32.5620
20.0850 -10.4710<br>
-34.4150
4.22900 -6.17300<br>
-27.2210
-12.441 -0.34300<br>
-9.01000
-23.380 5.39300<br>
14.1890
-19.583 7.58900<br>
IDL><br>
IDL> imp8Time = [-43200, 43200, 129600, 216000,
302400]<br>
IDL><br>
IDL> imp8GEO = cxform(imp8GEI, 'GEI', 'GEO',
imp8Time)<br>
IDL><br>
IDL> print, imp8GEO<br>
25.418317
28.593709 -10.471000<br>
10.691414
32.984396 -6.1729999<br>
-6.5404276
29.205893 -0.34299999<br>
-20.772292
14.011294 5.3930001<br>
-22.419840
-9.0648980 7.5890002<br>
<br>
<br>
Note that if your data is imported as [M, 3] instead of [3, M], you can<br>
transpose it using IDL's TRANSPOSE function:<br>
<br>
IDL> correctArr = fltarr(3, M)<br>
IDL> correctArr = TRANSPOSE(originalArr)<br>
<br>
<br>
<br>
============================<br>
USAGE FROM C<br>
============================<br>
<br>
See main.c included in this package for
an example of using CXFORM in C.<br>
See install.txt for instructions on
building it on your platform.<br>
<br>
<br>
</tt></big><big><tt><a name="Test_Results"></a>
============================<br>
TEST RESULTS<br>
</tt></big><big><tt> ============================</tt></big><br>
<big><tt><br>
The bulk of the testing used <a
href="http://sscweb.gsfc.nasa.gov/cgi-bin/sscweb/Locator.cgi">SSCWeb's
Locator Tabulator</a> as the data source.<br>
As stated in the introduction, this service uses GEOPACK for its
calculations.<br>
An included file, tester.c, was used to read in data from SSCWeb and<br>
compare it to the results of CXFORM. In addition, one data point
was used from<br>
the <a href="http://www.space-plasma.qmul.ac.uk/heliocoords/">HelioCoords</a>
transformation package documentation as a sanity check and also<br>
as a test for the heliospheric systems that are not present in SSCWeb.<br>
<br>
<a href="test_results/ACE_2000_results.pdf">ACE data, year 2000, ~40k
data points</a><br>
<a href="test_results/Geotail_1993_results.pdf">Geotail data, year
1993, ~40k data points</a><br>
<a href="test_results/HelioCoord_Comparison.pdf">IMP-8 data, year 2003,
~40k data points</a><br>
<a href="test_results/HelioCoord_Comparison.pdf">Geocentric S/C
Position from
HelioCoords documentation, 1 data point</a><br>
<br>
<br>
<br>
<a name="Sys_Impl"></a> ==================================<br>
COORDINATE SYSTEMS IMPLEMENTED<br>
==================================<br>
<br>
GEI Geocentric
Equatorial Inertial, also known as True<br>
Equator and True Equinox of Date, True of Date (TOD),<br>
ECI, or GCI<br>
J2000 Geocentric Equatorial
Inertial for epoch J2000.0 <br>
(GEI2000), also known as Mean
Equator and Mean Equinox<br>
of J2000.0<br>
GEO Geographic,
also known as Greenwich Rotating<br>
Coordinates (GRC), or Earth-fixed
Greenwich (EFG)<br>
MAG Geomagnetic<br>
GSE Geocentric
Solar Ecliptic<br>
GSM Geocentric
Solar Magnetospheric<br>
SM Solar
Magnetic<br>
RTN* Radial
Tangential Normal (Earth-centered)<br>
GSEQ Geocentric Solar
Equatorial<br>
HEE
Heliocentric Earth Ecliptic<br>
HAE
Heliocentric Aries Ecliptic<br>
HEEQ
Heliocentric Earth Equatorial<br>
<br>
<br>
* = this system has not been implemented/tested and should be treated
as such<br>
<br>
<br>
=================================<br>
ADDING NEW COORDINATE SYSTEMS<br>
=================================<br>
<br>
This package has been designed to allow for easy additions of new
coordinate<br>
systems.<br>
<br>
All you need to do is define one transformation between the new system
and any<br>
of the existing ones. Once you do that, the Perl script will
generate code to<br>
convert to all others. This, of course, means that a working copy
of Perl must<br>
be installed. You will need the IxHash module if it is not
already installed.<br>
It can be found at http://search.cpan.org/dist/Tie-IxHash/<br>
<br>
Here's what you do:<br>
<br>
1. Edit the file cxform-manual.c and add a new function,
xxxx_twixt_yyyy, <br>
where `xxxx' is any existing coordinate frame,
and `yyyy' is the new one.<br>
<br>
2. Run "perl gen_cxform_auto.pl cxform-manual.c" from the
prompt. This will<br>
create a new cxform-auto.c with support for
your new coordinate system.<br>
<br>
3. Build and install a new CXFORM library as described in
install.txt.<br>
<br>
4. Run and test it in IDL/C. That's it! <br>
<br>
If it works, please send in your code.
<br>
<br>
<a name="Misc"></a> ============================<br>
VERSION HISTORY<br>
============================<br>
<br>
2000/06/21 v0.2
Ed Santiago: Last released version from Ed.<br>
2003/09/12 v0.3
Ryan Boller: First modified version from Ryan. Added
RTN<br>
and GSEQ systems,
IGRF model, slightly different time<br>
manipulation,
Windows support, additional documentation, and<br>
standalone C
functionality.<br>
2004/03/19 v0.4 Ryan Boller: Updated Makefile to
auto-detect platform and<br>
to
build under Mac OS X. HEEQ system now implemented by Kristi<br>
Keller.<br>
2004/05/21 v0.5
Ryan Boller: Fixed small discrepancy in calculation of<br>
T0
and lambda0. Results now match those of SSCWeb's (GEOPACK-<br>
based) when the mag pole lat/lon is fixed to their values,<br>
as
they haven't updated their IGRF coefficients.<br>
2004/12/01 v0.6
Ryan Boller: Finished comprehensive testing, posted results.<br>
Updated IGRF to <a href="http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html">Revision
9</a>. Moved cxRound, date2es, and<br>
gregorian_calendar_to_jd to cxform-manual.c so it is included<br>
in
the shared library.<br>
2006/10/19 v0.7
Ryan Boller: Updated IGRF coefficients to 10th generation.<br>
Fixed IDL DLM interface under Windows XP & IDL 6.0+. Updated<br>
installation documentation.<br>
2009/11/25 v0.71
Ryan Boller: Updated Mac compiler flags to compile 32- and <br>
64-bit versions on Intel- and PPC-based CPUs. Fixed memory pointer<br>
problem on 64-bit machines (now using IDL_MEMINT instead of IDL_LONG<br>
in
cxform-dlm.c).<br>
<br>
============================<br>
KNOWN ISSUES / TODOs<br>
============================<br>
<br>
- Mac shared object does not link with C objects. May need to
convert to a<br>
dylib. The shared object does work with the IDL DLM
interface, though.<br>
- RTN System needs to be tested for accuracy.<br>
</tt></big><br>
<br>
<br>
</div>
</div>
</body>
</html>