casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Member Functions | Private Attributes
SDDFile Class Reference

a class for accessing unipops SDD data files More...

#include <SDDFile.h>

List of all members.

Public Types

enum  FileOption {
  Old,
  New,
  NewNoReplace,
  Scratch,
  Update,
  Delete
}
 These file options are straight out of Table. More...

Public Member Functions

 SDDFile ()
 creates the parts, but nothing is attached to any file
 SDDFile (const String &fileName, FileOption option=Old)
 open the indicated file, with the indicated options
 SDDFile (const SDDFile &other)
 Copy constructor.
 ~SDDFile ()
SDDFileoperator= (const SDDFile &other)
 assignment operator
void attach (const String &fileName, FileOption option=Old)
 attach to a file
SDDBootStrapbootStrap ()
 return a reference to the BootStrap
const SDDIndexindex () const
 return a reference to the Index
SDDIndexindex ()
const SDDIndexRepindex (uInt entry) const
SDDIndexRepindex (uInt entry)
uInt nvectors (uInt entry) const
 the number of vectors at a specific entry
Bool inUse (uInt entry) const
 check if a specific index entry is in use
SDDHeaderheader (uInt location)
 return a reference to the Header at location i
Bool getData (Array< Float > &data, uInt location, uInt which=0)
 get the data vector at the indicated location in the index If there is more than one vector at that location (for OTF and PZ data at the 12m), get the one indicated.
Float time (uInt location, uInt which)
 The following are specific to OTF data they are the single values appropriate for a given location and vector for non-OTF rows, these return 0 for the offsets (time, raOffset, decOffset), and the header values for az and el.
Float raOffset (uInt location, uInt which)
Float decOffset (uInt location, uInt which)
Float az (uInt location, uInt which)
Float el (uInt location, uInt which)
SDDHeaderheader (uInt scan, uInt subscan)
 return a reference to the header/data corresponding to scan & subscan
Bool fullUpdate ()
 update the bootstrap and index if the file on disk has changed this also needs to reset the rowMap and make sure the "current" values point at appropriate things.
Bool incrementalUpdate ()

Private Member Functions

void seek (uInt record=0)
uInt fileMode (FileOption option) const
void loadLocation (uInt location)
void resetCache ()
void init_nvectors ()

Private Attributes

SDDBootStrapboot_p
SDDIndexindex_p
SDDHeaderheader_p
Vector< Float > data_p
Double cosdec_p
Vector< Float > time_p
Vector< Float > raOffset_p
Vector< Float > decOffset_p
Vector< Float > az_p
Vector< Float > el_p
CountedPtr< fstream > file_p
Block< uInt > nvectors_p
 The cache of number of vectors per entry.
Int currentHeader_p
 For all of the current pointers, if < 0 they point at nothing valid It is always true that the header and various data vectors are always from the same location, only the row number may vary.
Int currentOffset_p
 This is the offset into this location that corresponds to this row.
FileOption option_p
StringfileName_p

Detailed Description

a class for accessing unipops SDD data files

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Definition at line 79 of file SDDFile.h.


Member Enumeration Documentation

These file options are straight out of Table.

They should be made more general.

Enumerator:
Old 
New 
NewNoReplace 
Scratch 
Update 
Delete 

Definition at line 83 of file SDDFile.h.


Constructor & Destructor Documentation

creates the parts, but nothing is attached to any file

SDDFile::SDDFile ( const String fileName,
FileOption  option = Old 
)

open the indicated file, with the indicated options

SDDFile::SDDFile ( const SDDFile other)

Copy constructor.


Member Function Documentation

void SDDFile::attach ( const String fileName,
FileOption  option = Old 
)

attach to a file

Float SDDFile::az ( uInt  location,
uInt  which 
)

return a reference to the BootStrap

Definition at line 107 of file SDDFile.h.

References boot_p.

Float SDDFile::decOffset ( uInt  location,
uInt  which 
)
Float SDDFile::el ( uInt  location,
uInt  which 
)
uInt SDDFile::fileMode ( FileOption  option) const [private]

update the bootstrap and index if the file on disk has changed this also needs to reset the rowMap and make sure the "current" values point at appropriate things.

If the "current" values are no longer available, reset to the first thing that is available. The return values are the same as the SDDIndex functions they use

Bool SDDFile::getData ( Array< Float > &  data,
uInt  location,
uInt  which = 0 
)

get the data vector at the indicated location in the index If there is more than one vector at that location (for OTF and PZ data at the 12m), get the one indicated.

If the arguments are invalid, getData returns False and does NOT alter the array argument

SDDHeader& SDDFile::header ( uInt  location)

return a reference to the Header at location i

SDDHeader& SDDFile::header ( uInt  scan,
uInt  subscan 
)

return a reference to the header/data corresponding to scan & subscan

const SDDIndex& SDDFile::index ( ) const [inline]

return a reference to the Index

Definition at line 110 of file SDDFile.h.

References index_p.

SDDIndex& SDDFile::index ( ) [inline]

Definition at line 111 of file SDDFile.h.

References index_p.

const SDDIndexRep& SDDFile::index ( uInt  entry) const [inline]

Definition at line 113 of file SDDFile.h.

References index_p.

SDDIndexRep& SDDFile::index ( uInt  entry) [inline]

Definition at line 115 of file SDDFile.h.

References index_p.

void SDDFile::init_nvectors ( ) [private]
Bool SDDFile::inUse ( uInt  entry) const [inline]

check if a specific index entry is in use

Definition at line 121 of file SDDFile.h.

References index_p, and SDDIndex::inUse().

void SDDFile::loadLocation ( uInt  location) [private]
uInt SDDFile::nvectors ( uInt  entry) const [inline]

the number of vectors at a specific entry

Definition at line 118 of file SDDFile.h.

References nvectors_p.

SDDFile& SDDFile::operator= ( const SDDFile other)

assignment operator

Float SDDFile::raOffset ( uInt  location,
uInt  which 
)
void SDDFile::resetCache ( ) [private]
void SDDFile::seek ( uInt  record = 0) [private]
Float SDDFile::time ( uInt  location,
uInt  which 
)

The following are specific to OTF data they are the single values appropriate for a given location and vector for non-OTF rows, these return 0 for the offsets (time, raOffset, decOffset), and the header values for az and el.


Member Data Documentation

Vector<Float> SDDFile::az_p [private]

Definition at line 164 of file SDDFile.h.

Definition at line 154 of file SDDFile.h.

Referenced by bootStrap().

Double SDDFile::cosdec_p [private]

Definition at line 160 of file SDDFile.h.

Int SDDFile::currentHeader_p [private]

For all of the current pointers, if < 0 they point at nothing valid It is always true that the header and various data vectors are always from the same location, only the row number may vary.

the current index entry location loaded here for the header and OTF data

Definition at line 176 of file SDDFile.h.

Int SDDFile::currentOffset_p [private]

This is the offset into this location that corresponds to this row.

Definition at line 178 of file SDDFile.h.

Vector<Float> SDDFile::data_p [private]

Definition at line 158 of file SDDFile.h.

Vector<Float> SDDFile::decOffset_p [private]

Definition at line 163 of file SDDFile.h.

Vector<Float> SDDFile::el_p [private]

Definition at line 165 of file SDDFile.h.

CountedPtr<fstream> SDDFile::file_p [private]

Definition at line 167 of file SDDFile.h.

Definition at line 181 of file SDDFile.h.

Definition at line 156 of file SDDFile.h.

Definition at line 155 of file SDDFile.h.

Referenced by index(), and inUse().

Block<uInt> SDDFile::nvectors_p [private]

The cache of number of vectors per entry.

Definition at line 170 of file SDDFile.h.

Referenced by nvectors().

Definition at line 180 of file SDDFile.h.

Vector<Float> SDDFile::raOffset_p [private]

Definition at line 162 of file SDDFile.h.

Vector<Float> SDDFile::time_p [private]

Definition at line 161 of file SDDFile.h.


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