RadauModIntegrationFile Class Reference

Modified Radau input files. More...

#include <orsa_file.h>

Inheritance diagram for RadauModIntegrationFile:

Inheritance graph
[legend]
Collaboration diagram for RadauModIntegrationFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RadauModIntegrationFile (OrbitStream &)
 Modified Radau input files.
void Read ()
void Open ()
void Close ()
virtual std::string GetFileName () const
virtual void SetFileName (std::string name_in)
virtual void SetFileName (char *name_in)

Protected Attributes

std::string filename
FILE_TYPE file
FILE_STATUS status

Detailed Description

Modified Radau input files.

Definition at line 168 of file orsa_file.h.


Constructor & Destructor Documentation

RadauModIntegrationFile OrbitStream  ) 
 

Modified Radau input files.

Definition at line 2288 of file orsa_file.cc.

02288                                                                     : ReadFile() {
02289     os = &osin;
02290   }


Member Function Documentation

void Close  )  [inherited]
 

Definition at line 114 of file orsa_file.cc.

References orsa::CLOSE, CLOSE_FILE, File::file, and File::status.

Referenced by SWIFTFile::AsteroidsInFile(), ReadWriteFile::Open(), OrsaFile::Read(), OrsaConfigFile::Read(), SWIFTFile::Read(), Config::read_from_file(), File::SetFileName(), OrsaFile::Write(), OrsaConfigFile::Write(), Config::write_to_file(), and File::~File().

00114                    {
00115     if (status != CLOSE) {
00116       CLOSE_FILE(file);
00117       status = CLOSE;
00118     }
00119   }

virtual std::string GetFileName  )  const [inline, virtual, inherited]
 

Definition at line 99 of file orsa_file.h.

References File::filename.

Referenced by LocationFile::ObsPos(), and OrsaFile::Read().

00099 { return filename; }

void Open  )  [inherited]
 

Definition at line 59 of file orsa_file.cc.

References orsa::CLOSE, OPEN_FILE, orsa::OPEN_R, OPEN_READ, and ORSA_ERROR.

Referenced by SWIFTFile::AsteroidsInFile(), Mercury5IntegrationFile::Read(), TLEFile::Read(), NEODYSCAT::Read(), JPLDastcomCometFile::Read(), JPLDastcomUnnumFile::Read(), JPLDastcomNumFile::Read(), AstDySMatrixFile::Read(), RadauModIntegrationFile::Read(), SWIFTFile::Read(), LocationFile::Read(), RWOFile::Read(), MPCObsFile::Read(), MPCCometFile::Read(), MPCOrbFile::Read(), and AstorbFile::Read().

00059                       {
00060     if (status != CLOSE) return;
00061     
00062     file = OPEN_FILE(filename.c_str(),OPEN_READ);
00063     
00064     if (file == 0) { 
00065       ORSA_ERROR("Can't open file %s",filename.c_str());
00066     } else {
00067       status = OPEN_R;
00068     }
00069   }

void Read  )  [virtual]
 

Implements ReadFile.

Definition at line 2292 of file orsa_file.cc.

References Orbit::a, orsa::AU, Orbit::e, OrbitWithEpoch::epoch, orsa::FromUnits(), GETS_FILE, Orbit::i, Orbit::M, orsa::M, Orbit::omega_node, Orbit::omega_pericenter, ReadFile::Open(), orsa::OPEN_R, ORSA_ERROR, orsa::pi, REWIND_FILE, OrbitStream::timestep, and orsa::YEAR.

02292                                      {
02293     
02294     // if (status == CLOSE) Open();
02295     
02296     Open();
02297     
02298     if (status != OPEN_R){ 
02299       ORSA_ERROR("problems encountered when opening file.");
02300       return;
02301     }
02302     
02303     os->clear();
02304     os->timestep = 0.0;
02305     OrbitWithEpoch fo;
02306     REWIND_FILE(file); 
02307     
02308     double a,e,i,omega_per,omega_nod,M;
02309     double time,time_old=0,timestep;
02310     
02311     char line[1024];
02312     
02313     /* while ( (fscanf(file,"%lf %lf %lf %lf %lf %lf %lf",
02314        &time,&a,&e,&i,&M,&omega_per,&omega_nod)) != EOF ) {
02315     */
02316     
02317     while (GETS_FILE(line,1024,file) != 0) {
02318       
02319       sscanf(line,"%lf %lf %lf %lf %lf %lf %lf",
02320              &time,&a,&e,&i,&M,&omega_per,&omega_nod);
02321       
02322       timestep  = time - time_old;
02323       time_old  = time;
02324       if (os->size() == 2) { 
02325         os->timestep = FromUnits(timestep,YEAR); // read in days, save in the current time units
02326         // cerr << "timestep set to: " << os->timestep << endl;
02327       }
02328       
02329       fo.epoch = FromUnits(time,YEAR); // read in days, save in the current time units
02330       
02331       fo.a                = FromUnits(a,AU);
02332       fo.e                = e;
02333       fo.i                = (pi/180.0)*i;
02334       fo.omega_node       = (pi/180.0)*omega_nod;
02335       fo.omega_pericenter = (pi/180.0)*omega_per;
02336       fo.M                = (pi/180.0)*M;
02337       
02338       os->push_back(fo);  
02339       
02340       // QUICK AND DIRTY!
02341       if (fo.e >= 1.0) {
02342         ORSA_ERROR("reading eccentricity > 1.0, returning.");
02343         return;
02344       }
02345       
02346     }
02347     
02348   }

Here is the call graph for this function:

virtual void SetFileName char *  name_in  )  [inline, virtual, inherited]
 

Definition at line 106 of file orsa_file.h.

References File::SetFileName().

00106                                                      {
00107       std::string n = name_in;
00108       SetFileName (n);
00109     }

Here is the call graph for this function:

virtual void SetFileName std::string  name_in  )  [inline, virtual, inherited]
 

Definition at line 101 of file orsa_file.h.

References File::Close(), orsa::CLOSE, File::filename, and File::status.

Referenced by OrsaConfigFile::OrsaConfigFile(), and File::SetFileName().

00101                                                         {
00102       if (status != CLOSE) Close();
00103       filename = name_in;
00104     }

Here is the call graph for this function:


Member Data Documentation

FILE_TYPE file [protected, inherited]
 

Definition at line 113 of file orsa_file.h.

Referenced by File::Close(), and File::File().

std::string filename [protected, inherited]
 

Definition at line 112 of file orsa_file.h.

Referenced by File::GetFileName(), and File::SetFileName().

FILE_STATUS status [protected, inherited]
 

Definition at line 114 of file orsa_file.h.

Referenced by File::Close(), File::File(), and File::SetFileName().


The documentation for this class was generated from the following files:
Generated on Tue Jan 11 15:28:19 2005 for liborsa by  doxygen 1.4.0