24#include <lal/LALStdlib.h>
26#include <lal/LALCache.h>
27#include <lal/LALFrStream.h>
104 "Could not open URL %s\n",
111 "Could not read TOC from %s\n",
127#define DEFINE_LAL_GET_TS_FUNCTION(laltype) \
128 void LALFrGet ## laltype ## TimeSeries(LALStatus *status, laltype ## TimeSeries *series, FrChanIn *chanin, LALFrStream *stream) \
132 XLAL_PRINT_DEPRECATION_WARNING("XLALFrStreamGet" #laltype "TimeSeries"); \
133 INITSTATUS(status); \
134 strcpy(series->name, chanin->name); \
135 XLAL_TRY(code = XLALFrStreamGet ## laltype ## TimeSeries(series, stream), errnum); \
136 if ((code < 0) || errnum) { \
137 if (stream->state & LAL_FR_STREAM_END) { \
138 ABORT(status, FRAMESTREAMH_EDONE, FRAMESTREAMH_MSGEDONE); \
140 ABORT(status, FRAMESTREAMH_EREAD, FRAMESTREAMH_MSGEREAD); \
145#define DEFINE_LAL_GET_TSM_FUNCTION(laltype) \
146 void LALFrGet ## laltype ## TimeSeriesMetadata(LALStatus *status, laltype ## TimeSeries *series, FrChanIn *chanin, LALFrStream *stream) \
149 XLAL_PRINT_DEPRECATION_WARNING("XLALFrStreamGet" #laltype "TimeSeriesMetadata"); \
150 INITSTATUS(status); \
151 strcpy(series->name, chanin->name); \
152 code = XLALFrStreamGet ## laltype ## TimeSeriesMetadata(series, stream); \
154 ABORT(status, FRAMESTREAMH_EREAD, FRAMESTREAMH_MSGEREAD); \
159#define DEFINE_LAL_GET_FS_FUNCTION(laltype) \
160 void LALFrGet ## laltype ## FrequencySeries(LALStatus *status, laltype ## FrequencySeries *series, FrChanIn *chanin, LALFrStream *stream) \
163 XLAL_PRINT_DEPRECATION_WARNING("XLALFrStreamGet" #laltype "FrequencySeries"); \
164 INITSTATUS(status); \
165 strcpy(series->name, chanin->name); \
166 code = XLALFrStreamGet ## laltype ## FrequencySeries(series, stream); \
168 ABORT(status, FRAMESTREAMH_EREAD, FRAMESTREAMH_MSGEREAD); \
194#define DEFINE_LAL_WRITE_TS_FUNCTION(laltype) \
195 void LALFrWrite ## laltype ## TimeSeries(LALStatus *status, laltype ## TimeSeries *series, FrOutPar *params) \
198 char fname[FILENAME_MAX]; \
201 XLAL_PRINT_DEPRECATION_WARNING("XLALFrWrite" #laltype "TimeSeries"); \
202 INITSTATUS(status); \
203 duration = series->deltaT * series->data->length; \
204 t0 = series->epoch.gpsSeconds; \
205 dt = (int)ceil(XLALGPSGetREAL8(&series->epoch)+duration) - t0; \
206 snprintf(fname, sizeof(fname), "%s-%s-%d-%d.gwf", \
207 params->source ? params->source : "F", \
208 params->description ? params->description : "UNKNOWN", \
210 frame = XLALFrameNew(&series->epoch, duration, "LAL", params->run, params->frame, 0); \
211 XLALFrameAdd ## laltype ## TimeSeriesProcData(frame, series); \
212 XLALFrameWrite(frame, fname); \
213 XLALFrameFree(frame); \
#define FRAMESTREAMH_ENULL
#define FRAMESTREAMH_ERROR
#define FRAMESTREAMH_EOPEN
#define FRAMESTREAMH_MSGETREQ
#define FRAMESTREAMH_MSGEREAD
#define FRAMESTREAMH_MSGERROR
#define FRAMESTREAMH_EALOC
#define FRAMESTREAMH_ETREQ
#define FRAMESTREAMH_EREAD
#define FRAMESTREAMH_MSGENNUL
#define FRAMESTREAMH_MSGEALOC
#define FRAMESTREAMH_MSGEOPEN
#define FRAMESTREAMH_MSGENULL
#define FRAMESTREAMH_ENNUL
#define DEFINE_LAL_GET_TS_FUNCTION(laltype)
#define DEFINE_LAL_GET_TSM_FUNCTION(laltype)
void LALFrSeek(LALStatus *status, const LIGOTimeGPS *epoch, LALFrStream *stream)
#define DEFINE_LAL_GET_FS_FUNCTION(laltype)
void LALFrOpen(LALStatus *status, LALFrStream **stream, const CHAR *dirname, const CHAR *pattern)
#define DEFINE_LAL_WRITE_TS_FUNCTION(laltype)
void LALFrCacheOpen(LALStatus *status, LALFrStream **output, LALCache *cache)
void LALFrClose(LALStatus *status, LALFrStream **stream)
#define ABORT(statusptr, code, mesg)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
int LALError(LALStatus *status, const char *statement)
int XLALFrStreamSeek(LALFrStream *stream, const LIGOTimeGPS *epoch)
Seeks a LALFrStream stream to data at a given time.
int XLALFrStreamClose(LALFrStream *stream)
Closes a LALFrStream.
LALFrStream * XLALFrStreamCacheOpen(LALCache *cache)
Opens a LALFrStream associated with a LALCache.
LALFrStream * XLALFrStreamOpen(const char *dirname, const char *pattern)
Opens a LALFrStream for specified frame files.
@ LAL_FR_STREAM_URL
error opening frame URL
@ LAL_FR_STREAM_ERR
error in frame stream
@ LAL_FR_STREAM_TOC
error reading frame TOC
#define XLAL_PRINT_DEPRECATION_WARNING(replacement)
This structure details the state of the frame stream.
void output(int gps_sec, int output_type)