RWOFile Class Reference

AstDyS observation file, usually with a .rwo extension. More...

#include <orsa_file.h>

Inheritance diagram for RWOFile:

Inheritance graph
[legend]
Collaboration diagram for RWOFile:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 RWOFile ()
 AstDyS observation file, usually with a .rwo extension.
void Read ()
void Open ()
void Close ()
virtual std::string GetFileName () const
virtual void SetFileName (std::string name_in)
virtual void SetFileName (char *name_in)

Public Attributes

std::vector< Observationobs

Protected Attributes

std::string filename
FILE_TYPE file
FILE_STATUS status


Detailed Description

AstDyS observation file, usually with a .rwo extension.

Definition at line 238 of file orsa_file.h.


Constructor & Destructor Documentation

RWOFile (  ) 

AstDyS observation file, usually with a .rwo extension.

Definition at line 988 of file orsa_file.cc.

00988 { }


Member Function Documentation

void Read (  )  [virtual]

Implements ReadFile.

Definition at line 990 of file orsa_file.cc.

References Observation::date, Observation::dec, Observation::designation, File::file, GETS_FILE, RWOFile::obs, Observation::obscode, ReadFile::Open(), Observation::ra, orsa::remove_leading_trailing_spaces(), REWIND_FILE, Angle::SetDPS(), Date::SetGregor(), Angle::SetHMS(), and orsa::UTC.

00990                      {
00991     
00992     Open();
00993     
00994     obs.clear();
00995     
00996     REWIND_FILE(file);
00997     
00998     Observation dummy_obs;
00999     // dummy_obs.date.SetTimeScale(UTC); // checked, is UTC
01000     
01001     double y,m,d,p,s,h;
01002     
01003     char line[256];
01004     
01005     string designation;
01006     string date,ra,dec;
01007     string observatory_code;
01008     
01009     while (GETS_FILE(line,256,file) != 0) {
01010       
01011       // if (strlen(line) < 45) continue; // not a good line, maybe a comment or a white line...
01012       if (strlen(line) < 130) continue; // not a good line, maybe a comment or a white line... NOTE: radar observations are not read now, and have shorter lines
01013       if (line[0] == '!')     continue; // comment/header line
01014       
01015       designation.assign(line,1,9); 
01016       remove_leading_trailing_spaces(designation);
01017       
01018       date.assign(line,15,17);
01019       
01020       ra.assign(line,34,12);
01021       
01022       dec.assign(line,63,12);
01023       
01024       observatory_code.assign(line,114,3);
01025       remove_leading_trailing_spaces(observatory_code);
01026       
01027       dummy_obs.designation        = designation;
01028       // dummy_obs.discovery_asterisk = discovery_asterisk;
01029       // dummy_obs.obscode            = atoi(observatory_code.c_str());
01030       dummy_obs.obscode            = observatory_code;
01031       
01032       /* sscanf(magnitude.c_str(),"%lf",&tmp);
01033          dummy_obs.mag = tmp;
01034       */
01035       
01036      
01037       sscanf(date.c_str(),"%lf %lf %lf",&y,&m,&d);
01038       dummy_obs.date.SetGregor((int)y,(int)m,d,UTC);
01039       
01040       sscanf(ra.c_str(),"%lf %lf %lf",&h,&m,&s);
01041       dummy_obs.ra.SetHMS(h,m,s);
01042       
01043       sscanf(dec.c_str(),"%lf %lf %lf",&d,&p,&s);
01044       dummy_obs.dec.SetDPS(d,p,s);
01045       
01046       //check for a good observation
01047       if ((designation != "") && 
01048           (observatory_code != "") ) {
01049         obs.push_back(dummy_obs);
01050       }
01051       
01052     }
01053     
01054   }

Here is the call graph for this function:

void Open (  )  [inherited]

void Close (  )  [inherited]

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

Definition at line 99 of file orsa_file.h.

References File::filename.

Referenced by OrsaFile::Read().

00099 { return filename; }

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:

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:


Member Data Documentation

std::vector<Observation> obs

Definition at line 246 of file orsa_file.h.

Referenced by RWOFile::Read().

std::string filename [protected, inherited]

FILE_TYPE file [protected, inherited]

FILE_STATUS status [protected, inherited]


The documentation for this class was generated from the following files:

Generated on Mon Apr 28 20:03:54 2008 for liborsa by  doxygen 1.5.5