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

CHIMESpectrum Class Reference

Calculate the cosmic ray proton spectrum in low earth orbit. Uses data produced by CHIME, assuming 600 km circular orbit at solar minimum (worst case). More...

#include <CHIMESpectrum.h>

Inheritance diagram for CHIMESpectrum:

Spectrum CHIMEAvg CHIMEMax CHIMEMin List of all members.

Public Types

typedef std::pair<int,float> Intrp

Public Methods

 CHIMESpectrum (const std::string& params)
virtual double calculate_rate (double old_rate)
virtual double flux () const
 calculate flux for the current cutoff. More...

virtual double solidAngle () const
 calcualte effective solid angle for the given energy. More...

float flux (float cut) const
 Total flux in protons / m^2 sec ster Interpolate in table if possible, otherwise assume power law tail at high energy. More...

virtual float flux (float lat, float lon) const
 Flux as a function of latitude and longitude in a 600 km orbit. Linear interpolate in a table with a 5 degree sampling grid. More...

virtual float flux (std::pair<double, double> coords) const
virtual float operator() (float) const
float cutoff () const
virtual void setPosition (double lat, double lon)
virtual void setPosition (std::pair<double,double> coords)
int askGPS ()
 this one asks the GPS for position. More...

float findCutoff (float rflux) const
 determine the cutoff value which will produce the desired flux. More...

float findCutoff (float lat, float lon) const
 determine the cutoff value at a geographical location. More...

float findCutoff (std::pair<double,double> coords) const
virtual std::pair<float,float> dir (float energy) const
 return solid angle pair (costh, phi) for the given energy. More...

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

virtual const char* particleName () const
 subclasses need to specify correct particle type. More...

const char* nameOf () const
void setParticleName (std::string name)
 set the particle name. (default is "p"). More...


Protected Methods

void init (std::string params)

Private Methods

float rad2 () const
float exposure (float E) const
float cosomega (float E) const

Private Attributes

InterpVec m_en
InterpVec m_fl
InterpVec m_fluxes
float m_expo
double m_normfact
float m_tot
float m_upper
float m_etop
float m_cutoff
float m_coscutoff
float m_fluxTbl [73][13]
float m_flux
std::string m_particle_name
ObserverAdapter< CHIMESpectrum > m_observer

Static Private Attributes

const float m_rearth = 6371.f
const float m_altitude = 600.f

Detailed Description

Calculate the cosmic ray proton spectrum in low earth orbit. Uses data produced by CHIME, assuming 600 km circular orbit at solar minimum (worst case).

Interface: The constructor arguments specify the satellite position (latitude, longitude) in degrees. The position can be changed by use of the setPosition() member. The total flux in protons/(m^2 sec ster) is returned by the flux() member. There are 3 ways to call flux(): With no arguments it uses the current cutoff energy. If there is one argument, it is assumed to be a cutoff. Two arguments are assumed to be latitude and longitude, and the corresponding cutoff is looked up. The stored current value is not changed. Cutoff energies are returned by FindCutoff(). With no arguments, it returns the stored current value. Two arguments are assumed to be latitude and longitude, and the corresponding cutoff is looked up. The operator() function returns a sampled energy value. The argument must be a float value between 0 and 1. The dir() member returns a sampled particle's energy and direction. The argument is a value between 0 and 1, which is used to produce the energy, as in operator(). The direction is based on simple Stormer cone theory. The first component of the direction is the zenith direction cosine: +1 for particles moving downward. The second component of the direction is the earth azimuth angle: 0 from the east, +pi/2 from the north, -pi/2 from the south. At energies near the cutoff, particles come mainly from the west.

Definition at line 47 of file CHIMESpectrum.h.


Member Typedef Documentation

typedef std::pair<int,float> CHIMESpectrum::Intrp
 

Definition at line 101 of file CHIMESpectrum.h.

Referenced by CHIMESpectrum::InterpVec::search().


Constructor & Destructor Documentation

CHIMESpectrum::CHIMESpectrum ( const std::string & params )
 

Definition at line 120 of file CHIMESpectrum.cxx.


Member Function Documentation

int CHIMESpectrum::askGPS ( )
 

this one asks the GPS for position.

Definition at line 196 of file CHIMESpectrum.cxx.

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

Definition at line 257 of file CHIMESpectrum.cxx.

float CHIMESpectrum::cosomega ( float E ) const [private]
 

Definition at line 277 of file CHIMESpectrum.cxx.

Referenced by exposure().

float CHIMESpectrum::cutoff ( ) const [inline]
 

Definition at line 74 of file CHIMESpectrum.h.

std::pair< float,float > CHIMESpectrum::dir ( float energy ) const [virtual]
 

return solid angle pair (costh, phi) for the given energy.

Reimplemented from Spectrum.

Definition at line 307 of file CHIMESpectrum.cxx.

float CHIMESpectrum::exposure ( float E ) const [private]
 

Definition at line 300 of file CHIMESpectrum.cxx.

Referenced by setPosition().

float CHIMESpectrum::findCutoff ( std::pair< double,double > coords ) const
 

Definition at line 250 of file CHIMESpectrum.cxx.

float CHIMESpectrum::findCutoff ( float lat,
float lon ) const
 

determine the cutoff value at a geographical location.

Definition at line 243 of file CHIMESpectrum.cxx.

float CHIMESpectrum::findCutoff ( float rflux ) const
 

determine the cutoff value which will produce the desired flux.

Definition at line 236 of file CHIMESpectrum.cxx.

Referenced by GalElSpectrum::findCutoff(), findCutoff(), and setPosition().

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

Definition at line 179 of file CHIMESpectrum.cxx.

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

Flux as a function of latitude and longitude in a 600 km orbit. Linear interpolate in a table with a 5 degree sampling grid.

Definition at line 164 of file CHIMESpectrum.cxx.

float CHIMESpectrum::flux ( float cut ) const
 

Total flux in protons / m^2 sec ster Interpolate in table if possible, otherwise assume power law tail at high energy.

Definition at line 139 of file CHIMESpectrum.cxx.

double CHIMESpectrum::flux ( ) const [virtual]
 

calculate flux for the current cutoff.

Reimplemented from Spectrum.

Definition at line 149 of file CHIMESpectrum.cxx.

Referenced by calculate_rate(), findCutoff(), flux(), and setPosition().

void CHIMESpectrum::init ( std::string paramstring ) [protected]
 

Definition at line 64 of file CHIMESpectrum.cxx.

Referenced by CHIMESpectrum().

const char * CHIMESpectrum::nameOf ( ) const [inline]
 

Definition at line 94 of file CHIMESpectrum.h.

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

Reimplemented from Spectrum.

Definition at line 186 of file CHIMESpectrum.cxx.

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

subclasses need to specify correct particle type.

Reimplemented from Spectrum.

Definition at line 129 of file CHIMESpectrum.cxx.

float CHIMESpectrum::rad2 ( ) const [private]
 

Definition at line 264 of file CHIMESpectrum.cxx.

Referenced by cosomega().

void CHIMESpectrum::setParticleName ( std::string name )
 

set the particle name. (default is "p").

Definition at line 132 of file CHIMESpectrum.cxx.

void CHIMESpectrum::setPosition ( std::pair< double,double > coords ) [virtual]
 

Definition at line 230 of file CHIMESpectrum.cxx.

void CHIMESpectrum::setPosition ( double lat,
double lon ) [virtual]
 

Definition at line 202 of file CHIMESpectrum.cxx.

Referenced by askGPS(), init(), GalElSpectrum::setPosition(), and setPosition().

double CHIMESpectrum::solidAngle ( ) const [virtual]
 

calcualte effective solid angle for the given energy.

Reimplemented from Spectrum.

Definition at line 156 of file CHIMESpectrum.cxx.

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

return a title describing the spectrum.

Reimplemented from Spectrum.

Definition at line 125 of file CHIMESpectrum.cxx.


Member Data Documentation

const float CHIMESpectrum::m_altitude = 600.f [static, private]
 

Definition at line 61 of file CHIMESpectrum.cxx.

float CHIMESpectrum::m_coscutoff [private]
 

Definition at line 125 of file CHIMESpectrum.h.

float CHIMESpectrum::m_cutoff [private]
 

Definition at line 124 of file CHIMESpectrum.h.

InterpVec CHIMESpectrum::m_en [private]
 

Definition at line 116 of file CHIMESpectrum.h.

float CHIMESpectrum::m_etop [private]
 

Definition at line 123 of file CHIMESpectrum.h.

float CHIMESpectrum::m_expo [private]
 

Definition at line 119 of file CHIMESpectrum.h.

InterpVec CHIMESpectrum::m_fl [private]
 

Definition at line 117 of file CHIMESpectrum.h.

float CHIMESpectrum::m_flux [private]
 

Definition at line 127 of file CHIMESpectrum.h.

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

Definition at line 126 of file CHIMESpectrum.h.

InterpVec CHIMESpectrum::m_fluxes [private]
 

Definition at line 118 of file CHIMESpectrum.h.

double CHIMESpectrum::m_normfact [private]
 

Definition at line 120 of file CHIMESpectrum.h.

ObserverAdapter< CHIMESpectrum > CHIMESpectrum::m_observer [private]
 

Definition at line 136 of file CHIMESpectrum.h.

std::string CHIMESpectrum::m_particle_name [private]
 

Definition at line 135 of file CHIMESpectrum.h.

const float CHIMESpectrum::m_rearth = 6371.f [static, private]
 

Definition at line 60 of file CHIMESpectrum.cxx.

float CHIMESpectrum::m_tot [private]
 

Definition at line 121 of file CHIMESpectrum.h.

float CHIMESpectrum::m_upper [private]
 

Definition at line 122 of file CHIMESpectrum.h.


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