Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALFrame 3.0.7.1-80ec0e6
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALFrameIO.c File Reference

Prototypes

int XLALFrFileClose (LALFrFile *frfile)
 Close a frame file described by a LALFrFile structure. More...
 
LALFrFileXLALFrFileOpenURL (const char *url)
 Open frame file for reading and return a LALFrFile structure. More...
 
size_t XLALFrFileQueryNFrame (const LALFrFile *frfile)
 Query a frame file for the number of frames contained in the file. More...
 
LIGOTimeGPSXLALFrFileQueryGTime (LIGOTimeGPS *start, const LALFrFile *frfile, size_t pos)
 Query a frame file for the start time of a particular frame. More...
 
double XLALFrFileQueryDt (const LALFrFile *frfile, size_t pos)
 Query a frame file for the duration of a particular frame. More...
 
LALTYPECODE XLALFrFileQueryChanType (const LALFrFile *frfile, const char *chname, size_t pos)
 Query a frame file for the data type of a channel in a frame. More...
 
size_t XLALFrFileQueryChanVectorLength (const LALFrFile *frfile, const char *chname, size_t pos)
 Query a frame file for the number of data points in a channel in a frame. More...
 
int XLALFrFileCksumValid (LALFrFile *frfile)
 Use checksum to determine if a frame file is valid. More...
 
int XLALFrameAddFrHistory (LALFrameH *frame, const char *name, const char *comment)
 Adds a history structure to a frame. More...
 
static int XLALLocalTime (char site, int gpssec)
 
int XLALFrameAddFrDetector (LALFrameH *frame, const LALFrDetector *detector)
 Adds a detector structure to a frame. More...
 
void XLALFrameFree (LALFrameH *frame)
 Frees a frame structure. More...
 
LALFrameHXLALFrameNew (const LIGOTimeGPS *epoch, double duration, const char *project, int run, int frnum, INT8 detectorFlags)
 Creates a new frame structure. More...
 
static LIGOTimeGPSXLALFrameQueryGTime (LIGOTimeGPS *start, const LALFrameH *frame)
 
int XLALFrameWrite (LALFrameH *frame, const char *fname)
 Write a LALFrameH frame structure to a frame file. More...
 
static int charcmp (const void *c1, const void *c2)
 
static int XLALFrameFileName (char *fname, size_t size, const char *chname, const LIGOTimeGPS *epoch, double duration)
 

Go to the source code of this file.

Macros

#define localtime_r(timep, result)   memcpy((result), localtime(timep), sizeof(struct tm))
 
#define TDOM   1
 
#define FDOM   2
 
#define DOM   TDOM
 
#define TYPE   INT2
 
#define VEXT   2S
 
#define TYPE   INT4
 
#define VEXT   4S
 
#define TYPE   INT8
 
#define VEXT   8S
 
#define TYPE   UINT2
 
#define VEXT   2U
 
#define TYPE   UINT4
 
#define VEXT   4U
 
#define TYPE   UINT8
 
#define VEXT   8U
 
#define TYPE   REAL4
 
#define VEXT   4R
 
#define TYPE   REAL8
 
#define VEXT   8R
 
#define TYPE   COMPLEX8
 
#define VEXT   8C
 
#define TYPE   COMPLEX16
 
#define VEXT   16C
 
#define DOM   FDOM
 
#define TYPE   REAL4
 
#define VEXT   4R
 
#define TYPE   REAL8
 
#define VEXT   8R
 
#define TYPE   COMPLEX8
 
#define VEXT   8C
 
#define TYPE   COMPLEX16
 
#define VEXT   16C
 
#define DEFINE_FR_CHAN_ADD_TS_FUNCTION(chantype, laltype, vectype, compress)
 
#define DEFINE_FR_PROC_CHAN_ADD_TS_FUNCTION(laltype, vectype, compress)
 
#define DEFINE_FR_PROC_CHAN_ADD_FS_FUNCTION(laltype, vectype, compress)
 
#define DEFINE_FR_WRITE_TS_FUNCTION(laltype)
 
#define DEFINE_FR_WRITE_FS_FUNCTION(laltype)
 

Macro Definition Documentation

◆ localtime_r

#define localtime_r (   timep,
  result 
)    memcpy((result), localtime(timep), sizeof(struct tm))

Definition at line 44 of file LALFrameIO.c.

◆ TDOM

#define TDOM   1

Definition at line 215 of file LALFrameIO.c.

◆ FDOM

#define FDOM   2

Definition at line 216 of file LALFrameIO.c.

◆ DOM [1/2]

#define DOM   TDOM

Definition at line 281 of file LALFrameIO.c.

◆ TYPE [1/14]

#define TYPE   INT2

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [1/14]

#define VEXT   2S

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [2/14]

#define TYPE   INT4

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [2/14]

#define VEXT   4S

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [3/14]

#define TYPE   INT8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [3/14]

#define VEXT   8S

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [4/14]

#define TYPE   UINT2

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [4/14]

#define VEXT   2U

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [5/14]

#define TYPE   UINT4

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [5/14]

#define VEXT   4U

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [6/14]

#define TYPE   UINT8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [6/14]

#define VEXT   8U

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [7/14]

#define TYPE   REAL4

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [7/14]

#define VEXT   4R

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [8/14]

#define TYPE   REAL8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [8/14]

#define VEXT   8R

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [9/14]

#define TYPE   COMPLEX8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [9/14]

#define VEXT   8C

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [10/14]

#define TYPE   COMPLEX16

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [10/14]

#define VEXT   16C

Definition at line 302 of file LALFrameIO.c.

◆ DOM [2/2]

#define DOM   FDOM

Definition at line 281 of file LALFrameIO.c.

◆ TYPE [11/14]

#define TYPE   REAL4

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [11/14]

#define VEXT   4R

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [12/14]

#define TYPE   REAL8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [12/14]

#define VEXT   8R

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [13/14]

#define TYPE   COMPLEX8

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [13/14]

#define VEXT   8C

Definition at line 302 of file LALFrameIO.c.

◆ TYPE [14/14]

#define TYPE   COMPLEX16

Definition at line 301 of file LALFrameIO.c.

◆ VEXT [14/14]

#define VEXT   16C

Definition at line 302 of file LALFrameIO.c.

◆ DEFINE_FR_CHAN_ADD_TS_FUNCTION

#define DEFINE_FR_CHAN_ADD_TS_FUNCTION (   chantype,
  laltype,
  vectype,
  compress 
)

Definition at line 446 of file LALFrameIO.c.

◆ DEFINE_FR_PROC_CHAN_ADD_TS_FUNCTION

#define DEFINE_FR_PROC_CHAN_ADD_TS_FUNCTION (   laltype,
  vectype,
  compress 
)

Definition at line 489 of file LALFrameIO.c.

◆ DEFINE_FR_PROC_CHAN_ADD_FS_FUNCTION

#define DEFINE_FR_PROC_CHAN_ADD_FS_FUNCTION (   laltype,
  vectype,
  compress 
)

Definition at line 534 of file LALFrameIO.c.

◆ DEFINE_FR_WRITE_TS_FUNCTION

#define DEFINE_FR_WRITE_TS_FUNCTION (   laltype)
Value:
int XLALFrWrite ## laltype ## TimeSeries(const laltype ## TimeSeries *series, int frnum) \
{ \
LALFrameH *frame; \
double duration; \
char fname[FILENAME_MAX]; \
int detflgs; \
duration = series->deltaT * series->data->length; \
detflgs = XLALFrameFileName(fname, sizeof(fname), series->name, &series->epoch, duration); \
frame = XLALFrameNew(&series->epoch, duration, "LAL", 0, frnum, detflgs); \
XLALFrameAdd ## laltype ## TimeSeriesProcData(frame, series); \
XLALFrameWrite(frame, fname); \
XLALFrameFree(frame); \
return 0; \
}
static int XLALFrameFileName(char *fname, size_t size, const char *chname, const LIGOTimeGPS *epoch, double duration)
Definition: LALFrameIO.c:645
LALFrameH * XLALFrameNew(const LIGOTimeGPS *epoch, double duration, const char *project, int run, int frnum, INT8 detectorFlags)
Creates a new frame structure.
Definition: LALFrameIO.c:411

Definition at line 705 of file LALFrameIO.c.

◆ DEFINE_FR_WRITE_FS_FUNCTION

#define DEFINE_FR_WRITE_FS_FUNCTION (   laltype)
Value:
int XLALFrWrite ## laltype ## FrequencySeries(const laltype ## FrequencySeries *series, int frnum, int subtype) \
{ \
LALFrameH *frame; \
double duration; \
char fname[FILENAME_MAX]; \
int detflgs; \
duration = series->deltaF > 0.0 ? 1.0 / series->deltaF : 1.0; \
detflgs = XLALFrameFileName(fname, sizeof(fname), series->name, &series->epoch, duration); \
frame = XLALFrameNew(&series->epoch, duration, "LAL", 0, frnum, detflgs); \
XLALFrameAdd ## laltype ## FrequencySeriesProcData(frame, series, subtype); \
XLALFrameWrite(frame, fname); \
return 0; \
}

Definition at line 730 of file LALFrameIO.c.

Function Documentation

◆ XLALLocalTime()

static int XLALLocalTime ( char  site,
int  gpssec 
)
static

Definition at line 335 of file LALFrameIO.c.

◆ XLALFrameQueryGTime()

static LIGOTimeGPS * XLALFrameQueryGTime ( LIGOTimeGPS start,
const LALFrameH frame 
)
static

Definition at line 437 of file LALFrameIO.c.

◆ charcmp()

static int charcmp ( const void *  c1,
const void *  c2 
)
static

Definition at line 633 of file LALFrameIO.c.

◆ XLALFrameFileName()

static int XLALFrameFileName ( char *  fname,
size_t  size,
const char *  chname,
const LIGOTimeGPS epoch,
double  duration 
)
static

Definition at line 645 of file LALFrameIO.c.