My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::FitsIo Class Reference

Classes

struct  FitsAxisCard
 
struct  FitsBunitCard
 
struct  FitsDataType
 
struct  Phdu
 

Public Types

enum  FitsAxis { AX_DEG, AX_RAD, AX_UV, AX_UNKNOWN }
 
enum  FitsBunit { BU_MJYSR, BU_JYBEAM, BU_MUK, BU_UNKNOWN }
 

Public Member Functions

 FitsIo ()
 
virtual ~FitsIo ()
 
void putPhdu (const char *name, const char *val, const char *comment, FILE *fp=0)
 
void setObsRa (HourAngle ra)
 
void setObsDec (DecAngle dec)
 
void setTelescopeName (std::string telescope)
 
void setTelescopeLocations (std::vector< std::vector< double > > &locations)
 
void setInstrument (std::string instrument)
 
void setSourceName (std::string srcName)
 
void setNumberOfIfs (unsigned nIf)
 
void setIfFrequencies (std::vector< Frequency > &frequencies)
 
void setDeltaIfFrequencies (std::vector< Frequency > &frequencies)
 
void setStartingIfFrequency (Frequency frequency)
 
void setDeltaIfFrequency (Frequency frequency)
 
void setNumberOfChannelsPerIf (unsigned nChan)
 
void setDeltaChannelFrequency (Frequency frequency)
 
void setNumberOfFrames (unsigned nFrame)
 
void setNumberOfBaselines (unsigned nBaseline)
 
void setNumberOfStokesParameters (unsigned nStokes)
 
void setDate ()
 
void checkParameters ()
 
void openFile (std::string fileName)
 
void initHeader ()
 
void finishHeader (FILE *fp=0)
 
void writeFileHeaderBody (FILE *fp=0)
 
void writeAntennaTableHeaderBody (FILE *fp=0)
 
void writeFrequencyTableHeaderBody (FILE *fp=0)
 
void writeFileHeader (FILE *fp=0)
 
void writeAntennaTableHeader (FILE *fp=0)
 
void writeFrequencyTableHeader (FILE *fp=0)
 
void initVisibilityData ()
 
void writeVisibilityDataBody (double *vis, double *date, double *uvw, FILE *fp=0)
 
void finishVisibilityData (FILE *fp=0)
 
void writeVisibilityData (double *vis, double *date, double *uvw, FILE *fp=0)
 
void initAntennaTableDataBody ()
 
void writeAntennaTableDataBody (FILE *fp=0)
 
void finishAntennaTableDataBody (FILE *fp=0)
 
void writeAntennaTableData (FILE *fp=0)
 
void writeAntennaTableEntry (int i, double X, double Y, double Z, FILE *fp=0)
 
void writeAntennaTable (FILE *fp=0)
 
void initFrequencyTableDataBody ()
 
void writeFrequencyTableDataBody (FILE *fp=0)
 
void finishFrequencyTableDataBody (FILE *fp=0)
 
void writeFrequencyTableData (FILE *fp=0)
 
void writeFrequencyTable (FILE *fp=0)
 
void writeUvfFile (double *data, double *date, double *uvw, FILE *fp=0)
 
FILE * getFptr (FILE *fp)
 
void getTelescopeIndices (unsigned baslineIndex, unsigned *iRow, unsigned *iCol, unsigned nTel)
 

Static Public Member Functions

static void nullStr (char *buf, const char *val)
 
static void logStr (char *buf, const char *val)
 
static void intStr (char *buf, const char *val)
 
static void fltStr (char *buf, const char *val)
 
static void strStr (char *buf, const char *val)
 
static void rdNull (FitsDataType &data, char *str)
 
static void rdLog (FitsDataType &data, char *str)
 
static void rdStr (FitsDataType &data, char *str)
 
static void rdInt (FitsDataType &data, char *str)
 
static void rdFlt (FitsDataType &data, char *str)
 
static void rdBunit (FitsDataType &data, char *str)
 
static void rdAxis (FitsDataType &data, char *str)
 

Static Public Attributes

static const unsigned nBytePerHeader_ =80
 
static const unsigned nHeaderPerDataRecord_ = 36
 
static const unsigned nBytePerDataRecord_
 
static const unsigned nBytePerKeyword_ =8
 
static const unsigned logPos_ =30
 
static const unsigned nBytePerFrequencyTableEntry_ = 32
 
static const unsigned secondsPerDay_ = 86400
 
static FitsAxisCard fitsAxes_ []
 
static unsigned nFitsAxes_ = sizeof(fitsAxes_)/sizeof(FitsAxisCard)
 
static FitsBunitCard fitsUnits_ []
 
static unsigned nFitsUnits_ = sizeof(fitsUnits_)/sizeof(FitsBunitCard)
 
static FitsIo::Phdu phdus_ []
 
static unsigned nPhdus_ = sizeof(phdus_)/sizeof(Phdu)
 

Constructor & Destructor Documentation

FitsIo::FitsIo ( )

Constructor.

....................................................................... Constructor.

FitsIo::~FitsIo ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

void FitsIo::finishAntennaTableDataBody ( FILE *  fp = 0)

....................................................................... Finish writing the antenna table data

void FitsIo::finishHeader ( FILE *  fp = 0)

....................................................................... Perform appropriate buffering of the header

void FitsIo::finishVisibilityData ( FILE *  fp = 0)

....................................................................... Finish writing the visibility portion of the file

void FitsIo::fltStr ( char *  buf,
const char *  val 
)
static

....................................................................... Convert a float to a string.

FILE * FitsIo::getFptr ( FILE *  fp)

....................................................................... Get the FILE pointer to which we will write

void FitsIo::getTelescopeIndices ( unsigned  baselineIndex,
unsigned *  iRow,
unsigned *  iCol,
unsigned  nTel 
)

....................................................................... Return the antenna indices associated with a given visibility index.

void FitsIo::initAntennaTableDataBody ( )

....................................................................... Initialize resources for writing the antenna table data

void FitsIo::initHeader ( )

....................................................................... Initialize the header

void FitsIo::initVisibilityData ( )

....................................................................... Initialize writing visibilities

void FitsIo::intStr ( char *  buf,
const char *  val 
)
static

....................................................................... Convert an integer to a string.

void FitsIo::logStr ( char *  buf,
const char *  val 
)
static

....................................................................... Print a logical argument in column 30.

void FitsIo::nullStr ( char *  buf,
const char *  val 
)
static

....................................................................... A do-nothing function for null value header keys.

void FitsIo::putPhdu ( const char *  name,
const char *  val,
const char *  comment,
FILE *  fp = 0 
)

....................................................................... Write a header key to a file.

void FitsIo::rdAxis ( FitsDataType data,
char *  str 
)
static

....................................................................... Read a FitsAxis derived type.

void FitsIo::rdBunit ( FitsDataType data,
char *  str 
)
static

....................................................................... Read a FitsBunit derived type.

void FitsIo::rdFlt ( FitsDataType data,
char *  str 
)
static

....................................................................... Convert a string to a float argument.

void FitsIo::rdInt ( FitsDataType data,
char *  str 
)
static

....................................................................... Convert a string to an integer argument.

void FitsIo::rdLog ( FitsDataType data,
char *  str 
)
static

....................................................................... Read a logical argument.

void FitsIo::rdNull ( FitsDataType data,
char *  str 
)
static

....................................................................... A do-nothing read function for null value header keys.

void FitsIo::rdStr ( FitsDataType data,
char *  str 
)
static

....................................................................... Read a string.

void FitsIo::setDeltaIfFrequencies ( std::vector< Frequency > &  frequencies)

....................................................................... Install a vector of IF bandwidths

void FitsIo::setIfFrequencies ( std::vector< Frequency > &  frequencies)

....................................................................... Install a vector of IF frequencies

void FitsIo::setTelescopeLocations ( std::vector< std::vector< double > > &  locations)

....................................................................... Install a vector of antenna locations

void FitsIo::strStr ( char *  buf,
const char *  val 
)
static

....................................................................... Print a string.

void FitsIo::writeAntennaTable ( FILE *  fp = 0)

....................................................................... Write the whole antenna table

void FitsIo::writeAntennaTableData ( FILE *  fp = 0)

....................................................................... Write the antenna table data

void FitsIo::writeAntennaTableDataBody ( FILE *  fp = 0)

....................................................................... Write the body of the antenna table

void FitsIo::writeAntennaTableEntry ( int  i,
double  X,
double  Y,
double  Z,
FILE *  fp = 0 
)

....................................................................... Write a single entry of the antenna table

void FitsIo::writeAntennaTableHeader ( FILE *  fp = 0)

....................................................................... Construct a header for the antenna table

void FitsIo::writeFileHeader ( FILE *  fp = 0)

....................................................................... Pull it all together – write the FILE header

void FitsIo::writeFrequencyTableHeader ( FILE *  fp = 0)

....................................................................... Construct a header for the frequency table

void FitsIo::writeVisibilityData ( double *  vis,
double *  date,
double *  uvw,
FILE *  fp = 0 
)

....................................................................... Write the whole visibility segment of the file

void FitsIo::writeVisibilityDataBody ( double *  vis,
double *  date,
double *  uvw,
FILE *  fp = 0 
)

....................................................................... Write out visibility data

Member Data Documentation

FitsIo::FitsAxisCard FitsIo::fitsAxes_
static
Initial value:
= {
{"RA" , "\\gh (\\(0718))", AX_DEG},
{"DEC", "\\gh (\\(0718))", AX_DEG},
{"RA_R", "\\gh (rad)", AX_RAD},
{"DEC_R", "\\gh (rad)", AX_RAD},
{"U", "U (\\gl)", AX_UV},
{"V", "V (\\gl)", AX_UV},
{"UNKNOWN", "Unknown", AX_UNKNOWN},
}
FitsIo::FitsBunitCard FitsIo::fitsUnits_
static
Initial value:
= {
{"MJY/SR", "MJy/sr", BU_MJYSR},
{"JY/BEAM","Jy/Beam", BU_JYBEAM},
{"MUK", "\\gmK", BU_MUK},
{"UNKNOWN","Unknown", BU_UNKNOWN},
}
const unsigned gcp::util::FitsIo::nBytePerDataRecord_
static
Initial value:
=
nBytePerHeader_ * nHeaderPerDataRecord_

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