keith

Document Sample
keith Powered By Docstoc
					                                                                                        1


1. Introduction



       The northern and southern hemisphere’s magnetic cusps (definitions of these and

other terms may be found in the glossary on page viii) are regions of weak magnetic field

in the magnetosphere directly related to the approximately dipole nature of the Earth's

geomagnetic field and its interaction with the solar wind (Figure 1-1). The cusp can be

described as the border between closed field lines and open field lines that connect into

the interplanetary magnetic field. Field lines passing through this region at low altitude

connect to the entire magnetospheric surface at the magnetopause. In the vicinity of this

near-singularity, the loci of field lines spread rapidly to all parts of the dayside and

nightside surface of the magnetosphere. This makes it difficult to determine the origin of

charged particles observed on the field lines at low altitude. Recent modeling and

satellite data may help to resolve this longstanding difficulty.



       In Figure 1-1, the solar wind travels from the sun to the Earth. When the solar

wind encounters the Earth’s magnetosphere, a shockwave develops ahead of the

magnetospheric cavity. As the shockwave is formed, it heats and slows the plasma. This

shocked plasma is known as magnetosheath plasma. As the flow continues past the

bowshock, most of the magnetosheath plasma is deflected around the magnetosphere.

The interface between the region of the magnetosheath and the magnetic cavity around

the Earth is the magnetopause. A small portion of plasma from the magnetosheath does

penetrate in the magnetosphere, and has been the subject of a great deal of study. Plasma

penetration at the boundary of the magnetosphere forms a current on the surface called
                                                                                            2


  the magnetopause current layer. This work examines the plasma in the magnetopause

  current layer by observing plasma structure as it follows the geomagnetic field lines to

  low altitudes via the magnetic cusps (indicated by a red arrow on Figure 1-1).




Figure 1-1 The Earth’s Magnetosphere. Schematically represented is a polar cross
section of the deformation of the Earth’s magnetic field by the solar wind and its
associated Interplanetary Magnetic Field (IMF). Different regions of the magnetosphere
have been identified and are highlighted in this figure for reference and orientation.




  1.1 Scientific Objectives



          The magnetopause current layer defines the boundary between the Earth’s

  magnetosphere and the shocked solar wind of the magnetosheath.                   All of the

  magnetospheric particles not of terrestrial origin must pass through this boundary;

  therefore, the magnetopause current layer is of fundamental importance to any dynamic

  understanding of the magnetosphere. This work employs low-altitude data taken in the
                                                                                         3


cusps in order to determine if the magnetopause current layer has a unique footprint

where field lines from the current layer map down to the ionosphere. The effects of the

direction of the Interplanetary Magnetic Field (IMF) on this mapping are also studied in a

statistical survey of the data. The unusual dynamical properties of the magnetopause

current layer region make this study possible in a way that has not been previously

attempted, i.e. assuming a consistent footprint at low altitudes where the current layer

properties directly map. The data which are used in this study come from several

sources: The DMSP spacecraft (describe), and the miniaturized 3-D plasma detectors

aboard the Swedish "Munin" and "Astrid" spacecraft. The design and calibration of these

spacecraft instruments were the subject of my Master's thesis [Keith, 1999]; this thesis

continues the work by analyzing the data from these unique nanospacecraft and applying

them to a major controversy in space physics.



       In situ measurements of the magnetopause are difficult, due to its dynamic nature

and the limitations of single-point data collection. Multi-point measurements, such as

those taken by ISEE 1 and 2 [Gurnett et al., 1979; Berchem and Russell, 1982; and

references therein], have told us a great deal, and current missions such as Cluster

[Escoubet et al., 1997] will improve our understanding even more. It is also possible to

remotely study the magnetopause with low-altitude (500 to 1500 km) measurements by

taking advantage of the unique connection between this boundary and the magnetic cusps

[Newell and Meng, 1995], if this connection between the magnetopause and low altitudes

could be understood and exploited more completely. Low-altitude in situ measurements

by nature are obtained from spacecraft with greater velocities and provide more of a
                                                                                         4


“snapshot” picture; with less spatial and temporal blurring than high altitude in situ

measurements, which would improve our overall understanding of the magnetospheric

puzzle.



          Low-altitude cusp data, if unambiguously correlated with the magnetopause

current layer, can be used as a form of remote sensing of the magnetopause. This, in

turn, could lead to a better understanding of the magnetopause boundary, and therefore,

of the magnetosphere as a whole.



          After discussing some background information and the instrumentation used in

this study, examples of this low-altitude mapping of the current layer will be shown in the

data. The features seen will be discussed in relation to the signatures that are expected.

A hybrid magnetohydrodynamic/kinetic raytracing model is then described which

supports the ionospheric morphology and the expected particle paths as they transition

from the solar wind to the low-altitude cusp. A statistical study was also performed to

establish the consistency and dependencies expected for this low-altitude mapping.

Finally, all of the evidence is considered in light of answering the central question of

whether or not we are seeing a mapping of the magnetopause current layer at low

altitudes.




1.2 Cusp Historical Background
                                                                                         5




       Ever since Chapman and Ferraro [1931] first deduced the basic nature of the

Earth’s magnetosphere, its 2-D and 3-D topology has indicated the existence of a cusp.

This cusp, or weak magnetic field region, is invariably near magnetic local noon at the

latitude where magnetic field lines switch from closing on the dayside to being swept

back into the tail. This was thought to allow for more or less direct penetration of

magnetosheath particle fluxes to low altitudes.       Early observations [Heikkila and

Winningham, 1971] showed a high-latitude band of low-energy particle precipitation

with magnetosheath-like properties on the dayside at low altitudes. They interpreted this

feature as the long sought for evidence of direct solar wind entry via a magnetic cusp.

This general region of particle penetration was later separated into a "cusp proper" and a

"Cleft/Boundary Layer," representing separate particle entry processes (i.e., direct and

indirect) [Newell and Meng, 1988]. This terminology builds upon the "cusp" versus

"cleft" distinction of Reiff [1979], who argued that the "cusp" represented direct entry

whereas the "cleft" was the low-altitude signature of the Low Latitude Boundary Layer.



       Newell and Meng [1988] defined the low-altitude cusp proper as the sub-region of

plasma flux that more closely resembles magnetosheath plasma spectral characteristics,

indicating "more direct" entry than that associated with the Low Latitude Boundary Layer

(LLBL), the plasma region just equatorward of the cusp representing plasma near the

magnetopause but inside the magnetosphere. This definition results in a cusp of much

narrower extent in Magnetic Local Time (MLT) and Invariant Latitude (IL), and is

limited to fairly direct plasma entry processes (i.e., little or no acceleration of the
                                                                                          6


magnetosheath population). This smaller, more directly connected region is continuously

present with a density that remains consistent with solar wind density variations

[Aparicio et al., 1991].



       The true (or magnetic) cusps (Figure 1-2) can be defined in terms of the

magnetopause current layer, which contains the outermost layer of magnetic field lines of

the magnetosphere. This very thin layer is also the site of the interconnection between

the Earth’s geomagnetic field and the interplanetary field and produces many other

interesting processes, some of which are not well understood. The low-altitude regions to

which these outermost field lines map are the magnetic cusps, which we believe are

associated with a small sub-region, first reported by Keith et al., [2001], of the particle-

defined cusp mentioned above. Thus, this “true cusp” can represent a unique window

into the large-scale workings of the magnetosphere and the magnetopause current layer.

The primary difference between this definition and that of the cusp proper, is that “true

cusp” particles are expected to be more energetic, reflecting the populations accelerated

through non-MHD processes in the magnetopause current layer and seen in in situ

measurements [Gosling et al., 1986; Song et al., 1990] and simulations [Nakamura and

Scholer, 2000].    Locally penetrating, unaccelerated magnetosheath plasma from the

magnetopause boundary layer is also seen near the boundary [Lundin, 1988] and should

propagate in the cusp proper to low-altitude poleward and occasionally equatorward of

the accelerated plasma population of the true cusp.
                                                                                           7




Figure 1-2 True Cusp field lines map to the magnetopause current layer. North is up
on the figure and the sun is to the left. These field lines interconnect with the IMF at
an “X-line”, causing a “kink” at the boundary, associated with the currents on the
magnetopause. The strong currents at the boundary, coupled with the field component
which crosses the boundary, result in a J x B force the accelerates ions along the
magnetopause (and down along field lines to the Earth. Only field lines in the plane of
the figure are shown, however, similar field lines also connect through the boundary
on either side of this plane.
                                                                                          8


1.3 Classical Dispersion



        Not long after the initial cusp observations, it was realized the properties of the

region were consistent with the theory of magnetic reconnection as proposed by Dungey,

[1961], (this is the idealized MHD model). The main property used to support this was

the fact that the highest energy ions are seen at the most equatorward location, while

lower energy particles tend to precipitate further poleward for southward IMF conditions

[Shelley et al., 1976; Reiff et al., 1977].



        Magnetosheath plasma injected on the dayside at the reconnection point or “X

line” flows Earthward along magnetic field lines. As the now open field line in the MHD

approximation is convected tailward, its footprint moves poleward. The higher energy

particles reach low altitudes more quickly, and should be seen farther equatorward. This

"dispersion" is the key to identifying the Dungey model, and has been reproduced by

such models as the one of Lockwood and Smith [1994]. This method has been able to

reproduce the large-scale distribution of both ions and electrons in the low-altitude cusp,

if the additional electric field which enforces the equal penetration of ions and electrons

(quasineutrality) is included [Onsager et al., 1998]. So far, though, these models have

not been able to reproduce all of the detailed characteristics seen in the particle data

[Fuselier et al., 1999].
                                                                                          9


1.4 Size Scales



       The cusp proper averages approximately 2 to 3 hours wide in MLT centered at

noon, and about 1º to 5º in IL centered at about 78º IL (1º ~ 100 km) [Newell and Meng,

1988; Lundin 1988; Aparicio et al., 1991]. Its location and size vary with changes in the

IMF direction and solar wind dynamic pressure, but it is always present [Newell and

Meng, 1988]. The above size and location represent statistical averages and are quite

large. At low altitude orbits (1000 km polar circular), a feature of this size will be

traversed on average in about 15 seconds to a minute. Trajectories not cutting through

the center of the cusp would have even shorter traversal times, on the order of a few

seconds. Orbits with more equatorward inclinations may spend more time in the cusp,

depending on how much local time is covered while inside the appropriate latitude range.

A theoretical maximum for a cusp traversal (3 hours of local time at about 77º Latitude)

would be on the order of 8 minutes. It is important to note that while the quick traversals

of the cusp at low altitude may have limited the detail seen in the past, they have the

advantage of being more of a “snapshot”, with the data less likely to be contaminated

with temporal changes during the traversal.         The faster sample times of recent

instruments (described below) finally allows the detail to be seen without the need to rely

on higher altitudes and slower traversals, with the concomitant intermixing of populations

due to horizontal transport. That is, mid-altitude measurements, while showing many

similar particle characteristics, may contain bounced and tailward convected populations

that may have different histories than the downcoming particles.
                                                                                         10


        Historically, particle measurements of the cusp have been limited by the spatial

resolution they could achieve, which is directly linked to the energy sweep rates of the

instruments. Most detectors to date have had energy sweep rates on the order of a

second, which for many low-altitude cusp crossings may allow for only a few energy

spectra to be taken if the structure is small. The latest instruments, however, including

the MEDUSA instrument aboard the Astrid-2 microsatellite, can take up to 16 energy

spectra per second, thus allowing unprecedented resolution (~400 m) of possible fine-

scale structures, 16 times finer than most detectors. In my Master's thesis [Keith, 1998], I

showed how this instrument design allows very rapid sampling of plasma distributions

without sacrificing particle sensitivity.



1.5 Magnetopause Connection



        The magnetopause is generally agreed to be made up of several distinct, if

sometimes overlapping, regions.       Song et al., [1990] describe five different regions

during an inbound magnetopause crossing by the ISEE 1 spacecraft. This northward IMF

crossing begins in the first region, which is the magnetosheath just outside the boundary.

Their second region, and the first part of the boundary, is termed the Sheath Transition

Layer and includes the magnetopause current layer, identified by the change in field

strength balancing the decrease in plasma density. The field lines in this layer were

found to connect between the geomagnetic field and the solar wind IMF, and the plasma

within the layer was of magnetosheath origin. This is followed by their third and fourth

regions termed the outer and inner boundary layers, respectively. Both of these layers are
                                                                                       11


composed mixtures of magnetosheath and magnetospheric plasma populations; however,

there are noticeable differences between them (although they are often collectively

referred to as the plasma boundary layer).         The outer layer is dominated by

magnetosheath plasma, and whether or not the field lines connect with the Earth or IMF

is difficult to determine. The inner layer, however, is dominated by magnetospheric

plasma, which are on closed field lines (i.e. connecting with the Earth). The last and

innermost region encountered was the magnetosphere. These general regions appear to

be present for all Interplanetary Magnetic Field directions, although with noticeable

differences in characteristics [Russell, 1995].    Others have used different naming

conventions, such as a magnetosheath boundary layer being just outside the current layer,

and the low-latitude boundary layer being just inside [Fuselier et al., 1995]. All agree,

however, on the permanent existence of a thin current layer averaging about 600 km thick

representing the transition from interplanetary to terrestrial field domination [Berchem

and Russell, 1982].



       The magnetopause is also the site of intense, low frequency wave activity

[Gurnett et al., 1979; Song et al., 1990]. Electric field turbulence at the magnetopause

has a typical frequency range from a few hertz up to 100 kHz, while magnetic field

turbulence extends from a few hertz up to about 1 kHz. In both cases, the maximum

intensities are usually confined to the plasma boundary layer and the magnetopause

current layer [Gurnett et al., 1979].
                                                                                      12


       The magnetopause current layer is defined by the current that must flow along the

interface between the magnetosheath (a region of high plasma pressure and variable

magnetic field) and the more inner layers of the dayside magnetopause, or Low Latitude

Boundary Layer which has much lower plasma densities and is permeated by the Earth’s

geomagnetic field. In situ measurements of this current layer have shown an increase in

ion plasma flow velocity from the outer (Sunward) to the inner (Earthward) edge,

indicating acceleration within this layer. These accelerated flows are usually seen at

times when the magnetic fields on either side of the boundary are close to antiparallel

[Gosling et al., 1986].



       Assuming an average change in the magnetic field across this boundary of 400 nT

in the z direction, we have from Ampere’s law

              B                                                                   (1)
  B  o J   z ˆj
                 x

where the change in B can be set proportional to a surface current running in azimuth

across the boundary with a value of

     Bz       400x10 9 1
J                       ( A / m)                                                  (2)
     o         4x10 7  

To get the total number of amps, this value must be multiplied by the length of the

current sheet in azimuth. Assuming a 10 Earth radii standoff distance of the dayside

magnetopause, and near-spherical symmetry in the region of interest, this gives a sphere

with a circumference of about 40,000 km. If we consider a region about three hours wide
                                                                                          13


in local time at 70 Invariant Latitude, we have a length of

           3
40,000       cos70  1710(km)                                                           (3)
           24

or a total current of 540,000 A.



       The current layer is unique in that this narrow interface is the site of forces that

act upon the plasma that are normally not considered important in adjacent regions, and

which contribute to this local acceleration. The equation for the motion of a particle of

charge q and mass m in this region of electric and magnetic fields is given by the Lorentz

force equation

                 
 
mv  q( E  v  B)  Fext                                                                (4)


      
      
where v is the acceleration, v is the velocity, E and B are the electric and magnetic fields,

respectively, and Fext is the sum of other external forces. If one assumes that the field

variations are small over the gyroperiods of the particles, then the first order components

of the motion along the boundary (perpendicular to the local B since the field rotates

across the boundary, see Figure 1-2) are:

                   
   v  vE  vF  vG  vC                                                                (5)


where the components are caused respectively by perpendicular electric fields, called E

cross B drift, external forces, and the gradient and curvature of the magnetic field.
                                                                                       14


Outside of the magnetosphere, the first term, namely
      
    EB
vE                                                                                    (6)
      B2


is dominant such that the other terms may be neglected. This is the condition for “ideal

MHD” and describes a plasma locked to (or frozen in) the surrounding magnetic field. In

the current layer, though, other terms also become important. For example, the curvature

force drift

    mv 2 ˆ 
vC         RB                                                                        (7)
     RqB 2


where R is the local radius of curvature of the magnetic field lines, is greater in this

region where the field “kinks” from its IMF orientation to the geomagnetic field

geometry, than in the regions on either side of the current layer. This equation can be

equivalently expressed as


  
              
        mv2    
                    
  vC   4 B   B  B
        qB
                                                                                       (8)



from which the terms in the square brackets may be shown via Ampere’s Law to be
                   
equivalent to  o J  B plus a component of the magnetic pressure. Thus, there is an

equivalent way to view this curvature drift in terms of the current. Similar to the

curvature case, in situ measurements have shown this current layer to be a region of
                                                                                          15


depressed total magnetic field [Gosling et al., 1986], so that the gradient term

      1 2
       mv 
 vG  2 3 B  B                                                                         (9)
       qB


cannot necessarily be neglected. The external force term vF is unaffected by this region

and remains negligible. In short, although MHD approximations hold for the most part

inside and outside of the magnetosphere, the current layer is a region where this is not the

case, and particles accelerated along the boundary as described by the full kinetic

equations of motion will map down to low altitudes via the true magnetic cusp and

should be detectable in the low altitude measurements when passing through this

footprint. In this limited region simple velocity dispersion does not hold true. The

velocity (i.e. phase space) distribution of the ions and electrons are determined by the full

equation of motion. If this work can show a unique mapping to low altitudes then we

have a view of the processes occurring in this non-MHD region.



1.6 Cusp Models



       Extending the concept of antiparallel merging [Crooker, 1985] to the low altitude

cusp, Crooker [1988] proposed a mapping of the potential drop along the merging line at

the magnetopause down to the ionosphere via the cusps. The antiparallel model predicts

a stretched cusp radiating away from the classical cusp point (i.e. where the cusp would

be without interconnection of the fields), with the potential drop across an increasingly

shorter distance along the magnetopause mapping to points further from this classical

location. In order to maintain a realistic distance across which this potential is applied,
                                                                                        16


the cusp must be wedge-shaped, with its base at the classical cusp point and the full

potential drop applied across it (Figure 1-3). The edges of the wedge would map to the

innermost regions of the magnetopause along the neutral line, moving to the outer surface

as one moves towards the center of the wedge.



       Another result of this topology of interconnected field lines is that this distended

cusp rotates about its base with variations in the y-z plane (in GSM coordinates, see

glossary) of the Interplanetary Magnetic Field (Figure 1-4). For a purely southward IMF

the wedge is wide with the point facing towards lower latitudes, and resembles the more

generally conceived large ovoid cusp. As By increases, though, the tip begins to swing in

the direction of the By component, until for a purely By case the point of the wedge faces

duskwards perpendicular to its southward orientation. As Bz becomes more positive, this

cusp wedge continues to rotate and become thinner (since the total potential drop across it

becomes less), until it becomes a very narrow poleward directed wedge for a pure

positive IMF Bz. This type of narrow, IMF-dependent cusp wedge is consistent with

what we have defined as the true cusp.
                                                                                 17




Figure 1-3 View from the Sun towards the Earth of southward Interplanetary
Magnetic Field lines mapping the solar wind potential drop through the
magnetopause down to the cusp. X’s represent the places where the field linescross
the “X-line”, the line at which the IMF and geomagnetic field lines interconnect.
The geomagnetic (curved) field lines are shown near the magnetopause surface up
until they turn Earthward towards the cusp (shaded). The footprint of these “first
open” field lines thus is a wedge in the ionosphere. (adapted from Crooker, 1988)
                                                                                      18




Figure 1-4 Schematic of the relationship between IMF angle and northern polar cap
convection and cusp geometry. In each case, the Sun is towards the bottom and the
view is from above the North Pole. The “wedge cusp” (where the lighter flow lines
cross the heavier polar cap boundary) can be seen to narrow and rotate at its base with
changes in the IMF direction from southward (bottom) to duskward (middle) and
finally northward (top). (from Crooker, 1988)
                                                                                         19


2. Instrument Description



        Although several different instruments on various satellite platforms have been

used in this research, the primary instrumental focus has been exploiting the higher

resolution, low altitude data taken by the MEDUSA instruments aboard the Swedish

Astrid-2 and Munin satellites. Astrid-2 had an operational lifetime from January to July

of 1999, and Munin’s short operational life was late November 2000 to mid-February

2001.    These platforms are ideal for searching for a small-scale mapping of the

magnetopause current layer, due to their low altitude (and thus high speed through the

feature) and their high measurement speed, so that smaller and more detailed structures

may be detected.



2.1 MEDUSA Overview



        The Miniaturized Electrostatic DUal-top-hat Spherical Analyzer (MEDUSA) was

flown aboard the Swedish Astrid-2 microsatellite [Marklund, 2001]. A second, almost

identical model, MEDUSA-2, was the primary science instrument of the Swedish Munin

nanosatellite [Norberg et al., 1998]. The instrument is composed of two spherical top-hat

analyzers placed top-to-top with a common 360º field of view. An electrostatic charge is

placed on a hemispherical plate (positive for electrons, negative for ions) so that only

particles with the correct velocity will be deflected by the electric field into the correct

radius and be counted. Each detector is divided into 16 azimuthal sectors of 22.5º, with

an elevation acceptance of about 5º. They have an energy per charge range of about 1 eV
                                                                                           20


to 20 keV for electrons and positive ions. The sensor and associated electronics box have

a total mass of 1.7 kg and consume 3 watts of power when in operation.                  More

information on the MEDUSA instrument can be found in Keith [1999] or Norberg et al.

[2001].



2.2. Capabilities/Modes



          The original MEDUSA-1 analyzer aboard Astrid-2 could operate in two modes.

In the first, data from all 16 sectors of both electrons and ions are relayed to the ground.

In the second, however, only the three sectors from each side that are closest to the

parallel, perpendicular, and antiparallel magnetic field directions are recorded. The data

presented below is of this second type. The spatial/temporal resolution is always the

same, and is sixteen 32-step sweeps per second for electrons, and eight 32-step sweeps

for the ions. Given Astrid-2's circular orbit of 1000 km, this gives a spatial resolution of

460 m/sweep for electrons, and 920 m/sweep for the ions.



          The MEDUSA-2 model flown aboard Munin could also relay a full 16-sector

dataset, but in its select mode any number of sectors may be sent. Since Munin is

stabilized to the magnetic field, each sector look direction is at a fixed pitch angle, so the

most common arrangement was for one 8-sector side to be kept. This second model also

has a sweep four times longer than the original; however, the spacecraft’s elliptic orbit

(1800 km apogee, 700 km perigee) makes a calculation of its spatial resolution slightly

more complicated.
                                                                                           21


2.3. Other Instruments



       Data are also presented from three other satellites, which show similar cusp

signatures.   The earliest observation of this feature is from the LAPI instrument

[Winningham et al., 1981] on the DE-2 satellite. From the UARS satellite, data are given

for the HEPS/MEPS instruments [Winningham et al., 1993]. The U.S. Air Force's SSJ/4

particle instrument [Hardy et al., 1984] on the DMSP satellites comprises the final source

of data. In contrast to MEDUSA, these other instruments have sweep times ranging from

1 to 8 seconds, so less detail is available in the study of these features which are traversed

in a few seconds to a few tens of seconds (approximately 30 to 300 km in width). In

addition, DC field and AC wave data are shown when available from other instruments

on the various satellite platforms.
                                                                                          22


3.   Observations



       In this section examples of data from various satellites will be presented in order

to establish the characteristics of the true cusp’s low-altitude signature, and to

demonstrate its independence of any particular type of instrument or measurement.

These examples are representative of the larger set of cusp passes found in this study.



3.1. Astrid-2 Data



       Data from the MEDUSA and EMMA instruments aboard Astrid-2 are shown in

Figure 3-1. The data were taken on January 13, 1999, during a pass over the southern

auroral zone. The spacecraft was traveling equatorward at an altitude of 1,029 km. The

particle data for this and the other spacecraft are primarily presented as spectrograms,

with the time axis along the bottom, the energy axis at the left in units of electron volts

(eV), and the color bar indicating the intensity. Particle intensity measurements are given

in units of differential energy flux, i.e. ergs/cm2-ster-s-eV. The various data sets will be

described in detail beginning with the medium energy ion data in the bottom three panels.

In the antiparallel (downward moving) ion spectrogram (Figure 3-1, bottom panel), a

typical dispersion signature can be seen, although it appears to be nearly flat at about 300

eV from 20:12:49 to 20:13:13 (all times given in UT). The feature we are interested in,

however, is less than a third of the “typical” dispersion pattern, at the equatorward edge

from 20:13:16.5 to 20:13:28. It stands out as a sudden increase of about 1.5 keV (from

~500 eV to ~2 keV) in the peak energy of the ions. The peak energy of the feature then
                                                                                        23




Figure 3-1 Astrid-2 data from January, 13, 1999. The data are taken during an
equatorward pass through the southern cusp region. The time on the x-axis is
given as minutes and seconds since 20 UT. The top three panels contain
frequency-time spectrograms of electric (top) and magnetic (second two) waves
measured at Astrid-2. The red and white areas are times of greatest wave power,
which are seen to be very broad band. The wave intensity is the largest when the
cusp ion and electron fluxes are the largest, from 20:12:49 to 20:13:13 UT. The
middle three panels contain electron fluxes and the bottom three panels ion fluxes.
For both the electrons and ions, the top panel contains particles at “zero” pitch
angle (flowing up the field line). The middle particle panels are trapped particles
(90 pitch angle) and the bottom set contain downcoming particles (180 pitch
angle). All three ion panels show a colored band of fluxes with a general upward
trend in energy from left to right – that is the typical cusp ion dispersion. The top
ion panel also shows low-energy ions flowing up from the ionosphere at the same
two times and the wave intensity peaks. The fourth and fifth panels also contain
line plots of the two perpendicular electric field components (with a scale on the
right). Panels six and seven display residual magnetic field intensity (after
subtracting a model field) for the same two perpendicular directions as the electric
field. The bottom two line plots are the y and z components of the IMF as
measured by IMP-8.
24
                                                                                         25


dips to about 1 keV at 13:21.5 and becomes weaker in intensity. From this point until

13:28 the energy steadily increases back to 2 keV. This 10-second interval clearly has a V

shaped ion structure, with higher energies on the edges and lower energies towards the

center. The ions cut off abruptly on the equatorward edge of the cusp at 13:30. The same

feature is present in the mirroring perpendicular pitch-angle ions, and the 2 keV “wings”

appear in the parallel (upwards) ions, however, the lower energy central portion is not

present. In these latter two spectrograms (Figure 3-1, second and third from the bottom),

low-energy enhancements (~3 eV to 100 eV) can also be seen at the beginning (13:18)

and end (13:25) of the feature moving up the field line. The middle three spectrograms

contain the medium energy electron data. The antiparallel (downwards) electrons (sixth

panel from the top) and to a lesser extent the other pitch-angle electrons, also show < 300

eV enhancements at 13:18 and 13:25.



       The EMMA electric and magnetic field experiment [Blomberg, 2001] measures

two spin-plane components of the electric field and all three components of magnetic

field. For the data presented here, the electric field along the direction of the magnetic

field has been assumed to be zero, and the two perpendicular components in the eastward

and equatorward directions have been calculated. (This assumption is consistent with

other spacecraft, which can measure all components of the electric field. The electric

field parallel to the Earth's is generally small, because of the mobility of the ionospheric

electrons to reduce parallel charge separations. The only location where parallel electric

fields have been observed is above auroral arcs, on the nightside of the Earth [Bonnell et

al., 1999].) The magnetic field direction makes an angle of –23º with the spacecraft spin-
                                                                                        26


plane at the time of this cusp crossing. Linear scales for the electric and magnetic field

data are shown on the right hand side of the bottom six panels, and are in units of mV/m

and nT, respectively. The electric field in the fourth (eastward) panel fluctuates about –

10 mV/m outside of the cusp, but begins to gain amplitude going into the high-latitude

end of the dispersion feature at about 13:00. The field peaks to –225 mV/m at the

poleward edge of the ion feature at 13:16.5. After this, it increases steadily to 200 mV/m

at the equatorward end of the feature (13:28), and afterwards settles to 0.            The

equatorward (north, in this case) pointing perpendicular electric field in the fifth panel

begins at a potential of 100 mV/m before dropping by 250 mV/m at the poleward edge of

the V. It then returns to its original value of 100 mV/m in the center before plunging to –

300 mV/m at the far edge of the feature. It then settles to approximately zero as well.

The detrended (delta) magnetic field in the same two directions is shown on the fourth

and third from the bottom panels of Figure 3-1. The upper (eastward) component goes

from 600 nT before the V, down to –150 nT at the end, revealing a significant current

system in that one limited region. Northward data in the lower (equatorward) panel also

shows a net drop of about 200 nT over the feature, although the trend is much less

obvious in this case. The bottom two panels contain line plots of the GSM y and z

components of the Interplanetary Magnetic Field, as measured by IMP-8 outside of the

bowshock. These values have not been time-shifted, however, they are representative of

the delayed values for this pass (weakly southward and strongly duskward).             The

significance of this will be explored in the survey and discussion sections. The top three

panels of Figure 3-1 contain values proportional to the square root of the wave power for

the electric (top panel) and magnetic (second and third panels) fields. The units are given
                                                                                          27


on the left-hand side for each panel. The vertical axis is in hertz and the color bar

indicates the log of the intensity. This data presentation is typical and appropriate for

cases such as this where the relative magnitude is the significant feature and quantitative

measurements are not necessary.       The data for the magnetic field fluctuations are

calculated by an FFT from the detrended magnetometer data perpendicular to the main

field in the eastward (second panel) and equatorward (third panel) directions in nT/Hz 0.5.

The square root of the electric field wave power is calculated in the same manner, and is

shown at the top of Figure 3-1 with a color bar in units of log mV/m Hz-0.5. The

sonograms show frequencies up to 8 Hz, calculated with a four second sliding window.

The time period of the ion feature, from 13:16 to 13:28, coincides with a dramatic

increase of over two orders of magnitude in the wave data at all displayed frequencies.



       The Magnetic Local Time of the ion V event was about 10:52, and the Invariant

Latitude range covered only 0.57º, from -69.54º to -68.97º. The length of the satellite

track as it crossed this feature is only ~86 km (only about 10 of the old one-second

sweeps), which makes this a very small feature indeed, even in terms of the cusp proper.

Examples of this type of feature are by no means unique, but can be hard to spot due to

their small size, and the fact that they are very localized in IL and MLT, being found

within about an hour of noon in MLT at cusp latitudes.
                                                                                         28


3.2. Munin Data



        The MEDUSA-2 instrument aboard Munin was almost identical in construction to

the original MEDUSA instrument, although improvements in its construction led to a

much more uniform sensitivity around the sectors, and a better overall geometric factor.

The data presented here is from the “select” mode most often used during this mission,

i.e., eight of the sixteen sectors from each of the two sides of the sensor (ions and

electrons) are sent down, since the other eight sectors of each side are redundant in pitch

angle. Data from December, 20, 2000, are shown in Figure 3-2. The electron sector

closest to an antiparallel to the field (i.e. particles coming down to the Earth along the

field) is shown on top, while the ions from the same look angle are shown on the bottom.

The satellite was near apogee at 1,826 km heading poleward over the south polar region.

The structure in this case begins at 21:10:44 UT at the equatorward edge of the cusp

dispersion pattern with an initial peak in the ions of about 2 keV. The ion energy quickly

falls after this to about 500 eV before quickly spiking back to nearly 2 keV about two

seconds after the first peak. The feature stands out as usual in the electron data, although

the intensification at the edges is hard to see due to the strong electron fluxes throughout

this pass.



        The feature took place over an Invariant Latitude range of 0.08centered at

–82.98. The Magnetic Local Time was in the afternoon sector centered at 13.38 hours.

The size of the feature along the satellite track was an astonishing 12 km, by far the

smallest such feature yet seen in the data. This V structure would not even be detectable
                                                                                      29




Figure 3-2 Munin data from December, 20, 2000. Data from a poleward cusp pass in the
southern hemisphere. The upper spectrogram is precipitating electrons, and the lower
spectrogram shows the ions for the same look direction. A very small V feature can be
seen at the equatorward (left) edge of the ion flux in the lower panel, near 21:10:43 UT.
                                                                                        30


to most plasma instruments, the two second crossing time would allow for only a couple

of the one second resolution sweeps. The IMF during this time, as measured by the ACE

spacecraft, was weakly northward and strongly duskward. Since the cusp wedge is

expected to narrow for northward IMF, this size is consistent with the theory.



3.3. UARS Data



       Other instruments have seen similar structures, despite the fact that they typically

have much lower time resolutions. The HEPS instrument on the UARS satellite studies

high-energy electrons and ions (from 30 keV to 5 MeV and 150 MeV, respectively) and

consists of four electron/proton detectors, two electron detectors, and two Low Energy

Proton (LEP) detectors [Winningham et al., 1993]. HEPS data presented here (Figure 3-

3, lower two spectrograms) are electrons from one of the near-zenith pointing detectors,

and protons from one of the LEP detectors. The MEPS spectrometer is made up of eight

divergent plate electrostatic analyzers and looks at electrons and ions in the 1 eV to 32

keV range. Each detector is situated on the spacecraft to have a different look direction

angle with respect to the spacecraft. The MEPS data here (upper two spectrograms) are

electrons and ions from the detector which has a look direction of 36.6º with respect to

the spacecraft zenith [Winningham et al., 1993]. The time resolution is 2 seconds for

MEPS, and 4 and 8 seconds for HEPS electrons and protons, respectively. Data from a

1991 cusp pass are presented in Figure 3-3. The data were taken on November 9th, while

UARS was heading poleward at an altitude of about 600 km. The feature of interest is

located in the afternoon (13:30) sector in MLT and about 67º IL. A V-shaped feature can
                                                                                    31




Figure 3-3 UARS data from November, 9, 1991. The top two spectrograms are
medium energy electrons and ions, while the lower two are high energy electrons and
ions. The upper line plot is the integrated square root of magnetic wave power, while
the lower line plot is magnetic field perpendicular to the spacecraft.
                                                                                         32


be distinguished which lasts about 40 seconds in the MEPS ion data (second panel). It

begins at 05:40:40 at about 2 keV, decreases to ~500 eV in the center (05:40:56) and

increases back to 2 keV at 05:41:17. In contrast to the Astrid-2 data, no ions are seen

poleward of the V structure. The MEPS electron data (top panel) over this same time

period shows enhancements centered at about 40 eV at the beginning and end, with a

strong flux of 100 eV electrons throughout the event.         Notice the softening of the

electrons at the ends, where the density is the highest. HEPS high-energy particle data

(lower two spectrograms) also shows significant enhancements at the edges of the feature

at all energies up to the max plotted of about 300 keV. Equatorward of the feature, both

electrons and ions show very large fluxes. This indicates that the particles are trapped on

closed field lines. From 05:40:26 to 05:40:43, the HEPS electrons (second from the

bottom) fall off steadily, corresponding to the beginning of the MEPS ion feature. There

is also a significant increase of electrons at the poleward edge of the feature at 05:41:16,

which are peaked at or below the low-energy cutoff of 40 keV. The LEP protons (bottom

panel) decrease at the onset of the feature in a similar way to the HEPS electrons, and

also show an increase at all energies at the opposite end (05:41:16).



       The By magnetic field (line plot in third from top panel of Figure 3-3), which is

fairly constant before and after the feature, is very disturbed during the period from 40:40

to 41:17, increasing sharply and then decreasing steadily during this time period, with a

sharp rise at the end. This implies field-aligned currents directed upwards at the edges

and downwards in the center. The square root of magnetic wave power data is integrated

from 0 to 100 Hz and labeled AC/Bx (the scale is on the right of the second panel). The
                                                                                            33


integrated line plot increases by over an order of magnitude to 100 nT at the onset of the

ion feature, dips down to about 40 near the center at 05:41:01, and then peaks again at 80

nT at the end of the structure before returning to low (under 10 nT) values. The Invariant

Latitude covered during this time, though, is only 1.2º, which is about 143 km in the

north/south direction. This pass, however, had a significant east/west velocity component

also, which gives an orbital distance of almost 280 km. This is at the high end of sizes

for this type of feature, a factor of 3 larger than the Astrid-2 feature, but still at the very

bottom of the range of normal cusp sizes. The IMP-8 satellite measured the IMF at this

time to be weakly southward and very strongly duskward.



3.4. DMSP Data



       Particle data from the SSJ/4 instrument of the DMSP-F10 satellite can be seen in

Figure 3-4. SSJ/4 is a set of four cylindrical electrostatic analyzers, two sensors each

(high and low energies) for both electrons and ions. Together they cover an energy range

from 30 eV to 30 keV, completing a spectrum once per second. The DMSP satellites are

non-spinning, and the SSJ/4 detectors are mounted such that they are always pointed

radially outwards from the Earth. Near the polar cusps, this zenith direction will be close

to the (anti)parallel field direction, depending on which hemisphere is being observed.

Further information about the DMSP program and the SSJ/4 instruments can be found in

Hardy et al., [1984]. The data presented are from March 28, 1992, when the satellite was

passing equatorward over the cusp at an IL of 73º and a MLT just post noon (12:20). The

ion data (lower panel) again exhibits the energy-latitude dispersion as it passes from
                                                                                    34




Figure 3-4 DMSP F-10 data from March 28, 1992. Data was taken during an
equatorward cusp pass in the northern hemisphere. Upper spectrogram is electrons,
and the lower spectrogram is ions.
                                                                                        35


higher to lower latitudes, and also clearly shows a "V" structure beginning at 10:10:55

UT which lasted just under 25 seconds. The peak energy of the poleward edge of the

structure is slightly less in this case, about 1 keV, however, the middle and equatorward

edge are peaked at 500 eV and 2 keV just as the previous case was. The corresponding

electron (upper panel) enhancements at the edges are also similar to the previous cases,

being mostly in the 100 to 200 eV range. The satellite altitude at the time of the pass was

770 km, and the feature spanned 0.77º of Invariant Latitude, giving it a latitudinal width

of about 96 km and an orbital track of just over 178 km. Like the other cases this is very

small, on the order of a proton gryroradius at the magnetopause.


3.5. DE Data



       The final example of this new cusp feature comes from a cusp pass of the DE-2

satellite on September 6, 1982 (Figure 3-5). The data were taken by the Low Altitude

Plasma Instrument (LAPI), which consists of 15 parabolic electrostatic analyzers

covering 180º for ions and electrons from 5 eV to 32 keV and two Geiger-Mueller (GM)

counters which measure > 35 keV electrons at 0º and 90º pitch angles (angle relative to

the magnetic field direction). Particle spectrograms are from the electron sensor with a

look angle of 19º from the magnetic field (top panel) and from the ion sensor with a look

direction 64º from the magnetic field. One 32-step spectrum is taken each second from

each sensor. Detailed information on this instrument is available from Winningham et al.

[1981]. The data were taken on an equatorward pass, the cusp being located at an IL of

63º and an MLT pre-noon (10:13). A clear dispersion signature can be seen in the ion

data (Figure 3-5, second panel), moving from lower (poleward) energies to higher
                                                                                    36




Figure 3-5 DE-2 data from September, 6, 1982. Data was taken during an
equatorward cusp pass in the northern hemisphere. The top spectrogram is electrons
measured at a 19 pitch angle. The second is ions measured at a pitch angle of 64.
The third plot contains high energy electrons integrated for energies greater than 35
keV and 0 and 90 pitch angle, and the bottom spectrogram is measured square root
of the electric wave power.
                                                                                       37




(equatorward) energies, although the spectrogram appears to be flat as in some of the

earlier cases at about 1 keV from 8:37:00 to 8:37:30. The feature can be clearly seen

beginning at the equatorward edge from 8:37:30 to 8:37:40. This V is at unusually high

energies, with peaks at around 20 keV down to 2 keV at the center. The electrons (Figure

3-5, top panel) clearly show enhancement during this same time period, from 30 keV

down to the lowest energies. Above 1 keV the fluxes vary spatially the same as the GM

data in panel 3. Below 1 keV there is a different morphology, though, remaining steady

throughout the feature. The third panel of Figure 3-5 is Geiger-Mueller data and the

parallel (black) and perpendicular (red) lines both indicate clear enhancements over their

already elevated levels at the two edges of the feature and are collocated with the ion V

edges. At the equatorward edge the 90º pitch angle GM data jumps to much higher

fluxes, indicating trapped particles on closed field lines similar to the UARS example, as

we would expect equatorward of the true cusp.



       The bottom panel of Figure 3-5 is square root of AC electric wave power from the

VEFI instrument displayed from 4 to 1000 Hz. This spectrogram shows strong waves at

400 Hz and lower during the V. The ion feature covers about 0.4 º in IL and about 18

minutes of MLT, which corresponds to a very narrow feature of approximately 76 km.

The ISEE 1 and 2 satellites measured the IMF during this time period to be primarily

duskward, with significant southward and tailward (Bx) components.
                                                                                        38


4.   UCLA Model



       During the investigation of this cusp feature, it was decided that it would be

helpful to see what might be learned from a kinetic model of the entering particles that

form it. Rather than attempting a simplistic kinetic raytracing model independently, an

outside model was sought that could fulfill this role and give a more complete and self-

consistent answer.



4.1. Description



       For this raytracing study the help of Dr. Robert Richard of the University of

California at Los Angeles was solicited. The model used by Dr. Richard is known as a

hybrid model, since it incorporates both magnetohydrodynamic (MHD) and kinetic

modeling techniques. The MHD code is used to establish the electric and magnetic fields

in the magnetosphere, and then the particles are traced kinetically as they interact with

those fields [Richard et al., 1994]. For this particular situation, it was decided that a

reverse raytracing would be more practical, since we are interested in the source of a very

limited low-altitude population.    A more detailed description of the model and an

example of its usage in this fashion may be found in Ashour-Abdalla et al., [2000].
                                                                                            39


4.2. Inputs



        The inputs for the raytracing were the IMF at the time of the event being studied,

the low-altitude location of the measured feature, and the particle distribution. The event

chosen for study was the January 13, 1999, cusp pass of Astrid-2. Distributions of both

the edges and center portions of the feature were incorporated into the reverse raytracing.

Although the IMF was strongly duskward at the time, there were also significant x and z

components, which were not explicitly included in the model. The dipole tilt was set to

its January 1, 1999, value which should not add a significant amount of error to the

simulation. 31,000 particles were traced through the model fields, which is similar to the

number normally used for forward tracing, and allowed for greater resolution at the low-

altitude area of interest.



4.3. Procedure and Results



        After running a forward MHD model with a rotating IMF orientation from

southward to duskward to establish the field geometry, the low-altitude ionosphere was

studied at various times to find the most suitable geometry for launching the particles.

Crooker-like wedges of open field lines were found on the dayside polar cap region,

although the bases tended to drift off magnetic local noon in the direction opposite the tip

(Figure 4-1). The wedge points towards dusk in the north, and dawn in the south, as

expected from the Crooker model. This geometry was nevertheless encouraging, and

regions in the north and south were selected as launch points (black bars in Figure 4-1).
                                                                                     40




Figure 4-1 Model polar regions, showing wedge of open field lines (green)
surrounded by closed field lines (red) and particle launch positions (black bars). The
Sun is to the left and both hemispheres are viewed from the north looking southward
(i.e. through the Earth for the southern hemisphere). The green wedges of open field
lines can be seen on the dayside pointing in the correct directions.
                                                                                        41


       The particles were launched from their low-altitude position with their bulk

velocity reversed. This allowed the particles to be traced backwards along the model

field and presumably to their entry point. Due to the unique nature of the cusp as a

mapping of a large region of space, we expected a great deal of scatter in the reverse

calculation. This was indeed the case, although the overall trend was definitely to

connect this wedge of open field lines to the dayside magnetopause. Figure 4-2 shows a

particle path that is representative of the trajectories examined. The blue path is shown

together with a pink cross section of the magnetopause, the sun being towards the right of

the figure. The bottom axis is the x direction increasing towards the Sun. The vertical

axis is the magnitude of the distance from the x axis in the y-z plane. This is done in

order to rotate the plane of the motion into the figure rather than showing a projection

that would not clearly indicate the particle’s proximity to the boundary. The particle

leaves the northern cusp region and travels towards the northern exterior cusp at the dusk

flank of the magnetopause as expected. Rather than turning out into the solar wind,

however, this particle becomes temporarily trapped at the boundary. It travels tailward

for some distance before exiting the magnetopause. This figure shows that while the

initial particle path behaved exactly as expected, after reaching the boundary layer it did

not behave as a magnetosheath particle traveling from the Sun.           A more detailed

understanding of the particle interactions at the magnetopause resulting in more realistic

particle paths will require more effort on how the model treats the magnetopause current

layer boundary, as well as a better understanding of the boundary itself from new in-situ

measurements. Efforts with Dr. Richard are ongoing in investigating this feature.
42
                                                                                          43


5. Statistical Survey



       In order to understand this unique feature in more detail, and its correlation with

factors such as the Interplanetary Magnetic Field, a statistical survey was undertaken.

The survey produced a set of time-tagged cusp passes for 4 of the DMSP satellites (F8,

F9, F10, and F11) and Astrid-2, with the time-delayed IMF given as a clock-angle sector.

This allowed a large number of passes to be evaluated rather quickly, taking into account

the prevailing IMF for the pass.



4.3. Goals



       The primary goal of this survey is to determine the consistency of the V feature

and to correlate it with position and IMF. Also, a rough frequency estimate may be

made, keeping in mind that the feature and the satellite tracks are both very limited, and

so will not necessarily intersect even when all other conditions are favorable.



4.4. Setup and Parameters



       The first step in the survey was to build a database of cusp passes for the satellites

to be studied. The satellites were chosen due to the large amount of data to work from (in

the case of the DMSP satellites), and their favorable orbits and instrument suites.

Although the cusp is quite limited in spatial extent for a given low-altitude pass, it moves

around significantly, so a fairly large “cusp box” had to be defined in the north and south
                                                                                      44


in order to catch the majority of candidate passes. The boxes were defined as being

between 10:30 and 13:30 in MLT, and for the northern (southern) box, an Invariant

Latitude of between 60 and 80 (-60 and –80). The entry and exit times of each

passage through the boxes were compiled without regard to IMF direction using software

that will be described in the following section.



       Once the cusp crossing times had been compiled, each time was used to calculate

a time-shift for IMF data taken by the IMP-8 satellite (when available). This time shift

was subsequently used to calculate an average IMF for each pass, which was converted

into one of 8 clock angle sectors. Once all of these data had been collected, they were

used to create spectrograms in the GIF file format for each cusp crossing. The filenames

were time tagged with the beginning time, and included codes for which hemisphere the

spacecraft was in, as well as the IMF clock angle during the pass.



       The GIF image files were then manually sorted by their content. First, a list of

“successful” cusp passes were compiled, success being defined as having a clear cusp

signature in the ion and electron spectrogram data. Next, possibly relevant passes were

noted for closer examination. A more detailed look was then taken of the candidate

passes so that they could be correctly categorized. This process was repeated for all of

the satellites examined, and the results compiled together.
                                                                                          45


5.3. Methodology



       All of the particle data used in the study was accessed through the SDDAS

(Southwest Data Display and Analysis System) and were already available at the start of

the survey.   IMF data from the IMP-8 satellite was downloaded from the NSSDC

(National Space Science Data Center) and processed into SDDAS for the survey. IMP-8

magnetometer data were provided by Principal Investigator, Dr. Ronald Lepping. The

survey was conducted using a series of programs designed to use the Instrument Data File

Set (IDFS) of SDDAS, called SCF’s (Special Computations Files). See Appendix A for

examples of the programs used.



       The first SCF looked through all available Orbit Attitude (OA) data for a given

satellite, and compiled as output the times and locations when the spacecraft passed into

and out of the “cusp boxes” defined earlier. These data were collected in text files. The

text files were subsequently used as input for a second SCF, which used the time ranges

of each pass to calculate an average delay time for the IMF. This was accomplished by

using the position of IMP-8 during the specified time range and the three-dimensional

magnetic field geometry as described by Kelly et al., [1986]. The approximation of using

only the x component of the separation distance to estimate the IMF delay was not used,

since during times when IMP-8 is close to the bowshock the errors can be significant

(i.e., y and z components are of comparable size to the x component). The formula

developed for calculating the distance from the Earth to the portion of the appropriate
                                                                                          46


field line lying along the Earth/Sun line can be stated as

                Bx                       B                     B  
L x                    y  cos tan 1  z    z  sin tan 1  z              (10)
              B y  Bz2                  By                    B y  
                                                                   
                2
                                                         

where L is the distance from the center of the Earth to the field line being measured by

IMP-8 at the specified time and x, y, and z are IMP-8’s position in Geocentric Solar

Magnetic (GSM) coordinates (see glossary). Bx, By, and Bz are the components of the

IMF, also in GSM coordinates. This distance was then used to calculate the delay time

down to low altitudes by using

     Dmp  L                                                                            (11)
d                tp
       v sw

where d is the delay time in seconds, Dmp is the standoff distance of the magnetopause

along the Sun/Earth line, vsw is the velocity of the solar wind, and tp is the travel time to

low altitudes. Average values were used for these additional parameters. The solar wind

speed was assumed to be 400 km/s, the magnetopause standoff distance 10 Earth radii,

and the propagation time 10 minutes. The delay times were then written to a new text

file, along with the previous information which was passed through.



       The final SCF written for this survey was used to characterize the IMF for each

pass. The times for each pass, as well as the IMF delay times, were input to this SCF,

which then retrieved the delayed IMF data and averaged it for By and Bz. These two

values were then used to select one of 8 clock angles for output, along with the other

data. The sectors were numbered counterclockwise looking from the Sun to the Earth,

starting with the first one being the sector just northward from dusk. Zero was used for

those times when no delayed IMF was available and were not used in the study.
                                                                                          47




        The final text data were used as input to a Perl script that produced the GIF

images by calling a batch process in the SDDAS environment. The resulting images

were sorted into folders based on their predominant IMF direction (southward, duskward,

etc.) and evaluated. This involved viewing each image and deciding if further study of

the pass was warranted.      In this way, the tedious portions of the process could be

automated while maintaining human decision-making for the final evaluation of each

pass.



        In the initial image sorting, each pass with an identifiable cusp signature was

flagged and given a short description. In general, all passes were included which had a

significant flux of ions and electrons (at the same time) with energies ranging from a few

tens of eV up to a few keV. Passes in which part of the cusp precipitation was missing,

due to the satellite passing out of the predefined box, were marked as “unclear” so that

they could be plotted individually for classification. Spectrograms containing a clear or

possible V structure were also flagged as such for further study. After this initial sort had

been done for each IMF bin and each satellite, the questionable V’s were examined in

greater detail by individually plotting the specific passes for study.



        Noteworthy in this study of a large number of cusp passes was the almost infinite

variety of particle signatures encountered. In addition to the familiar dispersion, large-

scale V, and even reverse dispersion signatures, there were many that defied simple

classification. Some might be called “double dispersion” from the appearance that there
                                                                                         48


are two clean dispersion signatures right next to each other (perhaps from different ion

species). Some can only be called “S dispersion” due to the many ups and downs of

energy. Clearly this region has plenty of complexity to warrant the widespread study it

has enjoyed since its discovery and will no doubt continue to yield its secrets for years to

come.



        For this study, it was necessary to limit the scope of the survey to finding those

events that clearly show the expected “true cusp” morphology. From initial observations

and theoretical considerations, we expect to see these distinctive features at the

equatorward end of cusp passes, and depending on the cut angle and IMF orientation, a

narrow V shape in the down-going ions at around 1 to 2 keV in energy and a scale-size

on the order of 100 km. The apparent continuum of V sizes in the data studied tends to

blur the distinction between the true cusp signature and larger-scale V’s, which are

discussed in more detail in the discussion section. For our purposes, however, we have

chosen a maximum size of 300 km for the true cusp V’s, corresponding to a 40 second

passage for the DMSP and Astrid-2 satellites, which have similar low-altitude circular

orbits (800 km and 1000 km respectively). The majority, however, are below 100 km

(about 10 seconds) in width.



5.4. Survey Results



        After examining over 3,700 cusp passes from the Astrid-2 and four DMSP

satellites, it became clear that these small-scale V’s are not equally likely at all
                                                                                         49


orientations of the IMF. Figure 5-1 is a histogram of occurrences vs. the eight IMF bins

showing the combined data for all of the satellites in the study. The number of observed

passes from each satellite have been weighted relative to the percentage of passes

occurring during each of the eight IMF clock angles. This general morphology occurs,

however, within each individual satellite data set both weighted and unweighted. This

robust statistical trend clearly shows a preference for strong IMF By, with a lesser

preference towards southward IMF. It is interesting to note that the data also shows a

strong preference for duskward over dawnward IMF, the duskward peak being 2.4 times

the dawnward peak value. This is probably due to the available angles with which the

various spacecraft passed through the cusp region (see Figures 5-2 and 5-3). In the

examples of orbits shown, the angle between the satellite tracks and noon MLT is such

that in the north, a wedge pointing duskward (for duskward IMF) would be traversed

more perpendicularly, while a dawnward pointing wedge would be crossed less

perpendicularly, making the double signature visible less often. A similar argument

holds for the southern hemisphere, keeping in mind that in the south the wedge moves in

the direction opposite the IMF, rather than with it. A "V" signature would be expected if

the spacecraft crossed both arms of the wedge. Given the traversal direction of the

passes, this is much more likely for dusk-pointing fields than dawn-pointing fields.

Figure 5-4 shows how spacecraft trajectories can affect the ion dispersions observed.



       The passes containing true cusp signatures were also examined by looking at the

characteristics of the orbits in which they were found.      Figures 5-2 and 5-3 show

examples (southern and northern, respectively) of the MLT vs. IL polar plots that were
50
                                                                                    51




Figure 5-2 Polar plot of DMSP F-09 cusp crossing ground tracks. The view is looking
northward towards the south pole with the Sun off to the left. The dusk to dawn angle
of the orbits favors dawnward pointing cusp wedges during duskward IMF.
                                                                                      52




Figure 5-3 Polar plot of DMSP F-10 cusp crossing ground tracks. The view is
southward towards the geomagnetic north pole with the sun off to the right. The orbits in
this case are poorly distributed, which may cause uneven sampling.
                                                                                         53




 Figure 5-4 Diagram showing possible cusp wedge traversals in high By cases. The
 Sun is towards the bottom of the figure marked by a 12, while dusk is marked by the
 18. (a) The northern polar cap for duskward IMF (or southern polar cap for
 dawnward IMF). (b) The northern polar cap for dawnward IMF (or southern polar
 cap for duskward IMF). In each case, the satellite track represented by the green
 arrow would see a V structure, while the red satellite track would not. (adapted from
 Crooker, 1988).


generated in order to visualize the orbital tracks of the successful satellite passages. The

black box outlines the cusp box defined earlier, while the colored arcs represent ground-

tracks of the satellite orbits having the small V signature. The color-coded tracks show

the prevailing IMF during each passage, as can be seen from the key on the right hand

side of the figures. In the case of Figure 5-2, the DMSP F-09 satellite was crossing the

box from the pre-noon high latitude sector to the post-noon low latitude sector. Clearly

the successful passes during southward IMF are preferentially on the equatorward side of

the box, but due to the cut angle little can be said about the MLT dependence on IMF.

All of the DMSP satellites crossed the box with a large change in MLT, and in fact for F-

08 and F-09, all of the successful passes were in the south. Figure 5-3 shows the
                                                                                              54


successful passes for the F-10 satellite, which like F-11 had all of its successful passes in

the north. These passes also show diagonal crossings of the box, although in this case

they are so close together it is difficult to make any other statements about them. Astrid-

2 had passes in both hemispheres and at many cut angles, but unfortunately the small size

of its database led to poor statistical relevance.



        Considering the specific location of the V’s in more detail, the following plots

were made from both the northern (F-10, F-11) and southern (F-08, F-09) cases found. In

all of the plots of this type the vertical bars indicate the edges of the V structure, while

the center is indicated by the diamonds. Figure 5-5 shows the Invariant Latitude of each

northern pass with respect to the eight IMF bins. The cusp has been reported by others to

move equatorward for southward IMF [Burch, 1973; Newell et al., 1989; Stasiewicz,

1991; Zhou and Russell, 1997], and that is what is seen here. The data tends to show a

poleward peak near IMF northward, and an equatorward peak slightly dawnward of a

southern IMF. The passes over the southern hemisphere show a similar pattern (Figure

5-6).   The poleward peak is again centered at northward IMF, while the most

equatorward crossings are centered at south. This result is not surprising, but it does

increase the confidence in the other results of the survey, and it is consistent with the

cusp as defined in the introduction and by Crooker (see Figure 1-4). Also consistent is

the fact that the variations are greater in the dawn/dusk regions, such as in the center

(dawnward) portion of Figure 5-6 and the edges (duskward) of Figure 5-5. This spread

may result from the greater variability in position when the cusp is pulled off to the side
55
56
                                                                                        57


for large IMF By, and from variations in the strength of the IMF Bz, which are not taken

into consideration on this plot. A study of the Bz magnitude indeed does show the most

negative values at the most equatorward positions, however, even this correlation has a

significant amount of scatter.



         Similar plots were also generated for the variation of Magnetic Local Times with

the IMF bins. In the northern hemisphere (Figure 5-7), we expect the cusp to be near

noon for northward and southward IMF, postnoon for duskward and prenoon for

dawnward.      The location is also likely to be highly variable, given the expected

elongation in MLT with increasing By. Shifting of the larger cusp proper region in this

fashion has been modeled [Stasiewicz, 1991] and statistical studies appear to bear this out

[Newell et al., 1989]. The locations plotted in Figure 5-7 are indeed well scattered, but

little pattern can be seen. The diagonal satellite tracks mentioned earlier would certainly

be expected to cut an elongated cusp at a variety of local times depending on the relative

geometries, however, the nearly even spread in MLT indicates that the base of the wedge

cusp may not remain fixed as in the Crooker model, but instead drift away from noon

opposite the movement of the tip, as seen in the simulation above (Figure 4-1). The

narrowest region is for northward IMF, which is consistent with a narrower, poleward

directed wedge. The southern hemisphere (Figure 5-8) is again very similar to the north,

showing a scattered spread that tends to narrow for northward IMF. A narrow northward

IMF cusp is also consistent with the poor number of crossings that were found in this

study.
58
59
                                                                                          60


       Overall, some sort of cusp was seen in the particle data for about 40% of the

passes studied. Of those, about 10% contained a V signature, which is about 4% of the

total. This is a very reasonable percentage for a persistent feature with an average size of

about 0.75º in Invariant Latitude and only 0.28 hours of Magnetic Local Time (at the cut

angles available in this study). The uneven sampling of the box by the satellites used in

the study limits the conclusions that can be drawn about its overall movements within the

box, but clearly it moves around a great deal and its shape and position is strongly

influenced by the IMF out at the magnetopause. The picture that emerges from this

statistical survey is of a constantly present limited region within the cusp that is governed

by the IMF direction and tends to stretch longitudinally with increasing By, making it

more likely to be encountered by polar-orbiting satellites.
                                                                                         61


6. Discussion



       It has been demonstrated that these small-scale V features exist throughout the

examined low-altitude datasets and are affected by the prevailing IMF. The following

discussion considers the various explanations that can be ascribed to this phenomenon.

Also, the results from the studies presented above are considered in terms of the

interpretations that they tend to support.



6.1. Consistency of Events



       We have presented data from several different satellites and instruments,

representing various sensor types and technologies. The fact that the narrow "V" feature

is consistent throughout all of the data sets from different satellites and plasma analyzer

types indicates that it is not a characteristic of the instruments taking the data, and must

be considered to be a real structure. Also, the fact that the energetic particle and field

instruments see a feature at the same time with a comparable scale-size also points to it

being something physical. The feature is also persistent, as the statistical survey of

Astrid-2 and DMSP data has shown.



6.2. Possible Explanations



       Reiff et al. [1977] discuss convective dispersion, an injection model they called

for northward IMF "diffusive injection," which assumes an energy dependence on the
                                                                                          62


rate of diffusion from a central "injection field line." This results in an energy dispersion

in which the highest energy particles are towards the edges of the cusp (since they can

random walk farther from their injection point than the lower energy particles). Later

works [Reiff et al., 1980; Burch et al., 1980; Woch and Lundin, 1992; Weiss et al., 1995]

confirmed that these features are seen, usually during northward IMF conditions, and

offered other explanations for these “large scale V’s.” Possible explanations such as tail

reconnection, changes in the IMF Bz, and lobe reconnection have been offered. The

features presented here, however, are of a scale size much smaller than the large V

dispersion features studied by these authors, and appear to be very localized to what has

been defined above to be the "true cusp" region. As was mentioned in the survey

methodology section (5.3), we have defined 300 km to be the break over scale size

between the two types of features. It is clear that in the complex 3-D geometry of the

cusp there are multiple ways to cut through in order to create a V in the ion spectrograms,

so this distinction should be viewed simply as one more step towards fully parsing the

features of the cusp into understandable components. It should also be noted that while

the large-scale V’s have been found to occur predominantly during northward IMF

conditions, the small V’s have been shown here to have a minimum at that orientation.

While some characteristics and possible causes of these two structures no doubt overlap,

we believe that they are not equivalent.



       If this feature is the “true cusp” as has been defined here, then it is simply the

low-altitude mapping of the magnetopause current layer. The current layer separates the

magnetosphere, which is dominated by the Earth's geomagnetic field, and the
                                                                                          63


magnetosheath, which is dominated by the IMF from the Sun. Higher energy particles

penetrate more deeply into this boundary layer and so will be on the earthward side of the

current layer, while lower energy particles are further towards the magnetosheath. Song

et al. [1990] reported that the ion and electron distribution functions increased in average

energy moving inwards at the current layer. At low altitudes, the "inner" edge of the

magnetopause is towards the edges of the true cusp, while the lower energy outer parts

map towards the center [Stasiewicz, 1991]. The result is a low-altitude energy signature

that is peaked at the edges of the cusp, or "V" shaped, reflective of ion energization in the

current layer that is known to increase from outer to inner edge. The further towards the

center of the cusp the satellite track is, the deeper and wider the V. The collocation of the

energetic particles and increase in wave power are also clues to the origin of the feature,

although a simple “cartoon” picture of the magnetopause quickly becomes insufficient to

explain them. The observed low-frequency waves may be those that are seen in the

magnetopause current layer [Gurnett et al., 1979], traveling down the field lines as a

wave guide and further supporting the idea that this is a low-altitude mapping of the

turbulent current layer. The high-energy particles seen at the poleward edge of the

UARS event are more puzzling. If the field lines in this region do not remain high in the

plasma mantle as in the classical picture, but instead twist to lower latitudes in the near

dayside (as in the Crooker model of the cusp) these high energy particles may be part of

the drifting population that is lost on the flanks of the magnetopause. It is also possible

for drifting energetic particles to become temporarily trapped in the outer cusp region

from low latitudes [Sheldon et al., 1998; Delcourt and Sauvaud, 1999]. Drifting particles

with pitch angles initially near 90 encounter a non-equatorial mirror force in the vicinity
                                                                                     64


of the cusp (Figure 6-1) where they are drawn to high latitudes and can become

temporarily trapped. A portion of this population would precipitate around the perimeter

of the cusp funnel. If this magnetopause mapping is indeed the source of the signature,

then this opens up a new technique in the study of magnetopause dynamics.




Figure 6-1 Equatorial ring current particles drift from the plasma sheet to the dayside
magnetopause region and are deflected into a cusp-orbiting trajectory. From here they
may be lost along the edges of the cusp to low altitudes. (from Delcourt and
Sauvaud,1999)
                                                                                             65


6.3. IMF Dependence



       A study of the January 1999 Astrid-2 pass has been conducted using a set of

software called the Orbit Visualization Tool (OVT) being developed at the Swedish

Institute of Space Physics in Uppsala (IRFU) by a team lead by Kristof Stasiewicz. This

software includes 3-D visualization of T96 generated magnetospheric field lines

[Tsyganentko, 1995], and satellite orbits. Magnetopause field lines (adjusted for IMF

and plasma pressure) during this cusp pass in January 1999 are in good agreement with

the satellite position (Figure 6-2) and cover a low-altitude area in IL and MLT that is

consistent with the observations. The field line passing through the satellite location is




 Figure 6-2 Screen shot from the OVT software showing field geometry for Jan. 13,
 1999. View is approximately from the sun, with north at the top of the figure. Notice
 the dawn dusk (right-left) warping of the geomagnetic field lines shown (colored).
 Field line colors indicate field intensity.
                                                                                           66


the one that exits the figure on the lower right hand side. This time step is near the

beginning of the pass. For subsequent time steps the field line mapping through the

satellite is closed, and moves inwards with the progression of time. This visualization, of

course, cannot unambiguously determine the open/closed field line boundary during the

pass; however, it serves to illustrate the relative positions of the field lines crossed. Note

also the dawn/dusk warping of the cusp field lines relative to the (x-z plane) grid.



       One interesting characteristic of the field lines during the Astrid-2 pass is their

obvious twisting in the GSM y direction. This is due to the fact that the IMF input into

the Tsyganentko model for that time was strongly dominated by By (see Figure 3-1,

bottom two panels). Further investigation revealed that all of the V’s that had been found

at that time (for which IMF data is available) took place when the IMF had a dominant By

component. This IMF dependence is supported by work done to date on the statistical

survey, which shows a strong correlation between By and observations of the small V

structure. Although more detailed study of this dependence is needed, it offers a further

explanation for the double-sided nature of the V’s. As described in the introduction,

Crooker [1988] modeled the cusp as a wedge whose base is fixed while the tip rotates

with changing IMF By. In this geometry, the edges of the wedge map to the open field

lines at the outer surface of the magnetopause. During strong By, which has been the case

for most of the V’s studied so far, the cusp will be “wind socked” over so that the

spacecraft in a polar orbit would cross it sideways, giving a double signature, the second

part being the mirror of the first. This is reflective of the x-lines on the dawn/dusk sides

of the magnetopause in Crooker’s model. Available electric field data in the current set
                                                                                        67


of observations appears to support this interpretation. The electric field is V shaped

about the centerline and does not change direction. The integrated potential for the

Astrid-2 pass in the Observations Section is on the order of 50-70 kV. This does not

represent the maximum, as we do not cross the maximum contours. This is consistent

with Crooker’s idea of a concentrated electric field in the throat.



6.4. Evidence from Model



       A hybrid MHD/kinetic model has demonstrated the formation of dayside

“fingers” of open field lines extending from the cusp region of the polar cap, and shown

that particles launched backwards from these points flow directly to the dayside

magnetopause. Work is ongoing to realistically model the processes at the boundary, but

this initial result supports the Crooker interpretation of the cusp and its uniqueness as a

small-scale footprint of the magnetopause current layer.



6.5. Evidence from Survey



       A survey of over 3,700 cusp passes taken from five different satellite platforms

confirms the strong preference of IMF direction expected from the Crooker model of the

cusp. The movements of the cusp and the angle through which it is traversed by the

spacecraft all impact the shape of the spectrogram that is seen, however, the evidence

points to a cusp that swings from side to side with the IMF and is very limited in size.

The evidence from the survey is, therefore, supportive of the existence of a true cusp
                                                                                         68


region in the form of a wedge that responds to the Interplanetary Magnetic Field by

extending in Magnetic Local Time.



7. Conclusions



       Although certainly more work needs to be done in order to fully understand this

unique feature, it is clear from this initial investigation that a window to the larger

workings of the magnetosphere exists at low-altitudes, perhaps even more so than

previously thought [Newell and Meng, 1995]. The data studied indicate a unique feature

in the cusp not previously studied, which we believe to be the low altitude mapping of the

magnetopause current layer, i.e. the true cusp. As more detailed work is conducted, it is

hoped that this model may be integrated to a further degree with the overall mainstream

picture of the cusp and its dynamics.



7.1. Missed Feature



       A small-scale feature has been presented that has been shown to be unique to

regions we call the true cusps of the northern and southern hemispheres and fits our

expectation of a mapping of the magnetopause current layer, which has been previously

reported only in Keith et al., [2001]. It is hoped that as more and more high-resolution,

low-altitude data such as from the MEDUSA instrument becomes available, new

information about the cusp and the associated particle entry processes may be derived.
                                                                                        69


       It is clear that additional investigation is needed regarding these features and the

connections between the true cusp, the magnetopause current layer and the Interplanetary

Magnetic Field in general. Future work will focus on understanding in greater detail the

connections between the IMF, magnetopause current layer and the cusp. This includes

more detailed modeling of the processes under investigation, as well as the addition of

new data; especially magnetopause data from the Cluster satellite mission, which

promises to revolutionize our understanding of that region in the near future. It is hoped

that this work may lead to a consensus on particle entry methods and the relationship of

the magnetopause current layer to the cusp.



7.2. Magnetopause Mapping



       In summary, the data presented are consistent with a measurable low altitude

image of the magnetopause current layer. This set of field lines are those on which ions

are accelerated above magnetosheath energies and which form the classical magnetic

cusp (i.e., not a plasma cusp). The mapping topology at low altitudes appears to “swing”

with By as expected from the Crooker model and has a concentrated electric field as

predicted. The wave data are also consistent with the observations of a turbulent, noisy

magnetopause in the ELF/ULF region. Energetic particles seen at the edges of the V

feature are consistent with    drifting particles that see a non-equatorial mirror force

[Sheldon et al., 1998; Delcourt and Sauvaud, 1999] near the magnetopause and drift up

into the magnetic cusp where they circulate and can be lost.
                                                                                          70




                                        References

Ashour-Abdalla, M., M. El-Alaoui, V. Peroomian, R. J. Walker, J. Raeder, L. A. Frank,
and W. R. Paterson, The origin of the near-Earth plasma population during a substorm on
November 24, 1996, J. Geophys. Res., 105, 2,589, 2000.


Aparicio, B., B. Thelin, and R. Lundin, The Polar Cusp From a Particle Point of View: A
Statistical Study Based on Viking Data, J. Geophys. Res., 96, 14,023, 1991.


Berchem, J., and C. T. Russell, The Thickness of the Magnetopause current Layer: ISEE
1 and 2 Observations, J. Geophys. Res., 87, 2,108, 1982.


Blomburg, L. G., G. T. Marklund, P. –A. Lindqvist, F. Primdahl, L. Bylander, P. Brauer,
S. Eriksson, N. Ivchenko, T. Karlsson, A. Kullen, J. M. G. Merayo, E. B. Pederson, and J.
R. Petersen, EMMA – the Electric and Magnetic Monitor of the Aurora for Astrid-2, Ann.
Geophys., In Press, 2001.


Bonnell, J., R. C. Elphic, S. Palfrey, R. J. Strangeway, W. K. Peterson, D. Klumpar, C.
W. Carlson, R. E. Ergun, and J. P. McFadden, Observations of polar cap arcs on FAST, J.
Geophys. Res., 104, 12,669, 1999.


Burch, J. L., Rate of erosion of dayside magnetic flux based on a quantitative study of the
dependence of polar cusp latitude on the interplanetary magnetic field, Radio Sci., 8, 955,
1973.


Burch, J. L., P. H. Reiff, R. A. Heelis, R. W. Spiro, and S. A. Fields, Cusp region particle
precipitation and ion convection for northward interplanetary magnetic field, Geophys.
Res. Lett., 7, 393, 1980.


Chapman, S., and V. C. A. Ferraro, A new theory of magnetic storms, Terr. Magn.
Atmos. Electr., 36, 171, 1931.
                                                                                         71




Crooker, N. U., A Split Separator Line Merging Model of the Dayside Magnetopause,
J. Geophys. Res., 90, 12,104, 1985.


Crooker, N. U., Mapping the Merging Potential From the Magnetopause to the
Ionosphere Through the Dayside Cusp, J. Geophys. Res., 93, 7,338, 1988.


Delcourt, D. C., and J. -A. Sauvaud, Populating of the cusp and boundary layers by
energetic (hundreds of keV) equatorial particles, J. Geophys. Res., 104, 22,635, 1999.


Dungey, J. W., Interplanetary Magnetic Field and the Auroral Zones, Phys. Rev. Lett., 6,
47, 1961.


Escoubet, C. P., R. Schmidt, and M. L. Goldstein, Cluster - Science and mission
overview, Space Sci. Rev., 79, 11, 1997.


Fuselier, S. A., B. J. Anderson, and T. G. Onsager, Particle signatures of magnetic
topology at the magnetopause: AMPTE/CCE observations, J. Geophys. Res., 100,
11,805, 1995.


Fuselier, S. A., M. Lockwood, T. G. Onsager, and W. K. Peterson, The source population
for the Cusp and Cleft/LLBL for southward IMF, Geophys, Res. Lett., 26, 1,665, 1999.


Gosling, J. T., M. F. Thomsen, S. J. Bame, and C. T. Russell, Accelerated Plasma Flows
at the Near-Tail Magnetopause, J. Geophys. Res., 91, 3,029, 1986.


Gurnett, D. A., R. R. Anderson, B. T. Tsurutani, E. J. Smith, G. Paschmann, G.
Haerendel, S. J. Bame, and C. T. Russell, Plasma Wave Turbulence at the Magnetopause:
Observations From ISEE 1 and 2, J. Geophys. Res., 84, 7,043, 1979.
                                                                                         72


Hardy, D. A., L. K. Schmitt, M. S. Gussenhoven, F. J. Marshall, H. C. Yeh, T. L.
Schumaker, A. Huber, and J. Pantazis, Precipitating electron and ion detectors (SSJ/4) for
the block 5D/flight 6-10 DMSP satellites: Calibration and data presentation, Rep. AFGL-
TR-84-0314, Air Force Geophys. Lab., Hanscom Air Force Base, Mass., 1984.


Heikkila, W. J., and J. D. Winningham, Penetration of magnetosheath plasma to low
altitudes through the dayside magnetospheric cusps, J. Geophys. Res., 76, 883, 1971.


Keith, W. R., Development of an Ion/Electron Plasma Spectrometer, Master of Science
Thesis, Rice University, Houston, Texas, May 1999.


Keith, W. R., J. D. Winningham and O. Norberg, A New, Unique Signature of the True
Cusp, , Ann. Geophys., In Press, 2001.


Kelly, T. J., N. U. Crooker, G. L. Siscoe, C. T. Russell, and E. J. Smith, On the Use of a
Sunward Libration-Point-Orbiting Spacecraft as an Interplanetary Magnetic Field
Monitor for Magnetospheric Studies, J. Geophys. Res., 91, 5,629, 1986.


Lockwood, M., C. J. Davis, T. G. Onsager, and J. D. Scudder, Modelling signatures of
pulsed magnetopause reconnection in cusp ion dispersion signatures seen at middle
altitudes, Geophys, Res. Lett., 25, 591, 1998.


Lockwood, M., and M. F. Smith, Low and middle altitude cusp particle signatures for
general magnetopause reconnection rate variations: 1. Theory, J. Geophys. Res., 99,
8531, 1994.


Lundin, R., On the Magnetospheric Boundary Layer and Solar Wind Energy Transfer
into the Magnetosphere, Space Sci. Rev., 48, 263, 1988.


Marklund, G. T., L. G. Blomberg, and S. Persson, Astrid-2, an Advanced Microsatellite
for Auroral Research, Ann. Geophys., In Press, 2001.
                                                                                           73




Nakamura, M., and M. Scholer, Structure of the magnetopause reconnection layer and of
flux transfer events: Ion kinetic effects, J. Geophys. Res., 105, 23,179, 2000.


Newell, P. T., and C.-I. Meng, The cusp and cleft/boundary layer: Low altitude
identification and statistical local time variation, J. Geophys. Res., 93, 14,549, 1988.


Newell, P. T., C.-I. Meng, D. G. Sibeck, and R. Lepping, Some Low-Altitude Cusp
Dependencies on the Interplanetary Magnetic Field, J. Geophys. Res., 94, 8,921, 1989.


Newell, P. T., and C.-I. Meng, Magnetopause Dynamics as Inferred from Plasma
Observations on Low-Altitude Satellites, Geophysical Monograph 90, 407, 1995.


Norberg, O., W. Puccio, J. Olsen, S. Barbash, L. Andersson, J. D. Winningham, and U.
Jonsson, Munin: A Student Nanosatellite for Space Weather Information, 1998.


Norberg, O., J. D. Winningham, H. Lauche, W. Keith, W. Puccio, J. Olsen, K. Lundin,
and J. Scherrer, The MEDUSA electron- and ion spectrometer and the PIA photometers
on Astrid-2, Ann. Geophys., In Press, 2001.


Reiff, P. H., "Low Altitude Signatures of the Boundary Layers," in Proc. of
Magnetospheric Boundary Layers, Alpbach, 11-15 June 1979, ed. B. Battrick, ESA SP-
148, Noordwijk, Netherlands, 167-173, 1979.


Reiff, P. H., T. W. Hill, and J. L. Burch, Solar Wind Plasma Injection at the Dayside
Magnetospheric Cusp, J. Geophys. Res., 82, 479, 1977.


Reiff, P. H., J. L. Burch, and R. W. Spiro, Cusp Proton Signatures and the Interplanetary
Magnetic Field, J. Geophys. Res., 85, 5,997, 1980.
                                                                                           74


Richard, R. L., R. J. Walker, and M. Ashour-Abdalla, The population of the
magnetosphere by solar winds ions when the interplanetary magnetic field is northward,
Geophys, Res. Lett., 21, 2,455, 1994.


Russell, C. T., The Structure of the Magnetopause, Geophysical Monograph 90, 81,
1995.


Sheldon, R. B., H. E. Spence, J. D. Sullivan, T. A. Fritz and J. Chen, The discovery of
trapped energetic electrons in the outer cusp, Geophys, Res. Lett., 25, 1,825, 1998.


Shelley, E. G., R. D. Sharp, and R. G. Johnson. He++ and H+ flux measurements in the
dayside cusp: Estimates of convection electric field, J. Geophys. Res., 81, 2,363, 1976.


Song, P., R. C. Elphic, C. T. Russell, J. T. Gosling, and C. A. Cattell, Structure and
Properties of the Subsolar Magnetopause for Northward IMF: ISEE Observations, J.
Geophys. Res., 95, 6,375, 1990.


Stasiewicz, K., Polar Cusp Topology and Position as a Function of Interplanetary
Magnetic Field and Magnetic Activity: Comparison of a Model With Viking and Other
Observations,, J. Geophys. Res., 96, 15,789, 1991.


Tsyganenko, N. A., Modeling the Earth’s magnetospheric magnetic field confined within
a realistic magnetopause, J. Geophys. Res., 100, 5,599, 1995.


Weiss, L. A., P. H. Reiff, E. J. Webber, H. C. Carlson, M. Lockwood, and W. K.
Peterson, Flow-aligned jets in the magnetospheric cusp: Results from the Geospace
Environment Modeling Pilot program, J. Geophys. Res., 100, 7,649, 1995.


Winningham, J. D., J. L. Burch, N. Eaker, V. A. Blevins, and R. A. Hoffman, The Low
Altitude Plasma Instrument (LAPI), Space Sci. Inst., 5, 465, 1981.
                                                                                        75


Winningham, J. D., J. R. Sharber, R. A. Frahm, J. L. Burch, N. Eaker, R. K. Black, V. A.
Blevins, J. P. Andrews, J. Rudski, M. J. Sablik, L. D. Chenette, D. W. Datlowe, E. E.
Gaines, W. I. Imhof, R. W. Nightingale, J. B. Reagan, R. M. Robinson, T. L. Schumaker,
E. G. Shelley, R. R. Vondrak, H. D. Voss, P. F. Bythrow, B. J. Anderson, T. A. Potemra,
L. J. Zanetti, D. B. Holland, M. H. Rees, D. Lummerzheim, G. C. Reid, R. G., Roble, C.
R. Clauer, and P. M. Banks, The UARS Particle Environment Monitor, J. Geophys. Res.,
98, 10,649, 1993.


Woch, J., and R. Lundin, Magnetosheath Plasma Precipitation in the Polar Cusp and Its
Control by the Interplanetary Magnetic Field, J. Geophys. Res., 97, 1,421, 1992.


Zhou, X. –W., and C. T. Russell, The location of the high-latitude polar cusp and the
shape of the surrounding magnetopause, J. Geophys. Res., 102, 105, 1997.
                                                76


Internet Links



Astrid-2 Home Page:
http://www.ssc.se/ssd/msat/astrid2.html

Astrid-2 Data Archive:
http://www.irf.se/rpg-bin/astrid/astrid.shtml

Munin Home Page:
http://munin.irf.se/

Munin Data Archive:
http://www.irf.se/rpg-bin/munin/munin.shtml
                                                                                        77


Appendix A



This appendix contains examples of the three types of SCF’s (Special Computation Files)

used in the statistical survey and their associated “C” programs which ran them in a batch

mode. The first file listings are the SCF that pulled the satellite OA data and the program

that selected the appropriate cusp passes. The second are the SCF and program that

calculated the IMF time delay to be used for each pass. The final set are the SCF and

program that selected the appropriate IMF clock angle for each pass.



File 1:   cusp_dmspf10.SCF
File 2:   wmain.c
File 3:   delay_time.SCF
File 4:   dtmain.c
File 5:   get_imf.SCF
File 6:   angsel.c
                                                                      78


/*********************** SCF generated by SCF Editor
*********************/
CUSP_DMSPF10                           /* title
*/
/***************************** Contact Section
***************************/
0                                       /* number of contact lines
*/
/**************************** Comments Section
***************************/
0                                       /* number of comment lines
*/
/***************************** Input Variables
***************************/
2                                       /* number of input variables
*/
/*---------------------------- Input Variable -------------------------
--*/
DMSPF10_CGLAT                           /* input variable name
*/
DMSP DMSP-F10 OA OA 10OC                /* IDFS Source
*/
SENSOR 3                                /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256         256                         /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
DMSPF10_MLT                             /* input variable name
*/
DMSP DMSP-F10 OA OA 10OC                /* IDFS Source
*/
SENSOR 5                                /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256         256                         /* dqual exclusion range
*/
/***************************** Temp Variables
****************************/
22                                      /* number of temp variables
*/
/*----------------------------- Temp Variable -------------------------
--*/
NORTH_CROSS                             /* variable name
*/
0                                       /* rank and length of dimension
*/
/*----------------------------- Temp Variable -------------------------
--*/
                                                                        79


SOUTH_CROSS                               /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
MLT_CROSS                                /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
ZERO                                     /* variable name
*/
0                                         /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
NONE                                     /* variable name
*/
0                                         /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
ONE                                      /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
N_CGLAT_MIN                              /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
N_CGLAT_MAX                              /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
S_CGLAT_MIN                              /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
S_CGLAT_MAX                              /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
MLT_MIN                                   /* variable name
*/
                                                                        80


0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
MLT_MAX                                  /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT0                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT1                                     /* variable name
*/
1 8                                       /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT2                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT3                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT4                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT5                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT6                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT7                                      /* variable name
*/
1 8                                      /* rank and length of dimension
*/
                                                                      81


/*----------------------------- Temp Variable -------------------------
--*/
FMT8                                    /* variable name
*/
1 8                                     /* rank and length of dimension
*/
/*----------------------------- Temp Variable -------------------------
--*/
TCLOCK                                  /* variable name
*/
1 3                                     /* rank and length of dimension
*/
/**************************** Output Variables
***************************/
3                                       /* number of output variables
*/
/*---------------------------- Output Variable ------------------------
--*/
BOX_STAT                                /* output variable name
*/
0                                       /* rank and length of dimension
*/
/*---------------------------- Output Variable ------------------------
--*/
LAT_OUT                                 /* output variable name
*/
0                                       /* rank and length of dimension
*/
/*---------------------------- Output Variable ------------------------
--*/
MLT_OUT                                 /* output variable name
*/
0                                       /* rank and length of dimension
*/
/**************************** Algorithm
**********************************/
/* Set up the constant values used in this program.
*/
/**********************************************************************
***/
ZERO = 0.0
ONE = 1.0
NONE = -1.0
/**********************************************************************
***/
/* Define the northern and southern hemisphere boxes for data.
*/
/**********************************************************************
***/
MLT_MIN = 10.5
MLT_MAX = 13.5
N_CGLAT_MIN = 60.0
N_CGLAT_MAX = 80.0
S_CGLAT_MIN = -80.0
S_CGLAT_MAX = -60.0
/**********************************************************************
***/
                                                                      82


/* Start by declaring that the satellite is not within the search box.
*/
/**********************************************************************
***/
NORTH_CROSS = ZERO
SOUTH_CROSS = ZERO
MLT_CROSS = ZERO
BOX_STAT = ZERO
/**********************************************************************
***/
/* Transfer the satellite position into the output variables.
*/
/**********************************************************************
***/
MLT_OUT = DMSPF10_MLT
LAT_OUT = DMSPF10_CGLAT
/**********************************************************************
***/
/* Mark if the satellite position is in the correct MLT sector.
*/
/**********************************************************************
***/
IF (DMSPF10_MLT > MLT_MIN)
   IF (DMSPF10_MLT < MLT_MAX)
     MLT_CROSS = ONE
   ENDIF
ENDIF
/**********************************************************************
***/
/* Mark if the satellite position is within the correct northern hemis-
*/
/* phere corrected geomagnetic latitude sector.
*/
/**********************************************************************
***/
IF (DMSPF10_CGLAT > N_CGLAT_MIN)
   IF (DMSPF10_CGLAT < N_CGLAT_MAX)
     NORTH_CROSS = ONE
   ENDIF
ENDIF
/**********************************************************************
***/
/* Mark if the satellite position is within the correct southern hemis-
*/
/* phere corrected geomagnetic latitude sector.
*/
/**********************************************************************
***/
IF (DMSPF10_CGLAT > S_CGLAT_MIN)
   IF (DMSPF10_CGLAT < S_CGLAT_MAX)
     SOUTH_CROSS = ONE
   ENDIF
ENDIF
/**********************************************************************
***/
/* Did we find the satellite crosses our northern or southern
hemisphere */
                                                                      83


/* box definitions? If so, note this in the status.
*/
/**********************************************************************
***/
IF (MLT_CROSS == ONE)
   IF (NORTH_CROSS == ONE)
     BOX_STAT = ONE
   ENDIF
   IF (SOUTH_CROSS == ONE)
     BOX_STAT = NONE
   ENDIF
ENDIF
/**********************************************************************
***/
/* If we have found that the satellite position is within the box, then
*/
/* we need to print out the time info for Wayne to use.
*/
/**********************************************************************
***/
IF (BOX_STAT != ZERO)
   FMT0 = "\n"
   FMT1 = "N "
   FMT2 = "S "
   FMT3 = "%04.0f "
   FMT4 = "%03.0f "
   FMT5 = "%08.0f "
   FMT6 = "%09.6f "
   FMT7 = "%10.6f "
   FMT8 = "%9.6f "
/* PRINT (FMT7, DMSPF10_CGLAT) */
/* PRINT (FMT8, DMSPF10_MLT) */
/* PRINT (FMT3, SYEAR) */
/* PRINT (FMT4, SDAY) */
/* PRINT (FMT5, SMILLI) */
/* PRINT (FMT0, ZERO) */
ENDIF
                                                                      84


#ident "@(#) %M% %I% %D% SwRI"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "SCF.h"
#include "SCF_defs.h"
#include "SCF_file_defs.h"
#include "libbase_SCF.h"
/* include "SCF_var.h" */

int main(int argc, char **argv)
{
   long btime_sec, etime_sec, ret_time_sec, ret_time_nano;
   unsigned short scf_vnum;
   short ret_val, btime_yr, btime_day, etime_yr, etime_day;
   short hr, min, sec;
   char filename[80], error_str[150], more_data = 1;
   register int i;
   int num_output, *intptr, *dimen;
   float prevhit;
   float *hitptr, *mltptr, *latptr;
   double time_frac;

     struct scf_data *SCF_DATA;
     void *scf_data_ptr;

     char   cusp_outfile[80];
     FILE   *outfile;
     char   error_log[80];
     FILE   *errlog;

   if (argc != 7)
    {
       printf ("Calling sequence is SCF filename, output file name,
begin year, begin day, end year, end day\n");
       exit (-1);
    }

     /**********************************************************/
     /* Set the file names and time for processing.            */
     /**********************************************************/
/*
     btime_yr = 1998;
     btime_day = 1;
     hr=1;
     min=2;
     sec=0;
     btime_sec = hr*3600 + min*60 + sec;

     etime_yr = 1998;
     etime_day = 1;
     hr=22;
     min=59;
     sec=4;
     etime_sec = hr*3600 + min*60 + sec;
*/
                                                                           85



   strcpy (filename, argv[1]);
   strcpy (cusp_outfile, argv[2]);
   strcpy (error_log, "error.log");
   btime_yr = atoi(argv[3]);
   btime_day = atoi(argv[4]);
   etime_yr = atoi(argv[5]);
   etime_day = atoi(argv[6]);
   btime_sec = 0;
   etime_sec = 24*3600;

   init_scf ();

   /**********************************************************/
   /* Open cusp crossing file.                               */
   /**********************************************************/

   outfile=fopen(cusp_outfile,"w");

   fprintf(outfile," cglat in |     mlt in |    UT in        |cglat out|
mlt out |     Ut out\n");

   printf(" cglat in |   mlt in |       UT in       |cglat out| mlt out |
Ut out\n");

   /**********************************************************/
   /* Open the SCF file and all input data sets.             */
   /**********************************************************/

   scf_version_number (&scf_vnum);
   ret_val = scf_open (filename, scf_vnum, btime_yr, btime_day,
btime_sec, 0L,
                       etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("error 1 %s\n", error_str);
      exit (-1);
    }

   /**************************************************************/
   /* Position the input data sets at the requested start time. */
   /**************************************************************/

   ret_val = scf_position (filename, scf_vnum, btime_yr, btime_day,
btime_sec,
                            0L, etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("error 2 %s\n", error_str);
      exit (-1);
    }


/**********************************************************************
**/
                                                                        86


     /*   Create one instance of the data structure.
*/

/**********************************************************************
**/

   ret_val = create_scf_data_structure (filename, scf_vnum,
&scf_data_ptr);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("error 3 %s\n", error_str);
      exit (-1);
    }
   SCF_DATA = (struct scf_data *) scf_data_ptr;


/**********************************************************************
**/
    /* Find the input source with the fastest sample rate.
*/

/**********************************************************************
**/

   time_frac = 0.0;
   ret_val = scf_sample_rate (filename, scf_vnum, SCF_DELTA_T,
time_frac,
                              SCF_MEASURE_LAT_TM);
/*
   time_frac = 1.0;
   ret_val = scf_sample_rate (filename, scf_vnum, USE_INPUT_VAR,
time_frac,
                              SCF_MEASURE_LAT_TM);
*/
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("error 4%s\n", error_str);
      exit (-1);
    }

     /**************************************************************/
     /* Determine the number of output variables being returned. */
     /**************************************************************/

     ret_val = read_scf (filename, scf_vnum, S_NUM_OUTPUT, NOT_USED,
                         (char*) &num_output);
     if (ret_val != ALL_OKAY)
      {
        scf_error_str (ret_val, error_str);
        printf ("error 5 %s\n", error_str);
        exit (-1);
      }

     intptr = (int *) calloc ((unsigned) num_output, sizeof (int));
     if (intptr == 0)
                                                                        87


    {
        printf ( "calloc returned an error.\n");
        exit (-1);
    }

   /**************************************************************/
   /* Retrieve the "dimensionality" of the output variables.     */
   /**************************************************************/

   for (dimen = intptr, i = 0; i < num_output; ++i, ++dimen)
    {
      ret_val = read_scf (filename, scf_vnum, S_OUTPUT_DIMENSION, i,
                          (char *) dimen);
      if (ret_val != ALL_OKAY)
       {
         scf_error_str (ret_val, error_str);
         printf ("error 6 %s\n", error_str);
         exit (-1);
       }
    }
   dimen = intptr;


/**********************************************************************
**/
    /* Evaluate the algorithm, retrieving the output until the
requested   */
    /* end time has been reached.
*/

/**********************************************************************
**/

   prevhit = 0;

   while (more_data)
    {
      ret_val = scf_output_data (filename, scf_vnum, scf_data_ptr);
      if (ret_val != ALL_OKAY)
       {
         scf_error_str (ret_val, error_str);
         printf ("error 7 %s\n", error_str);
         hr = SCF_DATA->bmilli/3600000;
         min = (SCF_DATA->bmilli - hr*3600000)/60000;
         sec = (SCF_DATA->bmilli - hr*3600000 - min*60000)/1000;
         printf ("%2d:%2d:%2d ", hr,min,sec);
         errlog=fopen(error_log,"a");
         fprintf(errlog,"%s\n%s %4d/%3d
%2d:%2d:%2d\n",error_str,cusp_outfile,SCF_DATA->byear,SCF_DATA-
>bday,hr,min,sec);
         fclose(errlog);
         exit (-1);
       }

        ret_time_sec = (SCF_DATA->bmilli + (SCF_DATA->bnano / 1000000)) /
1000;
                                                                         88


      ret_time_nano = (SCF_DATA->bmilli % 1000) * 1000000 + SCF_DATA-
>bnano;


/*********************************************************************/
      /* End time has been reached?
*/

/*********************************************************************/

      if (SCF_DATA->byear > etime_yr ||
         (SCF_DATA->byear == etime_yr && SCF_DATA->bday > etime_day) ||
         (SCF_DATA->byear == etime_yr && SCF_DATA->bday == etime_day &&
          ret_time_sec > etime_sec))
       {
         more_data = 0;
         break;
       }


/*********************************************************************/
      /* Print the output variables returned.
*/

/*********************************************************************/

/*
      for (i = 0; i < SCF_DATA->num_output; ++i)
       [
         dptr = SCF_DATA->output_data + *(SCF_DATA->output_index + i);
         stop_loop = dptr + *(SCF_DATA->output_length + i);
              printf ("%ld \n", *(SCF_DATA->output_length + i));
*/
         hitptr = SCF_DATA->output_data + *(SCF_DATA->output_index);
         latptr = SCF_DATA->output_data + *(SCF_DATA->output_index +
1);
         mltptr = SCF_DATA->output_data + *(SCF_DATA->output_index +
2);


/*******************************************************************/
         /* Scalar output variable.
*/

/*******************************************************************/


         if ((*hitptr != 0&& prevhit == 0)||(*hitptr == 0&& prevhit !=
0))
            {


                printf   ("%10.6f ", *latptr);
                printf   ("%9.6f ", *mltptr);
                printf   ("%4d ", SCF_DATA->byear);
                printf   ("%3d ", SCF_DATA->bday);
                printf   ("%8d ", SCF_DATA->bmilli);
                                                                         89


                 if (*hitptr == 0 && prevhit != 0) printf ("\n");

                 fprintf (outfile,"%10.6f ", *latptr);
                 fprintf (outfile,"%9.6f ", *mltptr);
                 fprintf (outfile,"%4d ", SCF_DATA->byear);
                 fprintf (outfile,"%3d ", SCF_DATA->bday);
                 fprintf (outfile,"%8d ", SCF_DATA->bmilli);
                 if (*hitptr == 0 && prevhit != 0) fprintf (outfile,"\n");
             }

         prevhit = *hitptr;

     }

    free_scf_info ();
    fclose(outfile);
    exit(0);
}
                                                                      90


/*********************** SCF generated by SCF Editor
*********************/
                                        /* title
*/
/***************************** Contact Section
***************************/
0                                       /* number of contact lines
*/
/**************************** Comments Section
***************************/
3                                       /* number of comment lines
*/
This SCF calculates the delay-time of IMP-8 IMF to low altitude in
seconds at a given time, assuming values for Solar Wind Speed, MP
standoff distance, and travel time to low altitude.
/***************************** Input Variables
***************************/
6                                       /* number of input variables
*/
/*---------------------------- Input Variable -------------------------
--*/
XGSM                                    /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMOA      /* IDFS Source
*/
SENSOR 2                                /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
YGSM                                    /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMOA      /* IDFS Source
*/
SENSOR 6                                /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
ZGSM                                    /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMOA      /* IDFS Source
*/
SENSOR 7                                /* data type
*/
0                                       /* number of tables for unit
*/
                                                                      91


VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
BXGSM                                   /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMAG      /* IDFS Source
*/
SENSOR 17                               /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
BYGSM                                   /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMAG      /* IDFS Source
*/
SENSOR 18                               /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
BZGSM                                   /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMAG      /* IDFS Source
*/
SENSOR 19                               /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/***************************** Temp Variables
****************************/
23                                      /* number of temp variables
*/
/*----------------------------- Temp Variable -------------------------
--*/
ZERO                                    /* variable name
*/
0                                       /* rank and length of dimension
*/
                                                                        92


/*-----------------------------   Temp Variable -------------------------
--*/
YZCORRECT                                /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
LDISTANCE                                /* variable name
*/
0                                         /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
STANDOFF                                 /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
SWSPEED                                  /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
TRAVELTIME                               /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
THETA                                    /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
SINTHETA                                 /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
COSTHETA                                  /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FRACTION                                  /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
                                                                        93


TV1                                      /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
TV2                                      /* variable name
*/
0                                         /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT0                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
FMT1                                     /* variable name
*/
1 8                                      /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
TV3                                      /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
TV4                                      /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
BYSQ                                     /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
BZSQ                                      /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
ROOTB                                     /* variable name
*/
0                                        /* rank and length of dimension
*/
/*-----------------------------   Temp Variable -------------------------
--*/
SUMSQ                                    /* variable name
*/
                                                                      94


0                                       /* rank and length of dimension
*/
/*----------------------------- Temp Variable -------------------------
--*/
TV5                                     /* variable name
*/
0                                       /* rank and length of dimension
*/
/*----------------------------- Temp Variable -------------------------
--*/
TV6                                     /* variable name
*/
0                                       /* rank and length of dimension
*/
/*----------------------------- Temp Variable -------------------------
--*/
TCLOCK                                  /* variable name
*/
1 3                                     /* rank and length of dimension
*/
/**************************** Output Variables
***************************/
1                                       /* number of output variables
*/
/*---------------------------- Output Variable ------------------------
--*/
DELAYTIME                               /* output variable name
*/
0                                       /* rank and length of dimension
*/
/**************************** Algorithm
**********************************/
/*     set constant values
*/
/**********************************************************************
***/
TRAVELTIME = 600
SWSPEED = 400
STANDOFF = 63700
/**********************************************************************
***/
/*     do trig calculations
*/
/**********************************************************************
***/
FRACTION = BZGSM/BYGSM
THETA = ATAN (FRACTION)
SINTHETA = SIN (THETA)
COSTHETA = COS (THETA)
/**********************************************************************
***/
/*     evaluate delay-time equation
*/
/**********************************************************************
***/
TV1 = YGSM * COSTHETA
TV2 = ZGSM * SINTHETA
                                                                      95


YZCORRECT = TV1 + TV2
BYSQ = BYGSM*BYGSM
BZSQ = BZGSM*BZGSM
SUMSQ = BYSQ + BZSQ
ROOTB = SQRT(SUMSQ)
TV3 = BXGSM/ROOTB
TV4 = TV3*YZCORRECT
LDISTANCE = XGSM - TV4
TV5 = STANDOFF - LDISTANCE
TV6 = TV5/SWSPEED
DELAYTIME = TV6 - TRAVELTIME
/**********************************************************************
***/
/*     print output
*/
/**********************************************************************
***/
   FMT0 = "\n"
   FMT1 = " %08.3f"
/* PRINT (FMT0, ZERO) */
/* PRINT (FMT1, DELAYTIME) */
/* PRINT (FMT1, SMILLI) */
                                                                    96


/***********************************************************/
/* Adapted from Rudy's wmain.c 2/14/01 by Wayne Keith      */
/* to run delay_time.SCF to delay IMP-8 data based on      */
/* output from cusp crossing searches using wmain.c        */
/* and associated SCFs.                                    */
/*                                                         */
/* Known issues: needs ability to promote data and to      */
/* keep going if it encounters a time with no IMP-8 data */
/***********************************************************/

#ident "@(#) %M% %I% %D% SwRI"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "SCF.h"
#include "SCF_defs.h"
#include "SCF_file_defs.h"
#include "libbase_SCF.h"
#include "ScfSourceList.h"
/* include "SCF_var.h" */

void main(int argc, char **argv)
{
   long btime_sec, etime_sec, ret_time_sec, ret_time_nano;
   unsigned short scf_vnum;
   int ret_val, btime_yr, btime_day, etime_yr, etime_day;
   short hr, min, sec;
   char filename[80], error_str[150], more_data = 1;
   register int i;
   int num_output, *intptr, *dimen;
   float *dptr;
   double time_frac;

   struct scf_data *SCF_DATA;
   void *scf_data_ptr;

   char cusp_infile[80];
   FILE *infile;
   char delay_outfile[80];
   FILE *outfile;
   char error_log[80];
   FILE *errlog;
   float accum, avgval;
   int nmpts;
   float bcglat, ecglat, bmlt, emlt;
   long btime_ms, etime_ms;
   char str[128];

SDDAS_ULONG *keys_needed;
SDDAS_LONG num_sources;
SDDAS_CHAR *pa_defined;

   if (argc != 4)
    {
       printf ("Calling sequence is SCF filename, input filename,
output filename.\n");
                                                                        97


          exit (-1);
      }

     /**********************************************************/
     /* Set the time for processing.                           */
     /**********************************************************/
/*
     btime_yr = 1999;
     btime_day = 13;
     hr=20;
     min=12;
     sec=30;
     btime_sec = hr*3600 + min*60 + sec;

     etime_yr = 1999;
     etime_day = 13;
     hr=20;
     min=14;
     sec=30;
     etime_sec = hr*3600 + min*60 + sec;
*/

     strcpy     (filename, argv[1]);
     strcpy     (cusp_infile, argv[2]);
     strcpy     (delay_outfile, argv[3]);
     strcpy     (error_log, "error.log");

     /**********************************************************/
     /* Open cusp crossing files.                              */
     /**********************************************************/

     infile=fopen(cusp_infile,"r");
     outfile=fopen(delay_outfile,"w");

     /**********************************************************/
     /* Set up labels for output file                          */
     /**********************************************************/

      fprintf(outfile,"cglat in |           mlt in |   UT in   |cglat
out| mlt out |     Ut out\n");

     /**********************************************************/
     /* Read in each line and set begin and ending times       */
     /**********************************************************/

      fgets(str,100,infile); /* skip over first line */

              while(fgets(str,100,infile) != NULL)
          {

       sscanf(str,"%f %f %d %d %d %f %f %d %d
%d",&bcglat,&bmlt,&btime_yr,&btime_day,
&btime_ms,&ecglat,&emlt,&etime_yr,&etime_day,&etime_ms);

          btime_sec = (long)btime_ms/1000;
          etime_sec = (long)etime_ms/1000;
          nmpts = 0;
                                                                       98


       accum = 0;

   /**********************************************************/
   /* Reinitialize SCF items for each time interval          */
   /**********************************************************/

   more_data = 1;
   init_scf ();

   /**********************************************************/
   /* Open the SCF file and all input data sets.             */
   /**********************************************************/

   scf_version_number (&scf_vnum);
   ret_val = scf_open (filename, scf_vnum, btime_yr, btime_day,
btime_sec, 0L,
                       etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("3 %s\n", error_str);
      goto next;
    }

   /**************************************************************/
   /* Position the input data sets at the requested start time. */
   /**************************************************************/

   ret_val = scf_position (filename, scf_vnum, btime_yr, btime_day,
btime_sec,
                            0L, etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("5 %s\n", error_str);
      goto next;
    }


/**********************************************************************
**/
    /* Create one instance of the data structure.
*/

/**********************************************************************
**/

   ret_val = create_scf_data_structure (filename, scf_vnum,
&scf_data_ptr);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("6 %s\n", error_str);
      goto next;
    }
   SCF_DATA = (struct scf_data *) scf_data_ptr;
                                                                       99



/**********************************************************************
**/
    /* Find the input source with the fastest sample rate.
*/

/**********************************************************************
**/

   time_frac = 0.0;
   ret_val = scf_sample_rate (filename, scf_vnum, SCF_DELTA_T,
time_frac,
                              SCF_MEASURE_LAT_TM);
/*
   time_frac = 1.0;
   ret_val = scf_sample_rate (filename, scf_vnum, USE_INPUT_VAR,
time_frac,
                              SCF_MEASURE_LAT_TM);
*/
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("7 %s\n", error_str);
      goto next;
    }

   /**************************************************************/
   /* Determine the number of output variables being returned. */
   /**************************************************************/

   ret_val = read_scf (filename, scf_vnum, S_NUM_OUTPUT, NOT_USED,
                       (char*) &num_output);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }

   intptr = (int *) calloc ((unsigned) num_output, sizeof (int));
   if (intptr == 0)
    {
      printf ( "9 calloc returned an error.\n");
      goto next;
    }

   /**************************************************************/
   /* Retrieve the "dimensionality" of the output variables.     */
   /**************************************************************/

   for (dimen = intptr, i = 0; i < num_output; ++i, ++dimen)
    {
      ret_val = read_scf (filename, scf_vnum, S_OUTPUT_DIMENSION, i,
                          (char *) dimen);
      if (ret_val != ALL_OKAY)
       {
         scf_error_str (ret_val, error_str);
                                                                        100


          printf ("10 %s\n", error_str);
          goto next;
       }
    }
   dimen = intptr;


/**********************************************************************
**/
    /* Evaluate the algorithm, retrieving the output until the
requested   */
    /* end time has been reached.
*/

/**********************************************************************
**/
    while (more_data)
     {
       ret_val = scf_output_data (filename, scf_vnum, scf_data_ptr);
       if (ret_val != ALL_OKAY)
        {
          scf_error_str (ret_val, error_str);
          printf ("11 %s\n", error_str);
          hr = SCF_DATA->bmilli/3600000;
          min = (SCF_DATA->bmilli - hr*3600000)/60000;
          sec = (SCF_DATA->bmilli - hr*3600000 - min*60000)/1000;
          printf ("%2d:%2d:%2d ", hr,min,sec);
          errlog=fopen(error_log,"a");
          fprintf(errlog,"%s\n%s %4d/%3d
%2d:%2d:%2d\n",error_str,delay_outfile,SCF_DATA->byear,SCF_DATA-
>bday,hr,min,sec);
          fclose(errlog);
          goto next;
        }

        ret_time_sec = (SCF_DATA->bmilli + (SCF_DATA->bnano / 1000000)) /
1000;
      ret_time_nano = (SCF_DATA->bmilli % 1000) * 1000000 + SCF_DATA-
>bnano;


/*********************************************************************/
      /* End time has been reached?
*/

/*********************************************************************/

        if (SCF_DATA->byear > etime_yr ||
           (SCF_DATA->byear == etime_yr && SCF_DATA->bday > etime_day) ||
           (SCF_DATA->byear == etime_yr && SCF_DATA->bday == etime_day &&
            ret_time_sec > etime_sec))
         {
           more_data = 0;
           break;
         }
                                                                       101



/*********************************************************************/
      /* Print the output variables returned.
*/

/*********************************************************************/

           dptr = SCF_DATA->output_data + *(SCF_DATA->output_index);

           if ((*dptr > -3600)&&(*dptr < 3600))
              {
              accum = accum + *dptr;
              printf ("%.2e \n ", *dptr);
              nmpts++;
              }
/*
                 printf ("\n");
*/

      }

next: if (nmpts != 0) avgval = accum/(float)nmpts;
else avgval = 0.0;
printf ("\n");
 printf ("%d\n", nmpts);
printf ("%f\n", avgval);
 fprintf(outfile,"%f %f %d %d %d %f %f %d %d
%d",bcglat,bmlt,btime_yr,btime_day,btime_ms,ecglat,emlt,etime_yr,etime_
day,etime_ms);
fprintf (outfile," %8.3f\n", avgval);


/*********************************************************************/
      /* Close Files
*/

/*********************************************************************/

     free_scf_info ();
      }

          fclose(outfile);
          fclose(infile);

     exit (0);
}
                                                                     102


/*********************** SCF generated by SCF Editor
*********************/
                                        /* title
*/
/***************************** Contact Section
***************************/
0                                       /* number of contact lines
*/
/**************************** Comments Section
***************************/
0                                       /* number of comment lines
*/
/***************************** Input Variables
***************************/
2                                       /* number of input variables
*/
/*---------------------------- Input Variable -------------------------
--*/
BYIN                                    /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMAG      /* IDFS Source
*/
SENSOR 18                               /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/*---------------------------- Input Variable -------------------------
--*/
BZIN                                    /* input variable name
*/
IMP IMP-8 MAG_FIELD MAG_FIELD IMAG      /* IDFS Source
*/
SENSOR 19                               /* data type
*/
0                                       /* number of tables for unit
*/
VALID_MIN VALID_MAX                     /* lower and upper cutoff
values */
256        256                          /* dqual exclusion range
*/
/***************************** Temp Variables
****************************/
0                                       /* number of temp variables
*/
/**************************** Output Variables
***************************/
2                                       /* number of output variables
*/
/*---------------------------- Output Variable ------------------------
--*/
BYOUT                                   /* output variable name
*/
                                                                     103


0                                       /* rank and length of dimension
*/
/*---------------------------- Output Variable ------------------------
--*/
BZOUT                                   /* output variable name
*/
0                                       /* rank and length of dimension
*/
BYOUT = BYIN
BZOUT = BZIN
                                                                    104


/***********************************************************/
/* Adapted from dtmain.c 2/15/01 by Wayne Keith            */
/* to run get_imf.SCF to retrieve IMP-8 data to be         */
/* accumualated here and averaged to find an angle to      */
/* be added to the crossings.dat files for gif generation */
/*                                                         */
/* Known issues: needs ability to promote data and to      */
/* keep going if it encounters a time with no IMP-8 data */
/***********************************************************/

#ident "@(#) %M% %I% %D% SwRI"

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "SCF.h"
#include "SCF_defs.h"
#include "SCF_file_defs.h"
#include "libbase_SCF.h"
/* include "SCF_var.h" */

void main(int argc, char **argv)
{
   long btime_sec, etime_sec, ret_time_sec, ret_time_nano;
   unsigned short scf_vnum;
   int ret_val, btime_yr, btime_day, etime_yr, etime_day;
   short hr, min, sec;
   char filename[80], error_str[150], more_data = 1;
   register int i;
   int num_output, *intptr, *dimen;
   float *dyptr, *dzptr;
   double time_frac;

   struct scf_data *SCF_DATA;
   void *scf_data_ptr;

   char delay_infile[80];
   FILE *infile;
   char angle_outfile[80];
   FILE *outfile;
   char error_log[80];
   FILE *errlog;
   float accumz, avgvalz;
   float accumy, avgvaly;
   int nmpts, angle;
   float bcglat, ecglat, bmlt, emlt, delay_sec;
   long btime_ms, etime_ms;
   char str[128];

   if (argc != 4)
    {
       printf ("Calling sequence is SCF filename, input filename,
output filename.\n");
       exit (-1);
    }
                                                                        105


     /**********************************************************/
     /* Set the time for processing.                           */
     /**********************************************************/
/*
     btime_yr = 1999;
     btime_day = 13;
     hr=20;
     min=12;
     sec=30;
     btime_sec = hr*3600 + min*60 + sec;

     etime_yr = 1999;
     etime_day = 13;
     hr=20;
     min=14;
     sec=30;
     etime_sec = hr*3600 + min*60 + sec;
*/

     strcpy   (filename, argv[1]);
     strcpy   (delay_infile, argv[2]);
     strcpy   (angle_outfile, argv[3]);
     strcpy   (error_log, "error.log");

     /**********************************************************/
     /* Open cusp crossing files.                              */
     /**********************************************************/

     infile=fopen(delay_infile,"r");
     outfile=fopen(angle_outfile,"w");

     /**********************************************************/
     /* Set up labels for output file                          */
     /**********************************************************/

      fprintf(outfile,"cglat in | mlt in |      UT in          |cglat
out| mlt out |     Ut out      |delay |ang|\n");

     /**********************************************************/
     /* Read in each line and set begin and ending times       */
     /**********************************************************/

      fgets(str,100,infile); /* skip over first line */

      while(fgets(str,100,infile) != NULL)
         {

       sscanf(str,"%f %f %d %d %d %f %f %d %d %d
%f",&bcglat,&bmlt,&btime_yr,&btime_day,
&btime_ms,&ecglat,&emlt,&etime_yr,&etime_day,&etime_ms,&delay_sec);

         btime_sec = (long)btime_ms/1000;
         etime_sec = (long)etime_ms/1000;
         nmpts = 0;
         accumy = 0;
         accumz = 0;
                                                                       106


   /**********************************************************/
   /* Reinitialize SCF items for each time interval          */
   /**********************************************************/

   more_data = 1;
   init_scf ();

   /**********************************************************/
   /* Open the SCF file and all input data sets.             */
   /**********************************************************/

   scf_version_number (&scf_vnum);
   ret_val = scf_open (filename, scf_vnum, btime_yr, btime_day,
btime_sec, 0L,
                       etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }

   /**************************************************************/
   /* Position the input data sets at the requested start time. */
   /**************************************************************/

   ret_val = scf_position (filename, scf_vnum, btime_yr, btime_day,
btime_sec,
                            0L, etime_yr, etime_day, etime_sec, 0L);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }


/**********************************************************************
**/
    /* Create one instance of the data structure.
*/

/**********************************************************************
**/

   ret_val = create_scf_data_structure (filename, scf_vnum,
&scf_data_ptr);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }
   SCF_DATA = (struct scf_data *) scf_data_ptr;
                                                                       107



/**********************************************************************
**/
    /* Find the input source with the fastest sample rate.
*/

/**********************************************************************
**/

   time_frac = 0.0;
   ret_val = scf_sample_rate (filename, scf_vnum, SCF_DELTA_T,
time_frac,
                              SCF_MEASURE_LAT_TM);
/*
   time_frac = 1.0;
   ret_val = scf_sample_rate (filename, scf_vnum, USE_INPUT_VAR,
time_frac,
                              SCF_MEASURE_LAT_TM);
*/
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }

   /**************************************************************/
   /* Determine the number of output variables being returned. */
   /**************************************************************/

   ret_val = read_scf (filename, scf_vnum, S_NUM_OUTPUT, NOT_USED,
                       (char*) &num_output);
   if (ret_val != ALL_OKAY)
    {
      scf_error_str (ret_val, error_str);
      printf ("%s\n", error_str);
      goto next;
    }

   intptr = (int *) calloc ((unsigned) num_output, sizeof (int));
   if (intptr == 0)
    {
      printf ( "calloc returned an error.\n");
      goto next;
    }

   /**************************************************************/
   /* Retrieve the "dimensionality" of the output variables.     */
   /**************************************************************/

   for (dimen = intptr, i = 0; i < num_output; ++i, ++dimen)
    {
      ret_val = read_scf (filename, scf_vnum, S_OUTPUT_DIMENSION, i,
                          (char *) dimen);
      if (ret_val != ALL_OKAY)
       {
         scf_error_str (ret_val, error_str);
                                                                        108


          printf ("%s\n", error_str);
          goto next;
       }
    }
   dimen = intptr;


/**********************************************************************
**/
    /* Evaluate the algorithm, retrieving the output until the
requested   */
    /* end time has been reached.
*/

/**********************************************************************
**/

   while (more_data)
    {
      ret_val = scf_output_data (filename, scf_vnum, scf_data_ptr);
      if (ret_val != ALL_OKAY)
       {
         scf_error_str (ret_val, error_str);
         printf ("%s\n", error_str);
         hr = SCF_DATA->bmilli/3600000;
         min = (SCF_DATA->bmilli - hr*3600000)/60000;
         sec = (SCF_DATA->bmilli - hr*3600000 - min*60000)/1000;
         printf ("%2d:%2d:%2d ", hr,min,sec);
         errlog=fopen(error_log,"a");
         fprintf(errlog,"%s\n%s %4d/%3d
%2d:%2d:%2d\n",error_str,angle_outfile,SCF_DATA->byear,SCF_DATA-
>bday,hr,min,sec);
         fclose(errlog);
         goto next;
       }

        ret_time_sec = (SCF_DATA->bmilli + (SCF_DATA->bnano / 1000000)) /
1000;
      ret_time_nano = (SCF_DATA->bmilli % 1000) * 1000000 + SCF_DATA-
>bnano;


/*********************************************************************/
      /* End time has been reached?
*/

/*********************************************************************/

        if (SCF_DATA->byear > etime_yr ||
           (SCF_DATA->byear == etime_yr && SCF_DATA->bday > etime_day) ||
           (SCF_DATA->byear == etime_yr && SCF_DATA->bday == etime_day &&
            ret_time_sec > etime_sec))
         {
           more_data = 0;
           break;
         }
                                                                     109



/*********************************************************************/
      /* Print the output variables returned.
*/

/*********************************************************************/

         dyptr = SCF_DATA->output_data + *(SCF_DATA->output_index);
         dzptr = SCF_DATA->output_data + *(SCF_DATA->output_index +1);

         if ((*dyptr > -600)&&(*dyptr < 600))
            {
            accumy = accumy + *dyptr;
            accumz = accumz + *dzptr;
/*
             printf ("%.2e   \n ", accumy);
*/
             nmpts++;
             }
/*
               printf ("\n");
*/

     }


/*********************************************************************/
      /* Find the average of the field veriables
*/

/*********************************************************************/
next: if (nmpts != 0)
   {
   avgvaly = accumy/(float)nmpts;
   avgvalz = accumz/(float)nmpts;
   }
else
   {
   avgvaly = 0.0;
   avgvalz = 0.0;
   }

printf ("\n");
/* printf ("%d\n", nmpts); */
printf ("y average %f\n", avgvaly);
printf ("z average %f\n", avgvalz);


/*********************************************************************/
      /* Select the proper angle sector (1-8) for the pass
*/

/*********************************************************************/

angle = 0;

if (avgvaly >= 0.0 && avgvalz >= 0.0)
                                                                     110


   {
   if (avgvaly >= avgvalz)
      {
      angle = 1;
      }
   else {angle = 2;}
   }

if (avgvaly <= 0.0 && avgvalz >= 0.0)
   {
   if (avgvaly + avgvalz > 0.0)
      {
      angle = 3;
      }
   else {angle = 4;}
   }

if (avgvaly <= 0.0 && avgvalz <= 0.0)
   {
   if (avgvaly <= avgvalz)
      {
      angle = 5;
      }
   else {angle = 6;}
   }

if (avgvaly >= 0.0 && avgvalz <= 0.0)
   {
   if (avgvaly + avgvalz < 0.0)
      {
      angle = 7;
      }
   else {angle = 8;}
   }

if (avgvaly == 0.0 && avgvalz == 0.0)
   {
   angle = 0;
   }


/*********************************************************************/
      /* Write the output to a new file, along with all the other info
*/

/*********************************************************************/

 fprintf(outfile,"%f %f %d %d %d %f %f %d %d %d
%8.3f",bcglat,bmlt,btime_yr,btime_day,btime_ms,ecglat,emlt,etime_yr,eti
me_day,etime_ms,delay_sec);
fprintf (outfile," %d\n", angle);
printf ("angle %d\n", angle);
                                                                     111



/*********************************************************************/
      /* Close Files
*/

/*********************************************************************/

    free_scf_info ();
     }

         fclose(outfile);
         fclose(infile);

    exit (0);
}

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:21
posted:11/23/2011
language:English
pages:111