Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TrappedProtonSpectrum Class Reference

Purpose: Simulate the flux and spectrum of protons trapped in the earth's magnetic field. Implemented only for a 600 km circular orbit, so only the South Atlantic Anomaly (SAA) is seen. More...

#include <TrappedProtonSpectrum.h>

Inheritance diagram for TrappedProtonSpectrum:

Spectrum List of all members.

Public Methods

 TrappedProtonSpectrum (float lat=0., float lon=0.)
 TrappedProtonSpectrum ( const std::vector<float>& params)
virtual double calculate_rate (double old_rate)
virtual double flux () const
 calculate the flux, particles/m^2/sr. (default zero). More...

virtual float flux (float lat, float lon) const
virtual float flux (std::pair<double, double> coords) const
virtual float operator() (float) const
virtual const char* particleName () const
 subclasses need to specify correct particle type. More...

virtual std::string title () const
 return a title describing the spectrum. More...

void setPosition ( float lat, float lon )

Private Methods

void init (float lat, float lon)

Private Attributes

float m_fluxTbl [73][13]
 table of total flux vs. latitude and longitude. More...


Detailed Description

Purpose: Simulate the flux and spectrum of protons trapped in the earth's magnetic field. Implemented only for a 600 km circular orbit, so only the South Atlantic Anomaly (SAA) is seen.

Interface: In the constructor, latitude and longitude can be specified, either as two floats or by a pair. Coordinates are in degrees After a TrappedProtonSpectrum is constructed, the position can be modified by using the setPosition() member, passing it latitude and longitude either as two floats or as a pair. The pair form is especially useful in combination with an Orbit object. Flux in protons / (m^2 sec ster) is returned by the flux() member. Alternately, flux at a given position can be obtained by specifying the coordinates. The values are obtained by interpolating on a 5-degree grid, so finer detail should not be expected. Random samples from the energy spectrum (in GeV) can be obtained by using the () operator, supplying a random argument between 0 and 1. This behavior is found in all classes which inherit from Spectrum.

Expected usage: To obtain flux as a function of position, use flux(lat, lon) or flux(pair). To obtain spectrum samples, use (). The setPosition members and flux() (with no arguments) are probably of little utility. Patrick Nolan, Stanford University, 1998

Definition at line 40 of file TrappedProtonSpectrum.h.


Constructor & Destructor Documentation

TrappedProtonSpectrum::TrappedProtonSpectrum ( float lat = 0.,
float lon = 0. )
 

Definition at line 17 of file TrappedProtonSpectrum.cxx.

TrappedProtonSpectrum::TrappedProtonSpectrum ( const std::vector< float >& params )
 

Definition at line 21 of file TrappedProtonSpectrum.cxx.


Member Function Documentation

double TrappedProtonSpectrum::calculate_rate ( double old_rate ) [virtual]
 

Definition at line 65 of file TrappedProtonSpectrum.cxx.

float TrappedProtonSpectrum::flux ( std::pair< double,double > coords ) const [virtual]
 

Definition at line 51 of file TrappedProtonSpectrum.cxx.

float TrappedProtonSpectrum::flux ( float lat,
float lon ) const [virtual]
 

Definition at line 35 of file TrappedProtonSpectrum.cxx.

double TrappedProtonSpectrum::flux ( ) const [virtual]
 

calculate the flux, particles/m^2/sr. (default zero).

Reimplemented from Spectrum.

Definition at line 28 of file TrappedProtonSpectrum.cxx.

Referenced by calculate_rate(), and flux().

void TrappedProtonSpectrum::init ( float lat,
float lon ) [private]
 

Definition at line 70 of file TrappedProtonSpectrum.cxx.

Referenced by TrappedProtonSpectrum().

float TrappedProtonSpectrum::operator() ( float x ) const [virtual]
 

Reimplemented from Spectrum.

Definition at line 58 of file TrappedProtonSpectrum.cxx.

const char * TrappedProtonSpectrum::particleName ( ) const [virtual]
 

subclasses need to specify correct particle type.

Reimplemented from Spectrum.

Definition at line 84 of file TrappedProtonSpectrum.cxx.

void TrappedProtonSpectrum::setPosition ( float lat,
float lon ) [inline]
 

Definition at line 56 of file TrappedProtonSpectrum.h.

Referenced by calculate_rate().

std::string TrappedProtonSpectrum::title ( ) const [virtual]
 

return a title describing the spectrum.

Reimplemented from Spectrum.

Definition at line 88 of file TrappedProtonSpectrum.cxx.


Member Data Documentation

float TrappedProtonSpectrum::m_fluxTbl[73][13] [private]
 

table of total flux vs. latitude and longitude.

Definition at line 62 of file TrappedProtonSpectrum.h.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 12:20:37 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000