orsa_file.cc File Reference

#include "orsa_file.h"
#include <iostream>
#include <ctype.h>
#include "orsa_common.h"
#include "orsa_units.h"
#include "orsa_error.h"
#include "orsa_version.h"
#include "sdncal.h"
#include <cstdio>
#include "jpleph.h"
#include "jpl_int.h"
#include <unistd.h>
#include "support.h"

Include dependency graph for orsa_file.cc:

Go to the source code of this file.

Namespaces

namespace  orsa

Defines

#define SWAP_MACRO(A, B, TEMP)   { (TEMP) = (A); (A) = (B); (B) = (TEMP); }
 OrsaFile.

Functions

int SWIFTRawReadBinaryFile (FILE_TYPE file, const int version=2)
static void swap_4 (void *ptr)
static void swap_8 (void *ptr)
static void swap (void *ptr, unsigned int size)

Variables

int nast
double el [6]
double l_ts
double w_ts
double file_time
OrsaPaths * orsa_paths = 0


Define Documentation

#define SWAP_MACRO A,
B,
TEMP   )     { (TEMP) = (A); (A) = (B); (B) = (TEMP); }
 

OrsaFile.

Definition at line 1492 of file orsa_file.cc.

Referenced by orsa::swap_4(), and orsa::swap_8().


Function Documentation

static void swap void *  ptr,
unsigned int  size
[static]
 

Definition at line 1510 of file orsa_file.cc.

References ORSA_WARNING, orsa::swap_4(), and orsa::swap_8().

Referenced by OrsaFile::GoodFile(), and OrsaFile::Read().

01510                                                  {
01511     switch(size) {
01512     case 4: swap_4(ptr); break;
01513     case 8: swap_8(ptr); break;
01514     default:
01515       ORSA_WARNING("called read_swap with size = %i",size);
01516       break;
01517     }
01518   }

Here is the call graph for this function:

static void swap_4 void *  ptr  )  [static]
 

Definition at line 1494 of file orsa_file.cc.

References SWAP_MACRO.

Referenced by orsa::swap().

01494                                 {
01495     char *tptr = (char *)ptr, tchar;
01496     
01497     SWAP_MACRO( tptr[0], tptr[3], tchar);
01498     SWAP_MACRO( tptr[1], tptr[2], tchar);
01499   }

static void swap_8 void *  ptr  )  [static]
 

Definition at line 1501 of file orsa_file.cc.

References SWAP_MACRO.

Referenced by orsa::swap().

01501                                 {
01502     char *tptr = (char *)ptr, tchar;
01503     
01504     SWAP_MACRO( tptr[0], tptr[7], tchar);
01505     SWAP_MACRO( tptr[1], tptr[6], tchar);
01506     SWAP_MACRO( tptr[2], tptr[5], tchar);
01507     SWAP_MACRO( tptr[3], tptr[4], tchar);
01508   }

int SWIFTRawReadBinaryFile FILE_TYPE  file,
const int  version = 2
 

Definition at line 1166 of file orsa_file.cc.

References orsa::el, orsa::file_time, orsa::FromUnits(), orsa::l_ts, orsa::nast, READ_FILE, orsa::w_ts, and orsa::YEAR.

Referenced by SWIFTFile::AsteroidsInFile(), and SWIFTFile::Read().

01166                                                                     {
01167     
01168     // version == 1 --> not filetered data
01169     // version == 2 --> filtered data
01170     
01171     int good = 0;
01172     double dummy;
01173     
01174     if ( version == 1 ) {  
01175       READ_FILE(&dummy,        sizeof(int),    1,file);
01176       READ_FILE(&nast,         sizeof(int),    1,file);
01177       READ_FILE(&el,           sizeof(double), 6,file);
01178       READ_FILE(&file_time,    sizeof(double), 1,file);
01179       good = READ_FILE(&dummy, sizeof(int),    1,file);
01180     } else if ( version == 2 ) {
01181       READ_FILE(&dummy,        sizeof(int),    1,file);
01182       READ_FILE(&nast,         sizeof(int),    1,file);
01183       READ_FILE(&el,           sizeof(double), 6,file);
01184       READ_FILE(&l_ts,         sizeof(double), 1,file);
01185       READ_FILE(&w_ts,         sizeof(double), 1,file);
01186       READ_FILE(&file_time,    sizeof(double), 1,file);
01187       good = READ_FILE(&dummy, sizeof(int),    1,file);
01188     }
01189     
01190     // Units conversions
01191     file_time = FromUnits(file_time,YEAR);
01192     
01193     return (good);
01194   }

Here is the call graph for this function:


Variable Documentation

double el[6]
 

Definition at line 1164 of file orsa_file.cc.

Referenced by SWIFTFile::Read(), and orsa::SWIFTRawReadBinaryFile().

double file_time
 

Definition at line 1164 of file orsa_file.cc.

Referenced by SWIFTFile::Read(), and orsa::SWIFTRawReadBinaryFile().

double l_ts
 

Definition at line 1164 of file orsa_file.cc.

Referenced by SWIFTFile::Read(), and orsa::SWIFTRawReadBinaryFile().

int nast
 

Definition at line 1163 of file orsa_file.cc.

Referenced by SWIFTFile::AsteroidsInFile(), SWIFTFile::Read(), and orsa::SWIFTRawReadBinaryFile().

OrsaPaths * orsa_paths = 0
 

Definition at line 3232 of file orsa_file.cc.

Referenced by OrsaPaths::OrsaPaths().

double w_ts
 

Definition at line 1164 of file orsa_file.cc.

Referenced by orsa::SWIFTRawReadBinaryFile().


Generated on Tue Jan 11 15:26:51 2005 for liborsa by  doxygen 1.4.0