casa
$Rev:20696$
|
a class for accessing unipops SDD data files More...
#include <SDDFile.h>
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 () | |
SDDFile & | operator= (const SDDFile &other) |
assignment operator | |
void | attach (const String &fileName, FileOption option=Old) |
attach to a file | |
SDDBootStrap & | bootStrap () |
return a reference to the BootStrap | |
const SDDIndex & | index () const |
return a reference to the Index | |
SDDIndex & | index () |
const SDDIndexRep & | index (uInt entry) const |
SDDIndexRep & | index (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 | |
SDDHeader & | header (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) |
SDDHeader & | header (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 | |
SDDBootStrap * | boot_p |
SDDIndex * | index_p |
SDDHeader * | header_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 |
String * | fileName_p |
a class for accessing unipops SDD data files
Public interface
enum SDDFile::FileOption |
SDDFile::SDDFile | ( | ) |
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.
void SDDFile::attach | ( | const String & | fileName, |
FileOption | option = Old |
||
) |
attach to a file
Float SDDFile::az | ( | uInt | location, |
uInt | which | ||
) |
SDDBootStrap& SDDFile::bootStrap | ( | ) | [inline] |
Float SDDFile::decOffset | ( | uInt | location, |
uInt | which | ||
) |
Float SDDFile::el | ( | uInt | location, |
uInt | which | ||
) |
uInt SDDFile::fileMode | ( | FileOption | option | ) | const [private] |
Bool SDDFile::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.
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
Bool SDDFile::incrementalUpdate | ( | ) |
const SDDIndex& SDDFile::index | ( | ) | const [inline] |
SDDIndex& SDDFile::index | ( | ) | [inline] |
const SDDIndexRep& SDDFile::index | ( | uInt | entry | ) | const [inline] |
SDDIndexRep& SDDFile::index | ( | uInt | entry | ) | [inline] |
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.
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.
Vector<Float> SDDFile::az_p [private] |
SDDBootStrap* SDDFile::boot_p [private] |
Definition at line 154 of file SDDFile.h.
Referenced by bootStrap().
Double SDDFile::cosdec_p [private] |
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
Int SDDFile::currentOffset_p [private] |
Vector<Float> SDDFile::data_p [private] |
Vector<Float> SDDFile::decOffset_p [private] |
Vector<Float> SDDFile::el_p [private] |
CountedPtr<fstream> SDDFile::file_p [private] |
String* SDDFile::fileName_p [private] |
SDDHeader* SDDFile::header_p [private] |
SDDIndex* SDDFile::index_p [private] |
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().
FileOption SDDFile::option_p [private] |
Vector<Float> SDDFile::raOffset_p [private] |
Vector<Float> SDDFile::time_p [private] |